Need help with my custom weapon

Discuss all aspects related to modding Zandronum here.
Post Reply
Mars873
New User
Posts: 11
Joined: Sun Mar 02, 2014 4:31 pm
Location: Hell

Need help with my custom weapon

#1

Post by Mars873 » Mon Apr 21, 2014 1:06 pm

I have a shotgun-like weapon, I wan't for i can break the reload state when I press fire, like in Brutal Doom. I mean for I can stop the reloading with fire button, because I should wait until each shell loads.

Here is the code:

[spoiler]
ACTOR Scattergun : Weapon
{
+Weapon.Ammo_Optional
Weapon.AmmoType1 "ScattergunLoaded"
Weapon.AmmoUse1 1
Weapon.AmmoType2 "TF2Shell"
Weapon.AmmoUse2 0
Weapon.AmmoGive2 12
Weapon.SlotNumber 3
Weapon.SelectionOrder 1300
Inventory.PickupMessage "You got Scout's Scattergun"
Obituary "%k killed %o with Scattergun"
States
{
Ready:
SCID A 0 A_JumpIfInventory("IsReloading", 1, "Reload")
SCID A 1 A_WeaponReady
Loop
Deselect:
SCID A 1 A_Lower
Loop
Select:
SCID A 1 A_Raise
Loop
Fire:
TNT1 A 0 A_JumpIfInventory("ScattergunLoaded",1,1)
Goto Reload
SCFR A 0 A_FireBullets (6, 6, 10, 5.25, BulletPuff)
SCFR A 0 A_PlaySound ("sscfire", CHAN_WEAPON)
SCFR ABCDEFG 3
Goto Ready
Spawn:
SHOT A -1
Stop
Reload:
SCID A 1 A_WeaponReady
SCID A 0 A_JumpIfInventory("ScattergunLoaded", 6, 2)
SCID A 0 A_JumpIfInventory("TF2Shell", 1, "ReloadStart")
SCID A 1
Goto Ready
ReloadStart:
SCRL AB 2
Goto ReloadLoop
ReloadLoop:
SCID A 0 A_PlayWeaponSound("sscrelo")
SCRL CDEFGHIJK 2
TNT1 A 0 A_TakeInventory("TF2Shell", 1)
TNT1 A 0 A_GiveInventory("ScattergunLoaded", 1)
TNT1 A 0 A_JumpIfInventory("ScattergunLoaded", 6, "ReloadFinish")
TNT1 A 0 A_JumpIfInventory("TF2Shell", 1, "ReloadLoop")
Goto ReloadFinish
ReloadFinish:
SCRL BA 2
Goto Ready
}
}
[/spoiler]
Last edited by Mars873 on Tue Apr 22, 2014 5:58 pm, edited 1 time in total.

User avatar
Spottswoode
Forum Regular
Posts: 245
Joined: Sat Jun 09, 2012 1:22 am
Location: That place over there.
Contact:

RE: Need help with my custom weapon

#2

Post by Spottswoode » Wed Apr 23, 2014 1:24 am

Just add A_WeaponReady to the reload animation frames. A_WeaponReady will fire the weapon whenever the fire button is pressed.
Dirge
(Killed, for now)
Image

The bird of Hermes is my name, eating my wings to make me tame.

Mars873
New User
Posts: 11
Joined: Sun Mar 02, 2014 4:31 pm
Location: Hell

RE: Need help with my custom weapon

#3

Post by Mars873 » Sun Jul 20, 2014 6:29 pm

Thank you very much :3

Post Reply