• 🏆 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!

[JASS] Detect that one unit gives an item to another explicitely

Status
Not open for further replies.
Level 26
Joined
Feb 2, 2006
Messages
1,690
Hi,
recently I've played around a bit with target orders and item events.

Currently I want to recognize when a hero gives an item to another hero.
What I could detect was when the hero drops an item and the other hero gets an item but these two events are seperate from each other.

No order event was triggered on giving the item from one hero to another.

How is this possible with JASS? I need this since I want to restrict some items ownership to the players and they should not be able to be picked up by an ally hero EXCEPT the hero gives the item to the allied hero explicitely.
 
Level 26
Joined
Feb 2, 2006
Messages
1,690
Hm I did a small test placing items and displaying the default item owner on picking them up. It seems that the default owner is neutral passive (prints player 16), so I will simply set the item's owner back to neutral passive when a hero drops it.

Is an item's owner used in any other way or is your concern simply about using a globally accessable property?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
You can use a 0-timer to explicitly know when an item is given to another unit. Even due to input delay it's simply impossible to drop an item AND pick it up with another unit at the same moment, so the only possibility is that it was given.
 
Status
Not open for further replies.
Top