header general

[SUBMISSION] UAC PIstol

  • Gothic
  • Gothic's Avatar
  • Moderator
  • Moderator
More
1 year 1 month ago #11 by Gothic
Replied by Gothic on topic [SUBMISSION] UAC PIstol
The altfire doesn't use any ammo, you need to give it the +WEAPON.ALT_USES_BOTH flag.
And since the firing is a little more complicated, you're gonna need to drop the checkforreload system, and start using an inventory item to keep count of your shots, like this:

Spawn:
DEPI A -1
Stop
Ready:
TNT1 A 0 A_JumpIf(CountInv("ShotCounter")<1,"ReadyNoReload")
DPIG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
Loop
ReadyNoReload:
DPIG A 1 A_WeaponReady
Goto Ready
Deselect:
DPIG A 1 A_Lower(17)
Loop
Select:
DPIG A 1 A_Raise(17)
Loop
Fire:
TNT1 A 0 A_GunFlash
DPIF A 2 Bright A_FireBullets(2,2,-1,6,"BulletPuff",1)
DPIG B 1 A_GiveInventory("ShotCounter",1)
DPIG C 3
DPIG A 3 A_JumpIfInventory("ShotCounter",18,"DryFire")
Goto Ready
AltFire:
TNT1 A 0 A_GunFlash
DPIF A 2 Bright A_FireBullets(2,2,-1,6,"BulletPuff",1)
DPIG B 1 A_GiveInventory("ShotCounter",1)
DPIG C 3
TNT1 A 0 A_JumpIfInventory("ShotCounter",18,"DryFire")
DPIF A 2 Bright A_FireBullets(2,2,-1,6,"BulletPuff",1)
DPIG B 1 A_GiveInventory("ShotCounter",1)
DPIG C 3
TNT1 A 0 A_JumpIfInventory("ShotCounter",18,"DryFire")
DPIF A 2 Bright A_FireBullets(2,2,-1,6,"BulletPuff",1)
DPIG B 1 A_GiveInventory("ShotCounter",1)
DPIG C 3
DPIG A 3 A_JumpIfInventory("ShotCounter",18,"DryFire")
Goto Ready
DryFire:
DPIG A 6
DPIG A 6 A_PlaySound("weapons/glockdry")
Goto Reload
Reload:
DPIR A 3 A_TakeInventory("ShotCounter",18)
DPIR B 3 A_Playsound ("CLIPOUT")
DPIR C 3
DPIR D 3
DPIR E 3
DPIR F 3 A_Playsound ("CLIPIN")
DPIR G 3
DPIR H 3
DPIR I 3
DPIR J 3
DPIG A 3
Goto Ready
Flash:
TNT1 A 2 A_Light2
TNT1 A 2 A_Light1
Goto LightDone

(I changed the amount of shots to 18, so it's a number divisible by 3)
And then use an inventory item like this:

Actor ShotCounter : Inventory
{
-INVENTORY.INVBAR
Inventory.MaxAmount 18
}

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

  • TyrannotitanFan
  • TyrannotitanFan's Avatar Topic Author
  • Lost Soul
  • Lost Soul
More
1 year 1 month ago #12 by TyrannotitanFan
Replied by TyrannotitanFan on topic [SUBMISSION] UAC PIstol
Got it
https://www.dropbox.com/s/6gkq19xonko8a4w/UAC_Pistol.pk3?dl=0

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

  • Gothic
  • Gothic's Avatar
  • Moderator
  • Moderator
More
1 year 1 month ago #13 by Gothic
Replied by Gothic on topic [SUBMISSION] UAC PIstol
Added
I had to make some minor fixes I forgot to report, I converted the sounds to ogg, as one of them didn't play properly, and added a Weapon.AmmoGive amount, because I couldn't pick it up.

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