Hey all,
Plugins involved:
Yanfly's Action Sequence
Action Sequence Loops by SergeofBIBEK (this is for the "while" commands)
I've got a pretty gigantic piece of code I'm working on for a skill's action sequence. I'm putting it at the bottom of this post since it's so long. Let me break down what's going on in this action sequence:
Anyway, the main question here is "why is the 'if mov == 0' condition below being ignored?"
Plugins involved:
Yanfly's Action Sequence
Action Sequence Loops by SergeofBIBEK (this is for the "while" commands)
I've got a pretty gigantic piece of code I'm working on for a skill's action sequence. I'm putting it at the bottom of this post since it's so long. Let me break down what's going on in this action sequence:
- This is a machine gun attack that fires a total of 20 times.
- It fires two "hits" in each "loc".
- Each loc is a set of anims that are the same but in different horizontal positions across the screen
- The effect is that it will spray bullets in a seemingly random pattern across the screen
- "mov" is allowing the "loc"s to appear from right to left, or left to right
- "SEchoice" is playing the sound independently of the anims to save on sound channels/performance (it's the sound of 10 shots in a row)
- "dam" is randomizing how many times the enemy is hit by the spray of bullets.
- I put in the "else wait: 20" to see if it ever happens and it doesn't
Anyway, the main question here is "why is the 'if mov == 0' condition below being ignored?"
JavaScript:
<whole action>
eval: hits = 2
eval: loc = 5
eval: mov = Math.randomInt(1)
eval: odir = 0
while odir < 2
if mov == 0
eval: loc = 5
eval: SEchoice = Math.randomInt(2)
if SEchoice == 0
SE: gun_semi_auto_rifle_shot_00_automatic_01, 80, 100, 0
else if SEchoice == 1
SE: gun_semi_auto_rifle_shot_00_automatic_01, 80, 95, 0
else if SEchoice == 2
SE: gun_semi_auto_rifle_shot_00_automatic_01, 80, 105, 0
end
while loc > 0
eval: smg = Math.randomInt(5)
while hits > 0
eval: hits--
if smg == 0 && loc == 1
ANIMATION 259: target
else if smg == 1 && loc == 1
ANIMATION 260: target
else if smg == 2 && loc == 1
ANIMATION 261: target
else if smg == 3 && loc == 1
ANIMATION 262: target
else if smg == 4 && loc == 1
ANIMATION 263: target
else if smg == 5 && loc == 1
ANIMATION 264: target
else if smg == 0 && loc == 2
ANIMATION 265: target
else if smg == 1 && loc == 2
ANIMATION 266: target
else if smg == 2 && loc == 2
ANIMATION 267: target
else if smg == 3 && loc == 2
ANIMATION 268: target
else if smg == 4 && loc == 2
ANIMATION 269: target
else if smg == 5 && loc == 2
ANIMATION 270: target
else if smg == 0 && loc == 3
ANIMATION 271: target
else if smg == 1 && loc == 3
ANIMATION 272: target
else if smg == 2 && loc == 3
ANIMATION 273: target
else if smg == 3 && loc == 3
ANIMATION 274: target
else if smg == 4 && loc == 3
ANIMATION 275: target
else if smg == 5 && loc == 3
ANIMATION 276: target
else if smg == 0 && loc == 4
ANIMATION 277: target
else if smg == 1 && loc == 4
ANIMATION 278: target
else if smg == 2 && loc == 4
ANIMATION 279: target
else if smg == 3 && loc == 4
ANIMATION 280: target
else if smg == 4 && loc == 4
ANIMATION 281: target
else if smg == 5 && loc == 4
ANIMATION 282: target
else if smg == 0 && loc == 5
ANIMATION 283: target
else if smg == 1 && loc == 5
ANIMATION 284: target
else if smg == 2 && loc == 5
ANIMATION 285: target
else if smg == 3 && loc == 5
ANIMATION 286: target
else if smg == 4 && loc == 5
ANIMATION 287: target
else if smg == 5 && loc == 5
ANIMATION 288: target
end
ANIMATION WAIT: 1
eval: smg = Math.randomInt(5)
end while
eval: loc--
eval: hits = 2
if loc == 0
eval: mov = 1
eval: odir++
ANIMATION WAIT: 5
end
end while
else
WAIT: 20
end
if mov == 1
eval: loc = 5
eval: SEchoice = Math.randomInt(2)
if SEchoice == 0
SE: gun_semi_auto_rifle_shot_00_automatic_01, 80, 100, 0
else if SEchoice == 1
SE: gun_semi_auto_rifle_shot_00_automatic_01, 80, 95, 0
else if SEchoice == 2
SE: gun_semi_auto_rifle_shot_00_automatic_01, 80, 105, 0
end
while loc > 0
eval: smg = Math.randomInt(5)
while hits > 0
eval: hits--
if smg == 0 && loc == 5
ANIMATION 259: target
else if smg == 1 && loc == 5
ANIMATION 260: target
else if smg == 2 && loc == 5
ANIMATION 261: target
else if smg == 3 && loc == 5
ANIMATION 262: target
else if smg == 4 && loc == 5
ANIMATION 263: target
else if smg == 5 && loc == 5
ANIMATION 264: target
else if smg == 0 && loc == 4
ANIMATION 265: target
else if smg == 1 && loc == 4
ANIMATION 266: target
else if smg == 2 && loc == 4
ANIMATION 267: target
else if smg == 3 && loc == 4
ANIMATION 268: target
else if smg == 4 && loc == 4
ANIMATION 269: target
else if smg == 5 && loc == 4
ANIMATION 270: target
else if smg == 0 && loc == 3
ANIMATION 271: target
else if smg == 1 && loc == 3
ANIMATION 272: target
else if smg == 2 && loc == 3
ANIMATION 273: target
else if smg == 3 && loc == 3
ANIMATION 274: target
else if smg == 4 && loc == 3
ANIMATION 275: target
else if smg == 5 && loc == 3
ANIMATION 276: target
else if smg == 0 && loc == 2
ANIMATION 277: target
else if smg == 1 && loc == 2
ANIMATION 278: target
else if smg == 2 && loc == 2
ANIMATION 279: target
else if smg == 3 && loc == 2
ANIMATION 280: target
else if smg == 4 && loc == 2
ANIMATION 281: target
else if smg == 5 && loc == 2
ANIMATION 282: target
else if smg == 0 && loc == 1
ANIMATION 283: target
else if smg == 1 && loc == 1
ANIMATION 284: target
else if smg == 2 && loc == 1
ANIMATION 285: target
else if smg == 3 && loc == 1
ANIMATION 286: target
else if smg == 4 && loc == 1
ANIMATION 287: target
else if smg == 5 && loc == 1
ANIMATION 288: target
end
ANIMATION WAIT: 1
eval: smg = Math.randomInt(5)
end while
eval: hits = 2
eval: loc--
if loc == 0
eval: mov = 0
eval: odir++
ANIMATION WAIT: 5
end
end while
else
WAIT: 20
end
end while
action effect: target
action effect: target
action effect: target
action effect: target
action effect: target
eval: dam = Math.randomInt(100)
if dam > 10 && dam < 70
action effect: target
else if dam > 70 && dam < 100
action effect: target
action effect: target
end
</whole action>