HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

The Event UNIT_DROP_ITEM

04-05-2009, 03:58 AM#1
wraithseeker
Collapse JASS:
  call TriggerRegisterAnyUnitEventBJ(Drop, EVENT_PLAYER_UNIT_DROP_ITEM)

How does the trigger detect the drop item other then manually dropping it via the hero. Doesn't RemoveItem count as Unit drop Item?

I went over to the GUI section and found that it was named, A unit Loses a Item so it should be able to detect RemoveItem but it didn't.

Anyone here has a clue on how to detect a RemoveItem?
04-05-2009, 04:28 AM#2
Fledermaus
Drop the item before you remove it?
04-05-2009, 04:44 AM#3
wraithseeker
I tried with UnitRemoveItem but it still doesn't detect it for me.
04-05-2009, 04:45 AM#4
Blackroot
Mm; remove item does just that; it removes it from the game. There are NO events associated with the removal of an instance.

You'll need to force-drop the item then remove it.Or you could circumvent the subroutine and directly call your event before/after the remove call. But no; RemoveItem does not count as 'a unit drops an item'.

-> You could also check which slots hold items periodically.
04-05-2009, 05:16 AM#5
wraithseeker
You'll need to force-drop the item then remove it

> How?
04-05-2009, 06:01 AM#6
Fledermaus
UnitDropItemPoint UnitDropItemSlot
04-05-2009, 06:22 AM#7
wraithseeker
Another problem, Does RemoveItem count as A unit drops the item? Since the bonuses are getting removed.
04-05-2009, 09:47 AM#8
wraithseeker
Never mind, problem was solved.
04-05-2009, 03:42 PM#9
akolyt0r
another problem:
When a unit gives a item to another unit it does NOT fire this event ..
but the other unit fires the item-aquired event ..

dunno, but i think i saw a "workaround-script" around someday which solves this issue..
04-06-2009, 03:55 AM#10
akolyt0r
hmm ...then it was the other way round ...? (doesnt fire EVENT_UNIT_PICKUP_ITEM) ...
Im pretty sure i had some problems with something like this 0.o
04-06-2009, 04:00 AM#11
Vexorian
ah this reminds me of all the 'fun' I have had when coding InvX, and to think I am in the process of doing it all again, just depends on how much I take to add modules.
04-06-2009, 05:33 AM#12
akolyt0r
DANG..
I just disqualified myself.
You R right.
The issues with items i had were, that it doesnt fire any events when you try to pickup items with full inventory, or try to give items to a unit with full inventory.