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

Autowield upon weapon pickup?

Recommended Posts

Hi!

Is there a flag or script you can set on a weapon that upon picking up automatically forces the player to wield the weapon?

I'm trying to make a wad with "powerup weapons", as I call them. Upon picking up the weapon, the player gets the desired amount of SpecialweaponAmmo, and upon deselecting the weapon, the player loses 99999 of Specialweaponammo and without a keyboard slot for the temporary weapon, when the weapon is lowered, it is not coming back.

The point is to make weapons that are too heavy to carry around so can only be used temporarily. I've managed to get this to work so far but I have a problem: the same weapon can't be used twice, because the weapon isn't automatically selected every time it is picked up.

Ideas how to fix this?

Share this post


Link to post

Since IIRC you use ZDoom, look at the code for the berserk item and copy its method of autoselecting the fist.

Share this post


Link to post

The a_setweapon command used in the berserk powerup didn't help, but I came up with a solution. Removing the weapon from the player's inventory enables multiple pickups of the temporary weapon, whereas the setweapon command only works with the first time picking the weapon up.

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
×