Editing a weapon

Discuss all aspects related to modding Zandronum here.
Post Reply
Powerman
Forum Regular
Posts: 106
Joined: Mon Jul 02, 2012 2:45 am
Location: Places

Editing a weapon

#1

Post by Powerman » Mon May 26, 2014 5:02 pm

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]
Last edited by Powerman on Mon May 26, 2014 5:02 pm, edited 1 time in total.
http://brutaldoomwads.weebly.com/
Also Now Every Wednesday is Brutal doom Co-op! Just Look For powerman in the name!

AkumaKing
Forum Regular
Posts: 128
Joined: Tue Dec 03, 2013 9:14 pm
Location: Over 2000 lines of Decorate
Contact:

RE: Editing a weapon

#2

Post by AkumaKing » Mon May 26, 2014 5:07 pm

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?
Projects: Unbound, Zelda DXA
Image

Powerman
Forum Regular
Posts: 106
Joined: Mon Jul 02, 2012 2:45 am
Location: Places

RE: Editing a weapon

#3

Post by Powerman » Mon May 26, 2014 5:24 pm

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?
http://brutaldoomwads.weebly.com/
Also Now Every Wednesday is Brutal doom Co-op! Just Look For powerman in the name!

AkumaKing
Forum Regular
Posts: 128
Joined: Tue Dec 03, 2013 9:14 pm
Location: Over 2000 lines of Decorate
Contact:

RE: Editing a weapon

#4

Post by AkumaKing » Mon May 26, 2014 6:25 pm

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"
Projects: Unbound, Zelda DXA
Image

Powerman
Forum Regular
Posts: 106
Joined: Mon Jul 02, 2012 2:45 am
Location: Places

RE: Editing a weapon

#5

Post by Powerman » Mon May 26, 2014 6:53 pm

Thank you! you're amazing!
http://brutaldoomwads.weebly.com/
Also Now Every Wednesday is Brutal doom Co-op! Just Look For powerman in the name!

Post Reply