• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to stop units with backpacks dropping items

Status
Not open for further replies.
Level 8
Joined
May 31, 2009
Messages
101
Hi guys.

In my map I've made dozens of 'flavour text' items that sit in unit's inventories. Now I've edited unit inventories "ability" so that 'Data Drop Items on Death' is false, however once the unit's bodies decay the item still appears on the ground. This is annoying as I end up with hundreds of dummy items littering the ground a few minutes after the units are dead.

Is there anyway to prevent this from happening? I don't understand the purpose of the Drop Items on Death field if it doesn't actually do anything.

If you can help that'd be a lifesaver as I've spent several days writing up paragraphs of lore for these items and I'd hate that to go to waste.
 
"Drop Items on Death" works as intended.

If you put it with true on heroes, the hero will drop items as it dies, and when it respawns it will have no items in the inventory.
If you put it with false on heroes, the heroes get to keep their items after respawning.

Units can't respawn after death (they can be RESURRECTED), and when they decay THEY ARE ACTUALLY REMOVED FROM THE GAME. Upon their removal, the items their inventory contains are released where they have decayed. They don't disappear with the unit. So what you need/want to do is, when an unit dies, pick all items from its inventory, and remove them. This way they won't appear after they decay.
 
Level 8
Joined
May 31, 2009
Messages
101
"Drop Items on Death" works as intended.

If you put it with true on heroes, the hero will drop items as it dies, and when it respawns it will have no items in the inventory.
If you put it with false on heroes, the heroes get to keep their items after respawning.

Units can't respawn, and when they decay THEY ARE ACTUALLY REMOVED FROM THE GAME. Upon their removal, the items their inventory contains are released where they have decayed. They don't disappear with the unit. So what you need/want to do is, when an unit dies, pick all items from its inventory, and remove them. This way they won't appear after they decay.

Thank you for the prompt reply! That's helpful to know, there's a ressurection spell the players get from the start pretty much but I don't suppose its a huge deal if the items aren't there when they ressurect since it's only flavour text. I'll have a poke around in the triggers to try and do what you say, hopefully its not too complicated.

I also considered just making the item's "invisible" somehow, but I think that might cause memory problems if there are hundreds of invisible items lying around.
 
Level 8
Joined
May 31, 2009
Messages
101
Do you think this would be sufficient? It's a shame the ressurection interaction will be a bit jarring but it's a basic spell that has a long cooldown and only ressurects 1-3 units dependent on level so it's not likely to be too noticable given the low-impact of the items involved.
upload_2018-1-17_17-58-11.png

I looked up unit indexing and it looks very complicated compared to my generally 'caveman smash' approach to triggers. Ideally I'll take a longer look at a later date but do you think the aforementioned trigger will do the job for now?
 
Actually, I just realized, but I think you can use "a unit decays" functionality as well. Not sure how it works with summoned units (or in general units that "can't raise; does not decay"), but those should not be carrying items anyways. So try the "A unit decays" event. This would make resurrected units retain their items, but once they decay, the items get removed too.
 
Level 8
Joined
May 31, 2009
Messages
101
Actually, I just realized, but I think you can use "a unit decays" functionality as well. Not sure how it works with summoned units (or in general units that "can't raise; does not decay"), but those should not be carrying items anyways. So try the "A unit decays" event. This would make resurrected units retain their items, but once they decay, the items get removed too.

Ah that's worked! Thank you so much for your help!
 
Status
Not open for further replies.
Top