Spicy Cacodemon Posted February 6, 2016 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. 0 Share this post Link to post
scifista42 Posted February 6, 2016 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. 0 Share this post Link to post
Spicy Cacodemon Posted February 6, 2016 Thanks. I've messed around with Doom Builder 2 but I've never made a complete map before. I might upload it here when it's finished. 0 Share this post Link to post
VGA Posted February 7, 2016 But if you shoot a monster in the other side of the room, why would a pistol materialize in your hands? 0 Share this post Link to post
scifista42 Posted February 7, 2016 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. 0 Share this post Link to post
Spicy Cacodemon Posted February 7, 2016 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. 0 Share this post Link to post
scifista42 Posted February 7, 2016 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. 0 Share this post Link to post