Minigun goes to DESELECT instead of a different state on no ammo.
Posted: Thu Oct 22, 2015 4:00 pm
Hello. I have life issues with my minigun. Every thing is fine, but only one thing disturbes me. When firing in primary mode with no ammo in inventory it should go in to the MINISTOPDESELECT (spin barrels down and than A_DESELECT) and not do A_DESELECT. How to fix it?
Code: Select all
ACTOR Spin: Inventory
{
inventory.maxamount 1
}
ACTOR MinigunAmmo : Ammo
{
Inventory.PickupMessage "Picked up some minigun ammo."
Inventory.Amount 50
Inventory.MaxAmount 400
Ammo.BackpackMaxAmount 800
Ammo.BackpackAmount 50
Inventory.Icon "AMMOA0"
States
{
Spawn:
AMMO A -1
Loop
}
}
ACTOR Minigun : Weapon
{
Weapon.AmmoType "MinigunAmmo"
Weapon.SelectionOrder 700
Decal BulletChip
Weapon.AmmoGive 60
Weapon.AmmoUse 1
Inventory.PickupSound "misc/w_pkup"
Inventory.PickupMessage "Picked up a minigun!"
Obituary "%o was shredded by %k's minigun."
+NOEXTREMEDEATH
States
{
Spawn:
MNGN A -1
Loop
Ready:
MNGG A 1 A_WeaponReady
Loop
Ready2:
TNT1 A 0 A_PlaySound("CHAINSPI")
TNT1 A 0 A_AlertMonsters
MNGG AB 2 A_WeaponReady
Loop
Deselect:
TNT1 A 0 A_JumpIfInventory("Spin",1,"MINISTOPDESELECT")
TNT1 A 0 A_TakeInventory ("Spin",1)
TNT1 A 0 A_STOPSOUND (0)
TNT1 A 0 A_STOPSOUND (1)
MNGG A 0 A_Lower
MNGG A 1 A_Lower
Loop
Select:
MNGG A 0 A_Raise
MNGG A 1 A_Raise
Loop
Fire:
goto morefire
Morefire:
TNT1 A 0 A_JUMPIFNOAMMO ("MINISTOPDESELECT")
TNT1 A 0 A_JumpIfInventory("Spin",1,"Fire2")
TNT1 A 0 A_PlaySound("CHAINSTA")
MNGG AB 4
MNGG AB 2
MNGG AB 2
Goto Hold
Hold:
TNT1 A 0 A_JUMPIFNOAMMO ("MINISTOPDESELECT")
TNT1 A 0 A_JumpIfInventory("Spin",1,"Fire2")
MNGG A 0 A_GunFlash
TNT1 A 0 A_PlaySound("CHAINSPI")
TNT1 A 0 A_PlaySound("weapons/minigunfire")
MNGG A 2 A_FireBullets(4, 3, -1, 9)
MNGG B 2 A_FireBullets(4, 3, -1, 8.5)
TNT1 A 0 A_STOPSOUND (0)
MNGG B 0 A_ReFire
TNT1 A 0 A_JumpIfInventory("Spin",1,"Fire2")
MNGG AB 2
TNT1 A 0 A_PlaySound("CHAINSTO")
MNGG AB 4
MNGG AB 6
MNGG AB 8
Goto Ready
Fire2:
TNT1 A 0 A_JUMPIFNOAMMO ("MINISTOPDESELECT")
MNGG A 0 A_GunFlash
TNT1 A 0 A_PlaySound("CHAINSPI")
TNT1 A 0 A_PlaySound("weapons/minigunfire")
MNGG A 2 A_FireBullets(5.5, 4.5, -1, 9)
MNGG B 2 A_FireBullets(5.5, 4.5, -1, 8.5)
TNT1 A 0 A_STOPSOUND (0)
MNGG B 0 A_ReFire
goto Ready2
AltFire:
TNT1 A 0 A_JumpIfInventory("Spin",1,"StopAlt")
TNT1 A 0 A_GiveInventory ("Spin",1)
TNT1 A 0 A_PlaySound("CHAINSTA")
MNGG AB 4
MNGG AB 2
MNGG AB 2
MNGG AB 2
MNGG AB 2
TNT1 A 0 A_PlaySound("CHAINSPI")
MNGG AB 2
MNGG AB 2
goto Ready2
StopAlt:
TNT1 A 0 A_TakeInventory ("Spin",1)
TNT1 A 0 A_PlaySound("CHAINSTO")
MNGG AB 2
MNGG AB 4
MNGG AB 6
MNGG A 4
TNT1 A 0 A_STOPSOUND (0)
Goto Ready
MINISTOPDESELECT:
TNT1 A 0 A_TakeInventory ("Spin",1)
TNT1 A 0 A_PlaySound("CHAINSTO")
MNGG AB 2
MNGG AB 4
MNGG AB 6
MNGG A 4
//I know that it's a very stupid way to fix stuff, but its very late and I'm sleepy. Send coffee. Plz
TNT1 A 0 A_STOPSOUND (0)
Goto DESELECT
NoAmmo:
MNGG A 10 A_PlaySound("weapons/empty")
TNT1 A 0 A_STOPSOUND (0)
goto Ready
Flash:
MNGF A 3 BRIGHT A_Light1
MNGF B 3 BRIGHT A_Light0
Stop
}
}