Szuran Posted May 3, 2019 I have a 4-frame gun animation. Frame 1 - gun ready Frame 2 and 3 - when you press 'fire' these get the gun into firing position Frame 4 - the gun is in position and I want it to remain there until you stop firing I cannot make the animation not loop back to frame 2. This is the code I'm working with. I know I mixed BFG with plasma, but that works fine. Help, please. Quote Fire: PLSG B 3 A_BFGSound PLSG C 3 A_FireBFG PLSG D 20 A_ReFire Goto Ready 0 Quote Share this post Link to post
1 Nevander Posted May 3, 2019 (edited) What you need is a state label inside A_ReFire. It can be used to send the weapon to another state if the trigger is still being held, in your case a state where the last frame is looped. https://zdoom.org/wiki/A_ReFire Edited May 3, 2019 by Nevander 0 Quote Share this post Link to post
0 Szuran Posted May 3, 2019 I don't get this wiki entry. What is the state I should enter? PLSG D 5 A_ReFire [(str PLSG D)] PLSG D 5 A_ReFire [(str "PLSG D")] PLSG D 5 A_ReFire [(str "fire")] They don't work. What should I enter there? 0 Quote Share this post Link to post
0 Nevander Posted May 3, 2019 You have to use the state label, not the state itself. Labels are things like Fire, Hold, Spawn, etc. So you need a state label called Hold that then loops the frames you want, then repeat A_ReFire in it. Fire: PLSG B 3 A_BFGSound PLSG C 3 A_FireBFG PLSG D 20 A_ReFire("Hold") Goto Ready Hold: PLSG D 5 A_ReFire Goto Ready Something like that. 0 Quote Share this post Link to post
0 Szuran Posted May 3, 2019 Thanks, that's something that could've been explained better in the wiki, but... Hmm, using this Hold label causes some error that closes the app. 0 Quote Share this post Link to post
1 SaladBadger Posted May 3, 2019 (edited) nevander posted an infinite loop. Never, ever jump to a given state from the same state, actions are executed immediately and so it starts doing nothing but running that loop until GZD determines something's wrong and closes the application. Do something like this instead: Hold: PLSG D 1 PLSG D 0 A_Refire Goto Ready Edited May 3, 2019 by SaladBadger 0 Quote Share this post Link to post
0 Szuran Posted May 4, 2019 Thanks for explaining. This still didn't work as it held the frame but didn't cause the projectile to appear, so I added Hold: PLSG D 1 PLSG D 6 A_FireBFG PLSG D 1 A_Refire And now it works perfectly! 0 Quote Share this post Link to post
Question
Szuran
I have a 4-frame gun animation.
Frame 1 - gun ready
Frame 2 and 3 - when you press 'fire' these get the gun into firing position
Frame 4 - the gun is in position and I want it to remain there until you stop firing
I cannot make the animation not loop back to frame 2.
This is the code I'm working with. I know I mixed BFG with plasma, but that works fine. Help, please.
Share this post
Link to post
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.