Flash state doesn't work.

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Flash state doesn't work.

Post by XutaWoo »

Code: Select all

actor CPosGunMV : Chaingun replaces Chaingun
{
  inventory.pickupmessage "You got the chaiingun, uzi, and trishot!"
  weapon.ammotype2 Shell
  states
  {
  Ready:
   CHGG A 0 A_JumpIfInventory ("MCheck", 1, "ReadyM")
   CHGG A 0 A_JumpIfInventory ("VCheck", 1, "ReadyV")
   CHGG A 1 A_WeaponReady
   loop
  ReadyM:
   UZIG A 1 A_WeaponReady
   goto Ready
  ReadyV:
   TRIG A 1 A_WeaponReady
   goto Ready
  Fire:
   PISG A 0 A_JumpIfInventory ("MCheck", 1, "FireM")
   PISG A 0 A_JumpIfInventory ("VCheck", 1, "FireV")
   CHGG AB 4 A_FireCGun
   CHGG B 0 A_ReFire
   Goto Ready
  Flash:
   SHTG A 0 A_JumpIfInventory ("MCheck", 1, "FlashM")
   SHTG A 0 A_JumpIfInventory ("VCheck", 1, "Flash2")
   CHGF A 5 Bright A_Light1
   Goto LightDone
   CHGF B 5 Bright A_Light0
   Goto LightDone
  FlashM:
   TNT1 A 4 Bright A_Light1
   Goto LightDone
   TNT1 A 4 Bright A_Light0
   Goto LightDone
  Flash2:
   TNT1 A 4 Bright A_Light1
   Goto LightDone
   TNT1 A 4 Bright A_Light0
   Goto LightDone
  FireM:
   UZIG A 0 A_GunFlash
   UZIG A 0 A_PlayWeaponSound ("weapons/uzi")
   UZIG BC 2 A_FireBullets (9.5, 7.5, 1, 5)
   UZIG A 10 A_ReFire
   Goto Ready
  FireV:
   TRIG A 0 A_JumpIfInventory ("Shell", 1, 1)
   goto Ready
   TRIG A 0 A_JumpIfInventory ("Clip", 3, 1)
   goto Ready
   TRIG A 0 A_TakeInventory ("Shell", 1)
   TRIG A 0 A_TakeInventory ("Clip", 2)
   TRIG A 0 A_GunFlash
   TRIG A 0 A_PlayWeaponSound ("weapons/shotgf")
   TRIG B 4 A_FireBullets (7.6, 5.4, 6, 5)
   TRIG A 10 A_CheckForReload (2, "RotLeft")
   TRIG EDC 3 A_ResetReloadCounter
   goto Ready
  RotLeft:
   TRIG A 10 
   TRIG CDE 3
   goto Ready
  Hold:
   PISG A 0 A_JumpIfInventory ("MCheck", 1, "HoldM")
   CHGG AB 4 A_FireCGun
   CHGG B 0 A_ReFire
   Goto Ready
  HoldM:
   UZIG A 0 A_GunFlash
   UZIG A 0 A_PlayWeaponSound ("weapons/uzi")
   UZIG BC 2 A_FireBullets (9.5, 7.5, 1, 5)
   UZIG A 10 A_ReFire
   goto Ready
  }
}
For some reason, the standard chaingun's flash doesn't animate until I let go of the fire button. What's wrong with it?
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: Flash state doesn't work.

Post by Macil »

Is there supposed to be a LightDone state? You use Goto on it a lot.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Flash state doesn't work.

Post by XutaWoo »

It's on all of DOOM's flash states, so I think it has to do with coding or something. Also, before you ask, removing the first Goto LightDone does nothing.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Flash state doesn't work.

Post by Graf Zahl »

The way you set it up doesn't work for A_FireCGun. Better don't use that function. It requires a very specific flash state setup. You are better off using A_GunFlash and one of the generic attack functions.
Locked

Return to “Editing (Archive)”