dop2000's Forum Posts

  • I would suggest using a separator, for example "mango_5". This way you can have prices with several digits. Use int(tokenat(var, 1, "_")) to extract the price.

  • Yeah, it's a condensed if-then-else statement.

    (A ? B : C)

    If A is true, then the result will be B, otherwise it will be C.

    And you can use nested statements: (A ? B : (K ? L : M))

    The full expression in your case may look like this:

    (int(appleVar)>int(pearVar) & int(appleVar)>int(mangoVar)) ? appleVar : 
    (int(pearVar)>int(appleVar) & int(pearVar)>int(mangoVar)) ? pearVar : mangoVar
    

    It may not work correctly if two numbers are the same.

    EDIT: Just realized that int("abc123") does not extract the number, you'll have to use right()

  • With variables it's quite difficult. If there are only 2-4 of them, you can get away with an expression like (int(appleVar)>int(pearVar) & int(appleVar)>int(mangoVar)) ? appleVar : (int(pearVar)>int(appleVar) & int(pearVar)>int(mangoVar)) ? pearVar : .....

    But if there are more values, you should probably use an array or dictionary. Loop through all values, extract the integer part and compare it with the previous biggest number.

  • I would suggest opening and studying the official templates in C3, starting from the beginner level. They are a great learning resource, demonstrate all C3 features and best practices.

  • There are two addons you can use:

    construct.net/en/make-games/addons

    I tried both and they work very similar. Make sure to add 1-2px transparent border around the images in the animation editor.

  • Define 8 additional image points in your circle sprite (lets call it Gun). The Origin image point should be in the center. Then you can do this:

    Repeat 8 times 
     Gun spawn Bullet at image point (loopindex+1)
     Bullet set angle to angle(Gun.x, Gun.y, Self.x, Self.y)
    

    In Bullet behavior properties set "Set angle=yes"

  • You need to pick an instance of TextBox, try something like this:

    runtime.objects.TextBox.getFirstInstance()....
    

    Is there a reason why you are doing this with scripts? It's easier with events. Besides, only a small part of C3 functionality is exposed to scripts, so I suggest you get familiar with the event system, as it's the primary method of coding in Construct.

  • Yeah, it's for a big project with huge complex tilemaps. Spawning sprites is not an option, unfortunately.

    I found another workaround - I generate a temporary local obstacle map around the character when it crosses the bridge, and disable collisions with the main tilemap using solid collision filters. But a plugin allowing to disable tile collision would make this job much easier.

  • Litetween can be configured on the object itself. Click the object instances on both layouts and compare their litetween settings.

    But of course the best solution would be getting rid of LiteTween and replacing it with the official Tween behavior.

  • The crosses are supposed to teleport at random places at random time. The place is different for each cross, so this works, but they teleport all in the same time, do you know why ?

    Because you are not picking a cross instance. When you don't pick any instances, then all instances will be affected. Try adding "System pick random cross" condition into event #3.

  • You need to wrap events 23, 24, 30, 31 in "For each" loops.

    When there are multiple instances, expressions like distance() only work correctly for the first instance. Adding "For each thorax" or "For each patte" should fix the issue.

    If it doesn't help, please upload your project to any file sharing service and post the link here.

  • I need to enable/disable collisions in runtime for individual tiles. For example: there is a long river made with the same water tile. Water tile has its collision polygon enabled. I need to create a bridge to walk across the water, but I can't replace the water tile with a different tile ID. I need to keep this tile in place, but disable its collision. The rest of the river tiles should have their collisions enabled.

    Is this addon possible?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The files are encrypted and it may be very difficult or even impossible to restore them. Try searching for solutions in Google or posting on some other forum about cyber security..

    Here is one link I found:

    pcrisk.com/removal-guides/20895-nusm-ransomware

  • Add "Browser Log" action with the following string:

    "Overheat:" & Overheat & " WeaponLevel:" & WeaponLevel & " RESULT:" & ((Overheat / 6) * (WeaponLevel - 100) ^(1.5 * ((WeaponLevel - 100) / 10) /2))

    Open browser console in preview (F12), try to find a bullet with NaN damage, you'll be able to see the values of Overheat and WeaponLevel variables, maybe there is something wrong with them.

    If this doesn't help, please post a small project demonstrating the issue.

    .

    Edit: (-10)^1.5 returns NaN, so the most likely reason is that WeaponLevel is less than 100 for some bullets. A simple fix would be adding max(WeaponLevel,100)

  • You are right. Change the code like this to fix: