Elias79 wrote:To me that does not explain why the loop is never initiated it is like the loop was not even there, is this a feature or a bug or what am i missing?
The first time this line is reached, user_test is 0, not 1*:
Code: Select all
TNT1 A 1 A_JumpIf(user_test != 1, "Death")
If user_test is not 1, it'll jump to the Death state. What happens in the Death state? The actor is removed from the game.
In actor #1, the Death state doesn't exist. So even if user_test is not 1, the state jump fails, and the state sequence is continued.
* This is because when the actor first spawns, the function on the first state is not called, unless you have the [wiki=Actor_states#NoDelay]NoDelay[/wiki] keyword on the state:
Code: Select all
TNT1 A 1 NoDelay A_SetUserVar("user_test", 1)