How to make player drop item on death?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
pc98reimu
Posts: 2
Joined: Wed Sep 05, 2018 5:15 pm

How to make player drop item on death?

Post by pc98reimu »

First thing i wanna say is that i'm new to the site so i apologize if this thread doesn't belong here. :oops:
I'm making a multiplayer mod in which the player has to drop two items when he gets killed, those are called "FauxPower" and "Point" in DECORATE.
However DropItem and Player.DropItem don't seem to work. Help me.
User avatar
Apeirogon
Posts: 1606
Joined: Mon Jun 12, 2017 12:57 am

Re: How to make player drop item on death?

Post by Apeirogon »

Try to use a_spawnitemex("FauxPower/Point") in player death sequence.
User avatar
pc98reimu
Posts: 2
Joined: Wed Sep 05, 2018 5:15 pm

Re: How to make player drop item on death?

Post by pc98reimu »

Apeirogon wrote:Try to use a_spawnitemex("FauxPower/Point") in player death sequence.
Would i have to add States for that? Because it seems to crash whenever i do that.
Here's my DECORATE file without States

Code: Select all

 
ACTOR DMTestPlayer : DoomPlayer
{
  +NOSKIN
  Health 100
  Speed 1
  Player.DisplayName "Test"
  Player.CrouchSprite "PLYC"
  Player.StartItem "TestWPN"
  Player.StartItem "TestWPN2"
  Player.StartItem "Clip", 50
  Player.WeaponSlot 1, TestWPN
  Player.WeaponSlot 2, TestWPN2
}
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: How to make player drop item on death?

Post by ramon.dexter »

Dont add states. Copy thw whole.definition from doomplayer, and add it into the whole definition.
Post Reply

Return to “Scripting”