dop2000's Forum Posts

  • No need for Javascript. You can check tile ID using "Tilemap Compare tile at" condition. Say, if it's a ground tile - spawn an earth creature. If it's a water tile - spawn water creature.

    To convert between layout and tilemap coordinates use these expressions:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/tilemap

  • Use "System Is between values", because I think the angle may not always be exactly 90 degrees.

    Note, that this is an inverted condition (right-click, Invert)

  • It really depends on the game. Sometimes instance variables will be better, sometimes a dictionary, sometimes a combination of both.

    In terms of performance dictionaries are very fast and you won't notice any difference.

  • You can compare the reflection angle and stop the loop.

    anglediff(LaserTurret.LineOfSight.ReflectionAngle, Ray.angle) expression will give you the difference between two angles.

  • No worries, glad it was helpful!

  • Wow, then can even pull each other. Great solution as always!

  • Is KnightTurret in the same container with the Knight? If not, then the code that pins them will not work correctly.

    "Acquire target" means a single target - a particular goblin instance among all other goblins. So you need to pick that instance before acquiring! Like I said, it's up to you how to pick it (by visibility, distance, lowest HP etc.), but you need conditions to pick the goblin instance. Please read some tutorials about picking in Construct, it's very important to understand how it works.

    Another option is automatic targeting - use "Add object to target" action. Then turrets will automatically select the target in range. This target can be identified by UID. If you want the knight to move to it, pick the instance by UID first:

    Every 0.5 seconds
    For Each Knight
    Goblin pick by unique ID = KnightTurret.Turret.TargetUID
     -> Knight Move To Goblin
    
  • You could move them toward each other if the distance is greater than 300.

    That was my first idea too. But it won't work very well if there are obstacles. It's better to move objects by changing velocity values, then the 8direction behavior will handle things like collisions and sliding properly.

  • Turret behavior is rotating the knight.

    Also, with multiple goblins you need to pick a goblin instance first. For example, the nearest goblin instance, or the instance with the lowest HP. Once the correct goblin instance is picked, use "acquire target" action in the Turret behavior to start firing at it..

    Alternatively, allow the Turret to automatically pick its target. And then move the knight to that target. Use Knight.Turret.TargetUID to identify the target goblin by its UID.

  • You will need to disable automatic targeting and use "Acquire target" action instead. For example:

    for each idle turret -> pick enemy turrets in range -> pick nearest of them -> acquire it as a target.

  • You can ask chatgpt all Javascript-related questions, it's pretty good.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • getAllAnimations() is an array. Here are the names of the first 2 animations:

    runtime.objects.Cannon.getAllAnimations()[0].name

    runtime.objects.Cannon.getAllAnimations()[1].name