Inventory pickup function(s) questions.

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
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Inventory pickup function(s) questions.

Post by Major Cooke »

Some people might be familiar with AEons of Death's weapon slot limit system. Each weapon has an "item" CustomInventory actor that is dropped specifically by monsters and is served to act as a toggleable limit system for those who want to be selective about which weapons they carry, using a means of ACS functions. If the weapon limit is not exceeded, the custominventory succeeds and picks up.

This was naturally developed well before ZScript was even a concept. Today I discovered there are a few bugs with it. I've decided it's finally time to get rid of all those systems and simply ZScript because it will radically simplify this system.

What I need to know is which functions to override specifically. I've had very mixed results between TryPickup and HandlePickup, so my intention is just to use Touch() instead. Is there any advantage to using TryPickup or HandlePickup over touch, aside from the fact they cover direct giving over just physical touching?

Also, if a weapon has an amount > 1, does the Drop Weapon command just drop one of the item? I ask because AEoD's system allows you to drop just one.

I just wanted to double check for my sanity. Touch() seems to be the safer method since I only really care about direct giving (console or A_GiveInventory). Most of it's already set up and ready to go.
Post Reply

Return to “Scripting”