HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Order Drop Item

03-07-2009, 08:22 PM#1
ashujon
Right Button Mouse On Item In Inventory
Left Button Mouse On relief (Order Drop Item)
-> Run Trigger

How?
03-07-2009, 08:25 PM#2
xombie
Like so.

Trigger:
Untitled Trigger 003
Collapse Events
Unit - A unit Loses an item
Conditions
Actions
03-07-2009, 08:39 PM#3
ashujon
no, this is when is already droped
need fact of the order
03-07-2009, 08:45 PM#4
xombie
Dropping an item does not trigger the following events:

Collapse JASS:
EVENT_UNIT_ISSUED_ORDER
EVENT_UNIT_ISSUED_POINT_ORDER
EVENT_UNIT_ISSUED_TARGET_ORDER

I do not thing there is an order ID for dropping an item. Sorry man.
03-07-2009, 08:45 PM#5
DioD
there is no order for this as i know.

You can pick item back and do actions you like.
03-07-2009, 08:50 PM#6
ashujon
on network play, order send, signifies he there is, right?
03-07-2009, 09:02 PM#7
xombie
Quote:
Originally Posted by ashujon
on network play, order send, signifies he there is, right?

I'm sorry, I'm not sure what you are trying to clarify.

This question has actually already been asked. Search the forum for "IssueInstantTargetOrder" and it is one of the first posts (I was actually doing some testing with IssueInstantTargetOrder and wanted to check up on wc3c.net. What a coincidence.

Quote:
Originally Posted by Beardo
Yeah, it seems like its impossible to catch

You can order a unit to give an item w/ IssueInstantTargetOrder (thanks Pitzer), but you can't detect it. And you can catch when it gets dropped w/ EVENT_UNIT_DROP_ITEM, but you can't get the target. I'll try some more testing.

EDIT: Okay, so using I2S(GetUnitCurrentOrder(GetTriggerUnit())) in a function after EVENT_UNIT_DROP_ITEM fires (from dropping an item on another unit) returns 852001.

You can't detect this order normally, but you can have a periodic that checks the units current order. You can't, however, get the target of the drop, which kind of leaves me where I began. Oh well

The order of a unit when he is dropping an item is "dropitem".

By the way, only one post to go :P
03-07-2009, 11:04 PM#8
Blackroot
The order ID for dropping an item is 852001. It does not represent a slot ID unfortunantly. The string name is "dropitem".

If I caught this right you want to run a trigger directly before the player drops an item? This is impossible unfortunantly; you must run off of the EVENT_UNIT_DROP_ITEM event. If you don't want an item to be droppable though, and don't want to use the "Item can't be dropped" flag; you can destroy the dropped item and recreate a new one immedaitely; it's quick enough to look appropriate.
03-07-2009, 11:19 PM#9
xombie
If there was a trigger that fired off when a unit was issued the order "dropitem" it would execute at the exact same time as EVENT_UNIT_ITEM_DROPPED anyways, so just use that event like I said in my first post.