Problem with structure variables and loop

Hi,
I’m having a problem with structure variables.
The part highlighted in blue (and everything else) works, the part highlighted in red doesn’t work.


I tried using animation number, animation name, animation frame number…no luck.
But if I remove the animation condition, dead switches to 1 as expected.
I don’t know what’s going on :neutral_face:
Maybe I should note that I had syntax issues before reaching this problem. I didn’t remember if I needed a dot before or after the brackets, I made a few tests that triggered wild results…

Can you show a screenshot of the events that switch your ESoldier to the “death” animation? (Nothing in the above screenshot sets that animation)

Also, can you show your ESoldier object’s animation list?

The animation itself works fine, (and I’m using that animation condition in other places without issue) but here are the screens:



And the variables in the debugger:
image
X/Y at 0/0 means that leader #2 died before I ever pressed ‘s’.

Hmm… I wonder if it’s the nesting somehow.

Can you add another “Repeat for each instance of ESoldier” underneath “s key is pressed”
And move your "the animation of esoldier is “death” event under this new for each? I know that won’t give you what you’re expecting for variables, I just want to see if it will actually take the actions then.

Thanks for the brainstorm!
I realized I didn’t need to put this death event under any keypress, and when I moved it out, I noticed all the keypresses had a parent condition “soldier is not dead”. :weary:
Feel free to slap me with a trout. :sweat_smile:

2 Likes