Spoiler:Code: Select all
Actor CovertPlayer: DoomPlayer { Player.StartItem "SilencedPistol" Player.StartItem "ClipAmmo",50 Player.StartItem "BulletClip",10 } actor SilencedPistol : Weapon replaces Pistol { Weapon.AmmoUse 1 Weapon.AmmoGive 20 Weapon.AmmoType "BulletClip" Weapon.AmmoType2 "ClipAmmo" Weapon.AmmoUse2 1 Weapon.SlotNumber 2 Obituary "%o couldn´t hear %k firing his handgun" +NOALERT +NOAUTOFIRE Decal BulletChip AttackSound "" Inventory.Pickupmessage "Picked up a Silenced Pistol." States { Ready: SPIL A 1 A_WeaponReady(WRF_ALLOWRELOAD) Loop Deselect: SPIL A 1 A_Lower Loop Select: SPIL A 1 A_Raise Loop Fire: TNT1 A 0 A_JumpIfInventory("BulletClip",1,1) Goto DryFire TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("Weapon/SPIFIR",CHAN_WEAPON) SPIL A 2 A_FireBullets(5.2,1,1,7.5) SPIL B 1 SPIL C 1 SPIL D 1 SPIL E 2 SPIL B 2 Goto Ready DryFire: SPIL A 1 OffSet(0,33) SPIL A 1 OffSet(0,37) SPIL A 1 A_PlaySound("Weapon/DryFire",5) SPIL A 1 OffSet(0,37) SPIL A 1 OffSet(0,33) Reload: TNT1 A 0 A_JumpIfInventory("BulletClip",0,"Ready") TNT1 A 0 A_JumpIfInventory("ClipAmmo",1,1) Goto Ready TNT1 A 0 A_PlaySound("Weapon/PistolReload",CHAN_WEAPON) SPIL A 1 OffSet(0,33) SPIL A 1 OffSet(0,37) SPIL A 1 OffSet(0,41) SPIL A 1 OffSet(0,51) SPIL A 1 OffSet(0,61) SPIL A 1 OffSet(0,71) SPIL A 1 OffSet(0,81) SPIL A 1 OffSet(0,71) SPIL A 1 OffSet(0,61) SPIL A 1 OffSet(0,51) SPIL A 1 OffSet(0,41) SPIL A 1 OffSet(0,37) SPIL A 1 OffSet(0,33) LoadBullets: TNT1 A 0 A_GiveInventory("BulletClip") TNT1 A 0 A_TakeInventory("ClipAmmo",1,TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("BulletClip",0,"Ready") TNT1 A 0 A_JumpIfInventory("ClipAmmo",1,"LoadBullets") Goto Ready Flash: SPIL A 3 Bright A_Light1 Goto LightDone Spawn: SPIP A -1 Stop } } ACTOR BulletClip : Ammo { Inventory.MaxAmount 10 Inventory.Icon "CLIPA0" } ACTOR ClipAmmo : Ammo replaces Clip { Tag "Pistol bullets" Inventory.MaxAmount 200 Inventory.Amount 10 Inventory.Icon "CLIPA0" ammo.backpackamount 50 ammo.backpackmaxamount 400 Inventory.PickupMessage "Picked up some bullets" States { Spawn: CLIP A -1 Stop } }
[SOLVED] DryFire state not working
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.
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.
[SOLVED] DryFire state not working
I´ve finally decided to go a little bit deeper in my knowledge of decorate creating reloadable weapons like a silenced pistol. Everything goes fine except when I´m out of ammo it´s supposed to go to the DryFire state for the typical click noise but the weapon does nothing, not even the offset effects. Any help?
Spoiler:
Last edited by Guardsoul on Thu Sep 08, 2016 3:02 am, edited 1 time in total.
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: DryFire state not working
You'll need to add the Ammo_Optional flag, otherwise regular Doom ammo logic applies and the Fire state is never entered. If you had any other weapons in your inventory, the weapon would auto switch away instead of doing nothing as it currently does.
Re: DryFire state not working
Thanks for the info. Now it works properly!