by Matt » Mon Feb 19, 2007 5:38 am
Let's say you've got the following:
Code: Select all
MNST A 1 A_JumpIfHealthLower (20, 3)
MNST B 1
MNST C 1 A_AlertMonsters
MNST D 1
Here, the jump would go three frames: the jump call would skip A, B, and C, landing on D.
Without the jump, the actor would execute frames ABC first before it can do anything with D.
Now let's say we had this:
Code: Select all
MNST A 1 A_JumpIfHealthLower (20, 3)
MNST B 1
MNST C 1 A_AlertMonsters
goto See
MNST D 1
Here, the jump would go three frames: the jump call would skip A, B, and C, landing on D. It then executes D which is already past the goto and therefore doesn't execute the goto.
Without the jump, the actor would go through frames ABC, then encounter the goto, then go to its see state without hitting D.
The way I think about it is that the jump number should be the number of frames before the frame you want to jump to, including the frame that calls the jump and excluding the frame you want to jump to.
Let's say you've got the following:
[code]MNST A 1 A_JumpIfHealthLower (20, 3)
MNST B 1
MNST C 1 A_AlertMonsters
MNST D 1[/code]
Here, the jump would go three frames: the jump call would skip A, B, and C, landing on D.
Without the jump, the actor would execute frames ABC first before it can do anything with D.
Now let's say we had this:
[code]MNST A 1 A_JumpIfHealthLower (20, 3)
MNST B 1
MNST C 1 A_AlertMonsters
goto See
MNST D 1[/code]
Here, the jump would go three frames: the jump call would skip A, B, and C, landing on D. It then executes D which is already past the goto and therefore doesn't execute the goto.
Without the jump, the actor would go through frames ABC, then encounter the goto, then go to its see state without hitting D.
The way I think about it is that the jump number should be the number of frames before the frame you want to jump to, including the frame that calls the jump and excluding the frame you want to jump to.