| 12-28-2006, 08:54 PM | #1 |
im making an inventory system. it is so far going smoothly except i dont know how to get the item moved in a trigger that activates when a unit drags an item to another slot. i already looked at all 3 inventory systems, and i still cant figure it out. JASS:function InventoryDragItemConditions takes nothing returns boolean local integer i = GetIssuedOrderId() return i > 852001 and i < 852008 endfunction function dragact takes nothing returns nothing local integer l = GetIssuedOrderId() local string b local string fro = "?" set l = l - 852001 set b = I2S(l) call DisplayTextToForce( GetPlayersAll(), ( ( "the unit moves its item in slot" + fro ) + ( "to slot" + b ) ) ) endfunction //=========================================================================== function InitTrig_Untitled_Trigger_001 takes nothing returns nothing local trigger t = CreateTrigger() call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) call TriggerAddCondition( t, Condition( function InventoryDragItemConditions ) ) call TriggerAddAction( t, function dragact ) set t = null endfunction as you can see, this is supposed to test my trigger by telling you what you moved, and where you moved it. what do i set fro to? |
| 12-29-2006, 08:53 PM | #2 |
perhaps i wasnt very clear with what help i needed. when using the EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER event, i know how to detect the slot the item was moved too, but how do i detect what slot the item was moved from? |
