NaturalTvventy Posted April 26, 2010 Hey y'alls. I'm trying to create a warmup pause for a weapon in zdoom before it starts blasting away, but I have no idea how. Here's the code for it's firing. Fire: MNGG A 0 A_GunFlash MNGG A 2 A_FireBullets(5, 1, 1, 5) MNGG B 2 A_FireBullets(5, 1, 1, 5) MNGG B 0 A_ReFire MNGG B 2 MNGG A 5 MNGG B 8 MNGG A 11 MNGG B 14 MNGG A 17 goto Ready as anyone in the know can see it has a cooldown already, but i want a warmup too. little help? Thx, NT 0 Share this post Link to post
TheDarkArchon Posted April 26, 2010 Fire: MNGG B 17 MNGG A 14 MNGG B 11 MNGG A 8 MNGG B 5 MNGG A 2 Hold: MNGG A 0 A_GunFlash MNGG A 2 A_FireBullets(5, 1, 1, 5) MNGG B 2 A_FireBullets(5, 1, 1, 5) MNGG B 0 A_ReFire MNGG B 2 MNGG A 5 MNGG B 8 MNGG A 11 MNGG B 14 MNGG A 17 goto Ready 0 Share this post Link to post
Gez Posted April 26, 2010 http://www.realm667.com/board/viewtopic.php?f=25&t=335NeuralStunner said: That's what the Hold state was born for! :-D Fire: MNGG B 6 MNGG A 5 MNGG B 4 Hold: MNGG A 3 // Shoot bullets here. ;) MNGG B 3 // And here? MNGG A 2 A_Refire Goto Ready 0 Share this post Link to post
NaturalTvventy Posted April 27, 2010 Well, almost perfect. The only problem with this is even if you just tap the button you have to go through the whole warm up and first couple shots. any way to make it so that when you take your finger off the trigger the sequence stops, AND only have the cooldown if some rounds have gone off? 0 Share this post Link to post
Worst Posted April 27, 2010 try this: Fire: MNGG B 0 A_JumpIf(args[0] == 1,"Warm1") //depending on how far the MNGG B 0 A_JumpIf(args[0] == 2,"Warm2") //the warmup sequence is, MNGG B 0 A_JumpIf(args[0] == 3,"Warm3") //jump to one of these MNGG B 0 A_JumpIf(args[0] == 4,"Warm4") //labels. MNGG B 0 A_JumpIf(args[0] == 5,"Warm5") MNGG B 0 A_JumpIf(args[0] == 6,"WarmedUp") MNGG B 17 A_SetArg (0,args[0]+1) //args[0] <- this is the warmup variable MNGG B 0 A_ReFire //jump back to "Fire:" if key is held. MNGG B 0 A_SetArg (0,0) //else: reset warmup value Goto Ready Warm1: MNGG A 14 A_SetArg (0,args[0]+1) MNGG A 0 A_ReFire MNGG B 0 A_SetArg (0,0) Goto Ready Warm2: MNGG B 11 A_SetArg (0,args[0]+1) MNGG B 0 A_ReFire MNGG B 0 A_SetArg (0,0) Goto Ready Warm3: MNGG A 8 A_SetArg (0,args[0]+1) MNGG A 0 A_ReFire MNGG B 0 A_SetArg (0,0) Goto Ready Warm4: MNGG B 5 A_SetArg (0,args[0]+1) MNGG B 0 A_ReFire MNGG B 0 A_SetArg (0,0) Goto Ready Warm5: MNGG A 2 A_SetArg (0,args[0]+1) MNGG A 0 A_ReFire MNGG B 0 A_SetArg (0,0) Goto Ready WarmedUp: MNGG A 0 //A_GunFlash MNGG A 2 A_FireBullets(5, 1, 1, 5) MNGG B 2 A_FireBullets(5, 1, 1, 5) MNGG B 0 A_ReFire MNGG B 0 A_SetArg (0,0) //Reset warmup variable if fire key is no longer held MNGG B 2 MNGG A 5 MNGG B 8 MNGG A 11 MNGG B 14 MNGG A 17 goto Ready 0 Share this post Link to post
TheDarkArchon Posted April 27, 2010 Worst said:try this: *code* That's using a ton of particularly potent explosives to unlock a door. The only reason you'd use something like that is to enable refire when the barrels are spinning down. 0 Share this post Link to post
Worst Posted April 27, 2010 Well yeah, but would you rather mix ACS to the weapon decorate to figure out if the fire key is held? This is less likely to clash with other mods which might use ACS.. (admitted its not that often that they clash :p) I know that also using user_variables would be better off than args[] but that'd also mean changing the playerclass aswell. ..I would do that myself, but I figured a simple example would be more easier to understand, than having one with a DECORATE, KEYCONF, ACS and LOADACS lump. 0 Share this post Link to post
NaturalTvventy Posted April 28, 2010 that code works pretty darn good, so thanks for it. every so now and then though the gun just jumps straight into firing, skipping the warmup completely. any idea why? Thx, NT 0 Share this post Link to post
NaturalTvventy Posted April 28, 2010 I do believe i figured out how to make it skip the warm-up. when you run out of ammo and then automatically switch to another weapon, if you then pick up some ammo and pull up the gun again while holding the trigger it skips the warmup sequence. 0 Share this post Link to post
Worst Posted April 29, 2010 Its probably that when you run out of ammo, but still hold the fire key, it will still jump from the A_ReFire, and at the same time miss the A_SetArg (0,0) which resets the warmup. (those cant be swapped either, otherwise you'd be doing the warmup each and everytime) however, maybe this works better:Fire: MNGG B 0 A_SetArg (0,0) Goto Hold Hold: MNGG B 0 A_JumpIf(args[0] == 1,"Warm1") //depending on how far the MNGG B 0 A_JumpIf(args[0] == 2,"Warm2") //the warmup sequence is, MNGG B 0 A_JumpIf(args[0] == 3,"Warm3") //jump to one of these MNGG B 0 A_JumpIf(args[0] == 4,"Warm4") //labels. MNGG B 0 A_JumpIf(args[0] == 5,"Warm5") MNGG B 0 A_JumpIf(args[0] == 6,"WarmedUp") MNGG B 17 A_SetArg (0,args[0]+1) //args[0] <- this is the warmup variable MNGG B 0 A_ReFire //jump back to "Hold:" if key is held. Goto Ready Warm1: MNGG A 14 A_SetArg (0,args[0]+1) MNGG A 0 A_ReFire Goto Ready Warm2: MNGG B 11 A_SetArg (0,args[0]+1) MNGG B 0 A_ReFire Goto Ready Warm3: MNGG A 8 A_SetArg (0,args[0]+1) MNGG A 0 A_ReFire Goto Ready Warm4: MNGG B 5 A_SetArg (0,args[0]+1) MNGG B 0 A_ReFire Goto Ready Warm5: MNGG A 2 A_SetArg (0,args[0]+1) MNGG A 0 A_ReFire Goto Ready WarmedUp: MNGG A 0 //A_GunFlash MNGG A 2 A_FireBullets(5, 1, 1, 5) MNGG B 2 A_FireBullets(5, 1, 1, 5) MNGG B 0 A_ReFire MNGG B 2 MNGG A 5 MNGG B 8 MNGG A 11 MNGG B 14 MNGG A 17 goto Ready 0 Share this post Link to post
NaturalTvventy Posted April 29, 2010 yea that looks like it fixed the problem happy face :D you are the man. 0 Share this post Link to post