header general

3 round bursts for handgun?

  • NourPrince
  • NourPrince's Avatar Topic Author
  • Chaingunner
  • Chaingunner
More
8 years 9 months ago - 8 years 6 months ago #1 by NourPrince
3 round bursts for handgun? was created by NourPrince
I have recently made a handgun that is semi-auto and has 3 round burst when you press altfire.

Heres the decorate:
Code:
Actor .50Handgun : Weapon { Weapon.SlotNumber 2 Weapon.AmmoType "Clip" Weapon.AmmoUse 1 Weapon.AmmoGive 20 Tag "Bluetail .50 Caliber Handgun" Inventory.Pickupmessage "You've got Bluetail Handgun!" +WEAPON.NOAUTOFIRE +AMMO_OPTIONAL States { Spawn: 2XKP A -1 Stop Select: 2XKG C 1 A_Raise Loop Deselect: 2XKG AB 1 2XKG C 1 A_lower Goto Deselect+2 Ready: 2XKG BA 3 2XKG A 1 A_WeaponReady Goto Ready+2 Fire: 2XKF A 0 A_JumpIfInventory("Clip",1,2) 2XKG A 1 Goto Ready+2 2XKF A 0 A_TakeInventory("Clip",1) 2XKF A 0 A_Playweaponsound("Bluetail/Fire") 2XKF A 0 A_FireBullets (11.2, 0, 1, 5, "BulletPuff") 2XKF BC 1 Bright 2XKG BCBA 2 Goto Ready+2 AltFire: 2XKF A 0 A_JumpIfInventory("Clip",1,2) 2XKG A 1 Goto Ready+2 2XKF A 0 A_JumpIfInventory("Clip",0,15) 2XKF A 0 A_TakeInventory("Clip",1) 2XKF A 0 A_Playweaponsound("Bluetail/Fire") 2XKF A 0 A_FireBullets (11.2, 0, 1, 5, "BulletPuff") 2XKF BC 1 Bright 2XKF A 0 A_JumpIfInventory("Clip",0,10) 2XKF A 0 A_TakeInventory("Clip",1) 2XKF A 0 A_Playweaponsound("Bluetail/Fire") 2XKF A 0 A_FireBullets (11.2, 0, 1, 5, "BulletPuff") 2XKF BC 1 Bright 2XKF A 0 A_JumpIfInventory("Clip",0,5) 2XKF A 0 A_TakeInventory("Clip",1) 2XKF A 0 A_Playweaponsound("Bluetail/Fire") 2XKF A 0 A_FireBullets (11.2, 0, 1, 5, "BulletPuff") 2XKF BC 1 Bright 2XKG BCBA 2 Goto Ready+2 } }

I have a problem at the alt-fire, if i have limited ammo and the clip almost ran out (the amount of clip is 2 for example) i would make the gun burst 2 rounds instead of 3. so any decorate coding help here? Thanks
Last edit: 8 years 6 months ago by NeuralStunner. Reason: Code tags? Code tags!

Please Log in or Create an account to join the conversation.

  • Blue Shadow
  • Blue Shadow's Avatar
  • Administrator
  • Administrator
More
8 years 9 months ago #2 by Blue Shadow
Replied by Blue Shadow on topic 3 round bursts for handgun?
You need some form of ammo check after each bullet fired. Try this:
Code:
AltFire: 2XKF A 0 A_JumpIfInventory("Clip", 1, 2) 2XKG A 1 Goto Ready+2 2XKF A 0 A_Playweaponsound("Bluetail/Fire") 2XKF A 0 A_FireBullets(11.2, 0, 1, 5, "BulletPuff") 2XKF BC 1 Bright 2XKF A 0 A_JumpIfInventory("Clip", 1, 1) Goto AltFireEnd 2XKF A 0 A_Playweaponsound("Bluetail/Fire") 2XKF A 0 A_FireBullets (11.2, 0, 1, 5, "BulletPuff") 2XKF BC 1 Bright 2XKF A 0 A_JumpIfInventory("Clip", 1, 1) Goto AltFireEnd 2XKF A 0 A_Playweaponsound("Bluetail/Fire") 2XKF A 0 A_FireBullets (11.2, 0, 1, 5, "BulletPuff") 2XKF BC 1 Bright AltFireEnd: 2XKG BCBA 2 Goto Ready+2

Please Log in or Create an account to join the conversation.

  • NourPrince
  • NourPrince's Avatar Topic Author
  • Chaingunner
  • Chaingunner
More
8 years 9 months ago #3 by NourPrince
Replied by NourPrince on topic 3 round bursts for handgun?
Thank you so much!

Please Log in or Create an account to join the conversation.