There is also the issue of whenever zooming in, it resets the weapons ammo count to maximum capacity due to the reloading stage. (I want to personally thank wildweasel for the straight forward tutorial he provided for weapon reloading.)
I still consider myself an amateur coder for these types a things. As I tried to do all this myself, but am completely stumped.
Anyways I provided the weapon code I am currently working with. It is down below.
Spoiler:Code: Select all
actor SIG553 : Weapon replaces SuperShotgun 553 { //$Category Weapons Tag "SIG 553" Obituary "%o was eliminated by %k's SIG 553." Scale 0.4 Attacksound "553FIRE" Inventory.PickupSound "553PU" Inventory.Pickupmessage "SIG 553" Weapon.Selectionorder 2 Weapon.Slotnumber 4 Decal "BulletChip" Weapon.BobStyle Smooth Weapon.BobSpeed 2 Weapon.BobRangeX 0.5 Weapon.BobRangeY 0.7 Weapon.Kickback 75 Weapon.Kickback 60 Weapon.Ammotype1 "SIG553Loaded" Weapon.Ammotype2 "556Magazine" Weapon.Ammouse 1 Weapon.Ammouse2 0 Weapon.Ammogive1 0 Weapon.Ammogive2 20 +Weapon.Ammo_Optional +NOALERT +NOEXTREMEDEATH +COUNTITEM states { Spawn: SG53 A -1 Stop Ready: SG53 B 0 A_TakeInventory("SIGToken1",1) SG53 B 2 A_WeaponReady(WRF_ALLOWRELOAD) SG53 B 0 A_TakeInventory("SIGToken2",1) Loop Deselect: SG53 B 1 Offset (-1,35) SG53 B 1 Offset (-15,39) SG53 B 1 Offset (-35,45) SG53 B 1 Offset (-55,52) SG53 B 1 Offset (-70,60) SG53 B 1 Offset (-90,69) SG53 B 1 Offset (-105,89) SG53 B 1 Offset (-125,102) SG53 B 1 Offset (-155,108) SG53 B 1 Offset (-155,150) DeselectRaise: SG53 B 0 Offset (-1,0) SG53 B 1 A_Lower Loop Select: SG53 B 0 A_JumpIfInventory("SIGToken1",1,"Ready") SG53 B 1 A_Raise SG53 B 1 Offset (-90,69) SG53 B 1 Offset (-70,60) SG53 B 1 Offset (-55,52) SG53 B 1 Offset (-35,45) SG53 B 1 Offset (-15,39) SG53 B 1 Offset (-1,35) SelectRaise: SG53 B 1 A_Raise Loop Fire: SG53 B 0 A_JumpIfNoAmmo("Reload") SG53 B 0 A_Quake(1.5, 1.5, 0, 1) SG53 B 0 A_AlertMonsters SG53 B 0 A_FireBullets (1.1,1.1,-1,12, "CWPuff", FBF_USEAMMO|FBF_NORANDOM) SG53 B 0 A_PlayWeaponSound("553FIRE") SG53 B 0 A_Quake (1, 1, 0, .05) SG53 B 0 A_SetPitch (pitch-0.5) SG53 C 0 A_FireCustomMissile("308Casing",5,0,15,-9) SG53 C 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,5) SG53 C 1 Bright A_SetPitch(pitch-0.5) SG53 C 0 A_SetPitch(pitch-0.15) SG53 C 0 A_SetPitch(pitch+0.15) SG53 C 0 A_SetPitch(pitch+0.5) SG53 D 2 Bright SG53 E 2 A_ReFire Goto Ready AltFire: SG53 B 0 A_JumpIfInventory("SIGToken2",1,"Ready") SG53 B 0 A_GiveInventory("SIGToken2") SG53 B 0 SG53 B 0 A_GiveInventory("SIGScope") SG53 B 0 A_SelectWeapon("SIGScope") SG53 B 0 A_Lower SG53 B 0 A_Lower SG53 B 0 A_Lower SG53 B 0 A_Lower SG53 B 0 A_Lower Goto AltFire+3 Reload: SG53 B 0 A_JumpIfInventory("SIG553Loaded", 30, 2) // If the gun's full, jump 2 states. SG53 B 0 A_JumpIfInventory("556Magazine", 1, "ReloadWork") // If there's extra ammo, reload. SG53 B 1 // Here's where that first line ends up - the gun does nothing and returns to Ready. Goto Ready ReloadWork: SG53 B 1 Offset(0,35) A_PlaySound("SGRELOAD", CHAN_5) SG53 B 1 Offset(-2,38) SG53 B 1 Offset(-4,44) SG53 B 1 Offset(-6,52) SG53 B 1 Offset(-1,54) SG53 B 1 Offset(-2,56) SG53 B 1 Offset(-3,58) SG53 B 1 Offset(-4,58) SG53 B 1 Offset(-4,57) SG53 B 1 Offset(-3,54) SG53 B 1 Offset(-3,51) SG53 B 1 Offset(-3,53) SG53 B 1 Offset(-3,55) SG53 B 15 Offset(-3,56) ReloadLoop: TNT1 A 0 A_TakeInventory("556Magazine", 1) TNT1 A 0 A_GiveInventory("SIG553Loaded", 1) TNT1 A 0 A_JumpIfInventory("SIG553Loaded", 30, "ReloadFinish") TNT1 A 0 A_JumpIfInventory("556Magazine", 1, "ReloadLoop") Goto ReloadFinish ReloadFinish: SG53 B 1 Offset(-3,57) SG53 B 1 Offset(-3,59) SG53 B 1 Offset(-3,63) SG53 B 1 Offset(-3,67) SG53 B 1 Offset(-3,65) SG53 B 1 Offset(-3,62) SG53 B 1 Offset(-3,58) SG53 B 1 Offset(-3,55) SG53 B 1 Offset(-2,53) SG53 B 1 Offset(-2,49) SG53 B 1 Offset(-2,46) SG53 B 1 Offset(-2,45) SG53 B 1 Offset(-1,44) SG53 B 1 Offset(-1,46) SG53 B 1 Offset(-1,47) SG53 B 1 Offset(0,49) A_WeaponReady(WRF_NOBOB) SG53 B 1 Offset(0,44) A_WeaponReady(WRF_NOBOB) SG53 B 1 Offset(0,38) A_WeaponReady(WRF_NOBOB) SG53 B 1 Offset(0,35) A_WeaponReady(WRF_NOBOB) SG53 B 1 Offset(0,32) A_WeaponReady(WRF_NOBOB) Goto Ready } } ACTOR SIG553Loaded : Ammo { Inventory.MaxAmount 30 +IGNORESKILL } Actor SIGScope: Weapon //NOT TO BE SPAWNED { Obituary "%o was Picked-Off By %k's SIG 553." Weapon.Kickback 125 Weapon.Ammotype1 "SIG553Loaded" Weapon.Ammotype2 "556Magazine" Weapon.Ammouse 1 Weapon.Ammouse2 0 Weapon.Ammogive1 0 Weapon.Ammogive2 20 Decal "BulletChip" +DONTBOB +NOALERT States { Spawn: XXXX X -1 Loop Ready: ASCO A 0 ASCO A 2 A_WeaponReady ASCO A 0 A_TakeInventory("SIGToken2",1) Loop Deselect: ASCO A 0 ASCO A 0 Goto AltFire+2 Select: ASCO A 0 A_PlaySound("SIGOPTIC", CHAN_5) ASCO A 0 A_ZoomFactor(4.0) ASCO A 0 ASCO A 0 A_Raise Loop Fire: ASCO B 0 A_JumpIfNoAmmo("Reload") ASCO A 0 A_AlertMonsters ASCO A 0 A_PlayWeaponSound("553FIRE") ASCO A 0 A_FireBullets (0.55,0.55,-1,15, "CWPuff", FBF_USEAMMO|FBF_NORANDOM) ASCO A 0 A_Quake (2, 2, 0, 1) ASCO A 0 A_SetPitch (pitch-0.5) ASCO B 1 ASCO A 2 ASCO A 0 A_Refire Goto Ready AltFire: ASCO A 0 A_JumpIfInventory("SIGToken2",1,"Ready") ASCO A 0 A_PlaySound("SIGOPTIC", CHAN_5) ASCO A 0 A_JumpIfInventory("SIGToken3",2,"AltFireDeselect") ASCO A 0 A_ZoomFactor(12.0) ASCO A 0 A_GiveInventory("SIGToken2") ASCO A 0 A_JumpIfInventory("SIGToken3",1,"AltFire2") ASCO A 0 A_GiveInventory("SIGToken3") Goto Ready AltFire2: ASCO A 0 A_ZoomFactor(24.0) ASCO A 0 A_GiveInventory("SIGToken3") Goto Ready AltFireDeselect: ASCO A 0 A_TakeInventory("SIGToken3") ASCO A 0 A_TakeInventory("SIGToken3") ASCO A 0 A_GiveInventory("SIGToken1") ASCO A 0 A_GiveInventory("SIGToken2") ASCO A 0 A_PlaySound("SIGOPTIC", CHAN_5) ASCO A 0 A_ZoomFactor(1.0) ASCO A 0 A_SelectWeapon("SIG553") ASCO A 0 A_Lower ASCO A 0 A_Lower ASCO A 0 A_Lower ASCO A 0 A_Lower ASCO A 0 A_Lower ASCO A 0 Goto AltfireDeselect+7 } } ACTOR SIGToken1 : Ammo { Inventory.MaxAmount 1 Ammo.BackpackAmount 0 Ammo.BackpackMaxAmount 1 } ACTOR SIGToken2 : Ammo { Inventory.MaxAmount 1 Ammo.BackpackAmount 0 Ammo.BackpackMaxAmount 1 } ACTOR SIGToken3 : Ammo { Inventory.MaxAmount 2 Ammo.BackpackAmount 0 Ammo.BackpackMaxAmount 2 }