how to make a health pickup leave behind trash.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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!)
Connorpo1221
Posts: 9
Joined: Mon Jul 25, 2022 12:27 pm

how to make a health pickup leave behind trash.

Post by Connorpo1221 »

I want it so when they walk over it and use say a health item, it then spawns in an item that's just an empty version of it. I use decorate and have tried but can't seem to get it to work I've tried the pickup ,drop, and use states but neither worked
MosheTreutel
Posts: 1
Joined: Tue Jul 29, 2025 10:39 pm
Operating System Version (Optional): Windows 11
Graphics Processor: Intel with Vulkan/Metal Support

Re: how to make a health pickup leave behind trash.

Post by MosheTreutel »

Define the trash item (the "empty" version):

Code: Select all

actor HealthTrash : Decoration
{
    +NOBLOCKMAP
    +NOGRAVITY
    Radius 16
    Height 16
    States
    {
    Spawn:
        TRSH A -1
        Stop
    }
}
Spam link removed
Last edited by Caligari87 on Wed Jul 30, 2025 9:15 pm, edited 2 times in total.
Reason: Spambot. User was banned.
User avatar
Enjay
 
 
Posts: 27321
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: how to make a health pickup leave behind trash.

Post by Enjay »

The above is a very generic post that does not really address the question - possibly a bot.

@Connorpo1221 please post your code. It's almost impossible to figure out what's wrong from "can't seem to get it to work".
User avatar
SanyaWaffles
Posts: 888
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields

Re: how to make a health pickup leave behind trash.

Post by SanyaWaffles »

I'd just make a CustomInventory that gives you some health and then spawns a trash object when picked up.
User avatar
MartinHowe
Posts: 2096
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: how to make a health pickup leave behind trash.

Post by MartinHowe »

SanyaWaffles wrote: Thu Jul 31, 2025 12:20 pm I'd just make a CustomInventory that gives you some health and then spawns a trash object when picked up.
This. If you're limiting to DECORATE, this is really the only way to do it.

In ZScript it's much easier; override https://zdoom.org/wiki/CollidedWith of the pickup, if it's a player then give them some health and set the state to the death state, which can have an "empty bottle" (or whatever) sprite. Otherwise, ignore the collision and do nothing.

Return to “Scripting”