Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Neon

Weapon: Problem when out of altfire ammo

Recommended Posts

To build my wad I am using Doombuilder, Zdoom(Doom in hexen format).
Using XWE and DECORATE to make my weapons.

My weapon's altfire takes 100 rockets to fire so after firing there's always 0 altfire ammo left. Problem is: after altfiring the weapon, it lowers and raises (like it's going to switch to a different weapon, but it doesn't actually switch weapons) even if it still has enough primary ammo for primary fire.

Is it possible to make the weapon not lower and raise when it runs out of altfire ammo? If that's not possible, I would be happy if I could get the weapon to never switch, regardless of whether there is any primary or altfire ammo left.

Any help would be appreciated, this problem is quite annoying!

Share this post


Link to post

ACTOR HeavyRifle : Weapon 25035
{
Inventory.PickupMessage "You got the Heavy Rifle!"
Inventory.PickupSound "misc/w_pkup"
Weapon.AmmoType1 "Shell"
Weapon.AmmoGive1 16
Weapon.AmmoUse1 2
Weapon.AmmoType2 "RocketAmmo"
Weapon.AmmoGive2 100
Weapon.AmmoUse2 100
Weapon.kickback 400
+BLOODSPLATTER
States
{
Spawn:
HVYR A -1
Loop
Ready:
HVRG A 1 A_WeaponReady
Loop
Deselect:
HVRG A 1 A_Lower
Loop
Select:
HVRG A 0 A_PlaySound("weapons/rifleup")
HVRG A 1 A_Raise
Goto Select+1
Fire:
HVRG A 0 A_PlaySound("weapons/riflefre")
HVRF A 5 Bright A_FireBullets (0, 0, 3, 11, "bulletpuff", 1, 10000)
HVRG A 10
HVRG A 0 A_Refire
Goto Ready
AltFire:
HVRG A 0 A_PlaySound("weapons/monspwnf")
HVRF A 2 Bright A_FireBullets(18,7,60,4, "bulletpuff", 1, 10000)
HVRG A 0 A_Refire
Goto Ready
}
}

ACTOR HeavyBullet
{
Speed 200
Damage 0
Radius 6
Height 8
PROJECTILE
SeeSound "weapons/riflefre"
RENDERSTYLE ADD
ALPHA 1.0
States
{
Spawn:
BULL A 1 Bright
Loop
Death:
GRNE BCDEFGHIJKLMN 2 Bright A_Explode (175, 175)
NULL A 0 A_PlaySound ("weapons/grenexpl")
stop
}
}

Share this post


Link to post

What's happening here is that the weapon is out of ammo for the altfire, so it switches away to the next weapon that has enough primary ammo, which in this case would be the same weapon it just switched away from. I don't recall off-hand what my solution was for this (if I ever came up with one) but I would do a little experimentation with the Weapon.SelectionOrder.

Share this post


Link to post

You could try the +AMMO_OPTIONAL flag, however, it won't switch to another weapon if you really run out of ammo you will have to manually switch.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×