selection bug?

0 favourites
  • 2 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • Problem Description

    selected 'enemy' is wrong

    Attach a Capx

    https://www.dropbox.com/s/ao0x96r0s09vz ... .capx?dl=0

    Description

    what i want to make is to create a '!' object above the 'enemy' whose 'Attack cooldown' is 0 or less, and thus, i use

    'create object '!' on layer 0 (enemy.x, enemy.y - enemy.height/2 - 35)' action on

    'if enemy.curATKCD <= 0' condition

    in hope that the object '!' will be created above the enemy whose curATKCD reached 0 or below

    but it doesnt work, the '!' is created on a random 'enemy' instead

    i can circumvent this by using 'enemy spawn object' instead... but i'm pretty sure my coding aren't wrong <img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral">

    also using enemy spawn object, i need to make the spawn point for ALL the enemy, which is going to be a lot

    I dunno if it's my logic that's wrong or this is an actual bug (as i expected the enemy object to be selected when the conditions is met, but it doesnt seem so, random enemy object is selected instead)

    Steps to Reproduce Bug

    just wait a few seconds

    Affected Browsers

    • FireFox:

    Operating System and Service Pack

    windows 10

    Construct 2 Version ID

    244

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's just a mistake in your events. Since 'Create object' is a system action, it runs once regardless of how many Enemy instances are picked. This is all documented. You can add a 'For each enemy' condition after the comparison to force it to run the 'Create object' action once per picked Enemy, which is what the 'Spawn an object' action does automatically (because it's an action in Enemy).

    Another mistake in your events is that you continue to create hundreds of "!" objects because the condition is continually true. You probably want a boolean instance variable to mark if you've already created it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)