Page 1 of 1

Editing a weapon

Posted: Mon May 26, 2014 5:02 pm
by Powerman
So I downloaded a weapon (the Spas12 from realm 667) and It's alt fire fires really fast but doesn't take away ammo. could someone help me with this small problem? [spoiler]actor SPAS-12 : Weapon
{
Weapon.SelectionOrder 1250
Weapon.AmmoUse 1
Weapon.AmmoGive 8
Weapon.AmmoType "Shell"
Inventory.PickupMessage "You got the Franchi SPAS-12!"
Obituary "%o got shelled by %k's SPAS."
attacksound "weapons/spasshot"
scale 0.5
decal "bulletchip"
States
{
Ready:
SPAG A 1 A_WeaponReady
Loop
Deselect:
SPAG A 1 A_Lower
Loop
Select:
SPAG A 1 A_Raise
Loop
Fire:
SPAG A 0 A_GunFlash
SPAG A 4 A_FireBullets (4.6, 4.6, 12, 6, "BulletPuff")
SPAG BCDCB 2
SPAG D 3
SPAG E 3
SPAG FGF 5 A_PlaySound("weapons/spascock")
SPAG E 3 A_TakeInventory("ShotAmmount",999)
SPAG A 4 A_ReFire
Goto Ready
AltFire:
SPAG A 0 A_JumpIfInventory("ShotAmmount",7,"Fire")
SPAG A 0 A_GunFlash
SPAG A 4 A_FireBullets (5.6, 5.6, 10, 6, "BulletPuff")
SPAG BCDCB 2
SPAG A 0 A_GiveInventory("ShotAmmount",1)
SPAG A 1 A_ReFire
Goto Ready
Flash:
SPAF A 4 Bright A_Light2
Goto LightDone
Spawn:
SPAS A -1
Stop
}
}

ACTOR ShotAmmount : Ammo
{
Inventory.MaxAmount 8
Ammo.BackpackAmount 0
Ammo.BackpackMaxAmount 8
}[/spoiler]

RE: Editing a weapon

Posted: Mon May 26, 2014 5:07 pm
by AkumaKing

Code: Select all

AltFire:
SPAG A 0 A_JumpIfInventory("ShotAmmount",7,"Fire")
SPAG A 0 A_GunFlash
SPAG A 4 A_FireBullets (5.6, 5.6, 10, 6, "BulletPuff")
SPAG BCDCB 2 
SPAG A 0 A_GiveInventory("ShotAmmount",1)
SPAG A 1 A_ReFire
Goto Ready 
This seems to not take away any ammo with A_TakeInventory. You could also use weapon.ammouse2 to set the altfire ammo.

BTW

Code: Select all

 SPAG A 0 A_JumpIfInventory("ShotAmmount",7,"Fire") 
Why does it take you back to the standard fire?

RE: Editing a weapon

Posted: Mon May 26, 2014 5:24 pm
by Powerman
Honestly I don't know I realized it once I was working on a map, and wanted to use it, but when I was using it, I wasn't loosing ammo. So you're telling me to use weapon.ammouse2 to deplete the same ammo?

RE: Editing a weapon

Posted: Mon May 26, 2014 6:25 pm
by AkumaKing
Yes. Of course, though, you'll have to define the ammo it takes using weapon.ammotype2.

Basically, the alt requires its own set of ammo settings like the main fire does. This should work. If not, you could always manually make it take animal by using A_TakeInventory.

Basically, do this.

Code: Select all

Weapon.AmmoUse 1
Weapon.AmmoUse2 1
Weapon.AmmoGive 8
Weapon.AmmoType "Shell"
Weapon.AmmoType2 "Shell"

RE: Editing a weapon

Posted: Mon May 26, 2014 6:53 pm
by Powerman
Thank you! you're amazing!