1. When I'm completely out of ammo in both the clip and reserve the altfire still shoots and can shoot endlessly. The odd thing is, earlier today it was working without this issue, but all of a sudden without editing the code it's no longer working as intended and this issue showed up.
2. The altfire shoots 6 shots regardless oif how much ammo is left in the clip when I use the altfire.
Here's the code I have for the revolver (it's a bit long so bear with me):
Spoiler:Would anyone be so kind as to help me solve these issues?Code: Select all
ACTOR Revolver : ModWeapon replaces Pistol { Weapon.SelectionOrder 2000 Weapon.SlotNumber 2 Weapon.AmmoType "PistolMag" Weapon.AmmoUse 1 Weapon.AmmoGive 0 Weapon.AmmoType2 "clip" Weapon.AmmoGive2 6 Weapon.AmmoUse2 0 Inventory.PickupMessage "You got your Revolver back!" Inventory.PickupSound "weapons/pistol/slide" Weapon.UpSound "weapons/pistol/equip" Tag "Revolver" +WEAPON.NOALERT +WEAPON.AMMO_OPTIONAL //+WEAPON.NOAUTOFIRE States { Ready: TNT1 A 0 A_JumpIfInventory ("clip", 0, "ReadyFull") PPIS A 1 A_WeaponReady (WRF_ALLOWRELOAD) Loop Select: PPIS A 1 A_Raise TNT1 A 0 A_PlaySound("weapons/pistol/slide", CHAN_AUTO) PPIS A 1 Offset(-90,79) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-75,69) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-60,60) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-45,52) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-30,45) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-15,39) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-1,35) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) Goto Ready Deselect: TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("AnimToggle")==1, "DeadSelect") TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO) TNT1 A 0 A_PlaySound("weapons/pistol/holster", CHAN_AUTO) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(2, 34) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(7, 39) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(10, 47) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(22, 58) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(32, 69) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(54, 81) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(67, 100) PPIS A 1 A_Lower Wait Fire: TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_AlertMonsters TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 1 A_FireBullets(2, 2, -1, 30, "BulletPuff", 1) PPIS B 1 Bright A_SetPitch (pitch - (0.6)) PPIS B 1 Bright A_SetPitch (pitch - (0.06)) PPIS C 1 A_SetPitch (pitch - (0.02)) PPIS C 1 PPIS D 2 A_SetPitch (pitch + (0.02)) PPIS D 2 A_SetPitch (pitch + (0.09)) PPIS E 2 A_SetPitch (pitch + (0.15)) PPIS E 2 A_SetPitch (pitch + (0.30)) PPIS F 2 A_SetPitch (pitch + (0.09)) PPIS F 2 A_SetPitch (pitch + (0.03)) Goto Ready AltFire: TNT1 A 0 A_JumpIfNoAmmo ("dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_AlertMonsters TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) PPIS B 1 Bright A_SetPitch (pitch - (0.24)) PPIS C 1 A_SetPitch (pitch - (0.12)) PPIS D 1 A_SetPitch (pitch - (0.12)) PPIS E 1 A_SetPitch (pitch - (0.40)) PPIS F 1 A_SetPitch (pitch - (0.20)) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_AlertMonsters TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) PPIS B 1 Bright A_SetPitch (pitch - (0.24)) PPIS C 1 A_SetPitch (pitch - (0.12)) PPIS D 1 A_SetPitch (pitch - (0.12)) PPIS E 1 A_SetPitch (pitch - (0.40)) PPIS F 1 A_SetPitch (pitch - (0.20)) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_AlertMonsters TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) PPIS B 1 Bright A_SetPitch (pitch - (0.24)) PPIS C 1 A_SetPitch (pitch - (0.12)) PPIS D 1 A_SetPitch (pitch - (0.12)) PPIS E 1 A_SetPitch (pitch - (0.40)) PPIS F 1 A_SetPitch (pitch - (0.20)) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_AlertMonsters TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) PPIS B 1 Bright A_SetPitch (pitch - (0.24)) PPIS C 1 A_SetPitch (pitch - (0.12)) PPIS D 1 A_SetPitch (pitch - (0.12)) PPIS E 1 A_SetPitch (pitch - (0.40)) PPIS F 1 A_SetPitch (pitch - (0.20)) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_AlertMonsters TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) PPIS B 1 Bright A_SetPitch (pitch - (0.24)) PPIS C 1 A_SetPitch (pitch - (0.12)) PPIS D 1 A_SetPitch (pitch - (0.12)) PPIS E 1 A_SetPitch (pitch - (0.40)) PPIS F 1 A_SetPitch (pitch - (0.20)) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_AlertMonsters TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) PPIS B 1 Bright A_SetPitch (pitch - (0.24)) PPIS C 1 A_SetPitch (pitch - (0.12)) PPIS D 1 A_SetPitch (pitch - (0.12)) PPIS E 1 A_SetPitch (pitch - (0.40)) PPIS F 1 A_SetPitch (pitch - (0.20)) Goto dryfire NoReloadFire: TNT1 A 0 A_JumpIfInventory("clip", 1, 1) Goto Fire+1 TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_TakeInventory("clip", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_FireBullets(2, 2, -1, 30, "BulletPuff", 1) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS B 1 Offset(0, 33) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS B 1 Offset(0, 37) TNT1 A 0 A_SetPitch(pitch-0.4) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) TNT1 A 0 A_AlertMonsters TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS C 1 Offset(0, 40) TNT1 A 0 A_SetPitch(pitch+0.2) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner", 0, 0, 8, 0) TNT1 A 0 A_FireCustomMissile("9mmCasingSpawner", 0, 0, 8, 0) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS C 1 Offset(0, 41) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS D 1 Offset(0, 39) TNT1 A 0 A_SetPitch(pitch+0.2) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS E 1 Offset(0, 37) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS D 1 Offset(0, 35) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS B 1 Offset(0, 34) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) TNT1 A 0 A_ReFire TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(0, 33) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) Goto Ready Dryfire: TNT1 A 0 A_PlaySound("weapons/pistol/dryf", 6) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(0, 35) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 2 Offset(0, 34) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(0, 33) Reload: TNT1 A 0 A_JumpIfInventory("PistolMag", 6, 2) TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadWork") PPIS A 1 A_WeaponReady Goto Ready ReloadWork: TNT1 A 0 A_JumpIfInventory("PistolMag", 1, "ReloadWork2") TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS GHIJKLLL 1 TNT1 A 0 A_PlaySound("weapons/pistol/cout", 6) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS MMMNNN 1 TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) Goto ChamberCheck ReloadWork2: TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS GHIJKLLL 1 TNT1 A 0 A_PlaySound("weapons/pistol/cout", 6) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS MMMNNN 1 TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) Goto ChamberCheck ChamberCheck: TNT1 A 0 A_JumpIfInventory("PistolMag", 1, "ReloadLoop2") Goto ReloadLoop ReloadLoop: TNT1 A 0 A_TakeInventory("clip", 1) TNT1 A 0 A_GiveInventory("PistolMag", 1) TNT1 A 0 A_JumpIfInventory("PistolMag", 6, "ReloadFinish") TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadLoop") Goto ReloadFinish ReloadLoop2: TNT1 A 0 A_TakeInventory("clip", 1) TNT1 A 0 A_GiveInventory("PistolMag", 1) TNT1 A 0 A_JumpIfInventory("PistolMag", 6, "ReloadFinish2") TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadLoop2") Goto ReloadFinish2 ReloadFinish: TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS OOPPPQQQRRR 1 TNT1 A 0 A_PlaySound("weapons/pistol/cin", 6) PPIS SSSTTTTUUU 1 TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) Goto Ready ReloadFinish2: TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS OOPPPQQQRRR 1 TNT1 A 0 A_PlaySound("weapons/pistol/cin", 6) PPIS SSSTTTTUUU 1 TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) Goto Ready DoPunch: TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO) TNT1 A 0 A_TakeInventory("Punching",1) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-5,35) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-30,45) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-40,52) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-49,75) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-51,90) TNT1 A 1 TNT1 A 0 A_PlaySound("swing") ActualPunch: TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "BerserkPunch") PUN3 A 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PUN3 B 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) TNT1 A 0 A_SetPitch(+2 + pitch) PUN3 D 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) TNT1 A 0 A_FireCustomMissile("FistAttack",0,0,0,0) TNT1 A 0 A_SetPitch(+3 + pitch) PUN3 EGH 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PUN3 I 1 A_SetPitch(-2 + pitch) TNT1 A 0 A_SetPitch(-3 + pitch) PUN3 JKL 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) TNT1 A 3 Goto PunchDone BerserkPunch: TNT1 A 0 A_PlaySound("bsrkswing", CHAN_AUTO) PUN3 A 1 A_ZoomFactor(1.05) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PUN3 B 1 A_ZoomFactor(1.10) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) TNT1 A 0 A_SetPitch(+2 + pitch) PUN3 D 1 A_ZoomFactor(1.15) TNT1 A 0 A_FireCustomMissile("BerserkFistAttack",0,0,0,0) TNT1 A 0 A_SetPitch(+3 + pitch) PUN3 EGH 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PUN3 I 1 A_SetPitch(-2 + pitch) TNT1 A 0 A_SetPitch(-3 + pitch) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PUN3 J 1 A_ZoomFactor(1.10) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PUN3 K 1 A_ZoomFactor(1.05) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PUN3 L 1 A_ZoomFactor(1.00) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) TNT1 A 3 Goto PunchDone PunchDone: TNT1 A 1 Offset(-90,79) PPIS A 1 Offset(-90,79) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-75,69) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-60,60) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-45,52) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-30,45) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-15,39) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) PPIS A 1 Offset(-1,35) TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch) Goto Ready Flash: BRTF B 1 Bright A_Light2 BRTF A 1 Bright A_Light1 Goto LightDone Spawn: PIST A -1 Stop } } ACTOR PistolMag : Ammo { Inventory.PickupMessage "" Inventory.Amount 0 Inventory.MaxAmount 6 Ammo.BackpackAmount 0 Ammo.BackpackMaxAmount 6 Inventory.PickupSound "" }