Page 1 of 1

Need help with my custom weapon

Posted: Mon Apr 21, 2014 1:06 pm
by Mars873
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]

RE: Need help with my custom weapon

Posted: Wed Apr 23, 2014 1:24 am
by Spottswoode
Just add A_WeaponReady to the reload animation frames. A_WeaponReady will fire the weapon whenever the fire button is pressed.

RE: Need help with my custom weapon

Posted: Sun Jul 20, 2014 6:29 pm
by Mars873
Thank you very much :3