Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Spicy Cacodemon

Kill monster get pistol (solved)

Recommended Posts

So I'm making a map in Doom Builder 2 with ZDOOM. In the map thanks to a simple bit of scripting the player starts off with only his fists. I copied the script from someone else as I don't yet know anything about scripting in Doom. What I'd like some help with is a monster adding the pistol to the player's inventory upon death. Can anybody help me with this.

Share this post


Link to post

Make a script containing this line:

GiveInventory("Pistol",1);

Then set the monster's Action to "Script Execute" and the respective script number as a parameter. Whoever/whatever will directly cause the monster's death, "Pistol" will be added to his/its inventory.

Share this post


Link to post

But if you shoot a monster in the other side of the room, why would a pistol materialize in your hands?

Share this post


Link to post

I assume it's because the player can only kill him at short range, since (unless he cheated) the player has only his fists at that point in the game, as the OP stated.

Sure, I'd personally prefer to make it a dropped item off the monster's body instead, but I answered to the OP's question as it stood, since he might have his reasons why not to do it that way.

Share this post


Link to post

At the start of the map I've stripped the player of all weapons as if they have been seized and disposed of. The players hands aren't bound and haven't been cut off so he can still use his fists.

The player kills the first soldier up close and personal with his fists so I don't see anything wrong with just adding the pistol to the player's inventory once the soldier is dead.

You could say I'm a Doom editing noob so I'm just starting to add bits of code into my creations.

Share this post


Link to post

If you want to ensure that the player will change his currently carried weapon from Fist to Pistol immediately after he is given the Pistol, regardless on particular user's (=the person playing your wad) weapon priority settings (in the source port's options), use SetWeapon right after the GiveInventory line in the script.

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
Sign in to follow this  
×