Page 1 of 1

(Help) Chaingun's frame change problem

Posted: Fri May 04, 2018 2:54 am
by Shotgun guy
I changed the Chaingun's frame,but it doesn't work as in Doom. I used this:https://zdoom.org/wiki/Classes:Chaingun and https://zdoom.org/wiki/A_FireCGun

Code: Select all

//Weapons: Ultra Chaingun

ACTOR UltraChaingun : DoomWeapon replaces Chaingun
{
   Weapon.SelectionOrder 700
   //Weapon.AmmoUse 1
   //Weapon.AmmoGive 20
   //Weapon.AmmoType "Clip"
   Inventory.PickupMessage "$GOTCHAINGUN!"
   Obituary "$OB_MPCHAINGUN" // "%o was mowed down by %k's chaingun."
   Tag "$TAG_CHAINGUN"
   States
   {
   Ready:
     CHGG A 1 A_WeaponReady
     Loop
   Deselect:
     CHGG A 1 A_Lower
     Loop
   Select:
     CHGG A 1 A_Raise
     Loop
   Fire:
     CHGG AB 4 A_FireCGun
     CHGG B 0 A_ReFire
     Goto Ready
   Flash:
     CHGF A 5 Bright A_Light1
     Goto LightDone
     CHGF B 5 Bright A_Light2
     Goto LightDone 
   Spawn:
     MGUN A -1
     Stop
   }
}

ACTOR FireCGun
{
  Fire:
	 CHGG A 0 A_PlaySound("weapons/uchain", CHAN_WEAPON)
     CHGG A 0 A_GunFlash
	 CHGG A 4 A_FireBullets(8.5, 0, 1, 5, "BulletPuff")
     CHGG A 0 A_PlaySound("weapons/uchain", CHAN_WEAPON)
     CHGG B 0 A_GunFlash("Flash2")
     CHGG B 4 A_FireBullets(8.5, 0, 1, 5, "BulletPuff")
     CHGG B 0 A_ReFire
     Goto Ready
  Flash:
     CHGF A 4 Bright A_Light1
     Goto LightDone
  Flash2:
     CHGF B 4 Bright A_Light2
     Goto LightDone	 
   }
} 

Re: (Help) Chaingun's frame change problem

Posted: Fri May 04, 2018 2:58 am
by NeoTerraNova
What, exactly, is it not doing that you want it to do?

I can see, first of all, that you have the lines for AmmoUse, AmmoGive, and AmmoType commented out, so they won't function, but what else is the matter?

Re: (Help) Chaingun's frame change problem

Posted: Fri May 04, 2018 3:07 am
by Shotgun guy
I did,that it use infinite ammo. I'd like to see all frame when I shoot with Chaingun. CHGGB0 frame I don't see when I finished the shooting.

Re: (Help) Chaingun's frame change problem

Posted: Fri May 04, 2018 3:27 am
by NeoTerraNova
The Chaingun only has four total images - two "Gun Flash" images, and two images of the barrels "spinning." When I tested the code, it worked fine. The image "CHGGB" is the second frame of the barrels spinning. The number 0 on the end indicates that this line/action has no frames actually assigned to play when activated. If you want to have that frame visible, change the 0 to a 1, like "CHGBB1" (or, CHGG B 1). This will, however, slow down the fire rate of the weapon.

Re: (Help) Chaingun's frame change problem

Posted: Fri May 04, 2018 12:53 pm
by Shotgun guy
So I'd like to do,that it use original Doom's function. But it give other sound.

Re: (Help) Chaingun's frame change problem

Posted: Fri May 04, 2018 1:18 pm
by NeoTerraNova
Change this:

CHGG A 0 A_PlaySound("weapons/uchain", CHAN_WEAPON)

to:

CHGG A 0 A_PlaySound("weapons/mchain", CHAN_WEAPON)

And create a sound file within your WAD called "mchain" that has the sound you want. Then, create a file within your WAD called "SNDINFO." Within this text file, put this:

weapons/mchain

Re: (Help) Chaingun's frame change problem

Posted: Sun May 06, 2018 1:35 pm
by Shotgun guy
I could add the sound. But I tried to change to SW97 style. Isn't good.

Code: Select all

   Spawn:
     MGUN A -1
     Loop     
   Ready:
     CHGG A 1 A_WeaponReady
     Loop
   Deselect:
     CHGG A 1 A_Lower
     Loop
   Select:
     CHGG A 1 A_Raise
     Loop
   Fire:
	 CHGG B 0 A_GunFlash
     CHGG B 0 A_PlaySound("weapons/uchain", CHAN_WEAPON)
     CHGG B 3 A_FireBullets(8.5, 0, 1, 5, "BulletPuff")
     CHGG C 0 A_CheckReload
     CHGG C 0 A_PlaySound("weapons/uchain", CHAN_WEAPON)
     CHGG C 3 A_FireBullets(8.5, 0, 1, 5, "BulletPuff")
     CHGG A 0 A_ReFire
     Goto Ready
   Flash:
     CHGG B 3 Bright A_Light1
     CHGG B 3 Bright A_Light2
     CHGG C 0 Bright A_Light0 
	 Stop

Re: (Help) Chaingun's frame change problem

Posted: Sun May 06, 2018 6:08 pm
by NeoTerraNova
Mm. I'm afraid I'm out of my depth, here. My apologies.

Re: (Help) Chaingun's frame change problem

Posted: Wed May 09, 2018 4:07 am
by Shotgun guy
So I could solve:

Code: Select all

//Weapons: Ultra Chaingun

ACTOR UltraChaingun : DoomWeapon replaces Chaingun
{
   Weapon.SelectionOrder 700
   //Weapon.AmmoUse 1
   //Weapon.AmmoGive 20
   //Weapon.AmmoType "Clip"
   Inventory.PickupMessage "$GOTCHAINGUN!"
   Obituary "$OB_MPCHAINGUN" // "%o was mowed down by %k's chaingun."
   Tag "$TAG_CHAINGUN"
   States
   {  
   Ready:
     CHGG A 1 A_WeaponReady
     Loop
   Deselect:
     CHGG A 1 A_Lower
     Loop
   Select:
     CHGG A 1 A_Raise
     Loop
   Fire:
	 CHGG A 0 A_GunFlash
     CHGG B 0 A_PlaySound("weapons/uchain", CHAN_WEAPON)
     CHGG C 2 A_FireBullets(8.5, 0, 1, 5, "BulletPuff")
     CHGG C 0 A_PlaySound("weapons/uchain", CHAN_WEAPON)
     CHGG B 2 A_FireBullets(8.5, 0, 1, 5, "BulletPuff")
     CHGG A 0 A_ReFire
     Goto Ready
   Spawn:
     MGUN A -1
     Stop   
   }
}