| 05-11-2007, 04:58 PM | #1 |
So, how can I detect when a player moves an item within an inventry to a different slot? Does it count as a unit order? (EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) ? If so, how do I find out whether the target is an item (rather than a point or unit)? Or can i just skip right to item = GetOrderTargetItem() EDIT: removed lisp spellings :P |
| 05-11-2007, 05:06 PM | #2 |
The best way to test this would be to add an order detecting ability to your map and see which event registers properly. I can't say from personal experience for sure (And definitely don't want to say something that might not be true), but I think the best course of action is to just test it and see what works. It can definitely be detected with one of the three order events though. |
| 05-11-2007, 05:15 PM | #3 |
http://wc3campaigns.net/showthread.php?t=81742 And the unit event is the target order You should need it : GetIssuedOrder (returns an integer) |
| 05-11-2007, 05:17 PM | #4 | |
Quote:
|
| 05-11-2007, 05:19 PM | #5 |
I was looking for that tutorial, Moy. It was weird, I searched in the tutorial area for the term "ability" and it kept saying no matches were found. >_> Glad someone knows where it is though. :P |
| 05-11-2007, 05:30 PM | #6 |
This trigger should do it: JASS:function Trig_Detect_Item_Move_Actions takes nothing returns nothing local integer orderid = GetIssuedOrderId() if orderid > 852001 then if orderid < 852008 then set orderid = orderid - 852001 call DisplayTextToForce(GetPlayersAll(),I2S(orderid)) endif endif endfunction //=========================================================================== function InitTrig_Detect_Item_Move takes nothing returns nothing set gg_trg_Detect_Item_Move = CreateTrigger( ) call TriggerRegisterPlayerUnitEventSimple( gg_trg_Detect_Item_Move, Player(0), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER ) call TriggerAddAction( gg_trg_Detect_Item_Move, function Trig_Detect_Item_Move_Actions ) endfunction If you move an item to slot x "GetIssuedOrderId()" will return: slot 1 = 852002 slot 2 = 852003 slot 3 = 852004 slot 4 = 852005 slot 5 = 852006 slot 6 = 852007 |
| 05-11-2007, 05:32 PM | #7 | |
Quote:
Yeah i don't use the search tool but just time and my eyes xD |
| 05-11-2007, 05:41 PM | #8 |
Awesome response guys. I'm thinking I may just make the items undroppable (prevents movememnt) and trigger dropping/moving as i need it. |
