• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[General] How to prevent item sharing?

Status
Not open for further replies.
Level 23
Joined
Apr 16, 2012
Messages
4,041
whats the point, when I can just drop the item on the ground and he can pick it up anyways. I think this needs to be triggered, when you give items it either fires one of the item events, or a order event, you can just order the unit to stop probably(or return the item if it is item event)
 
Level 12
Joined
May 22, 2015
Messages
1,051
You could store the "owner" of each item (the player who buys it) in a hashtable. When a unit acquires an item, if they are not owned by the same player as the owner of the item, it drops automatically.

It might also be easier depending on how this is set up. You could make a trigger that drops any item they get immediately. When you have the hero buy items, assuming it is triggered AI, you can turn off the trigger while they do their item purchases and turn it back on right after (I mean within the same function call). That way, only the items they buy will make it through the auto-drop trigger.
 
Status
Not open for further replies.
Top