| 04-12-2007, 02:40 PM | #1 |
I had read the ability Guide but i can't order an unit to use an item on a slot. I try it with many items that don't need a target, like the potion of invulnerability ( 'pnvu' ). This item is in slot 2. So i've try this JASS:call IssueImmediateOrderById( udg_U, 852009 ) But nothing happens. udg_U is the good unit And the unit never get an order (always stop) Must i use an other fonction ? IssueImmediateOrderById is not the correct one ? |
| 04-12-2007, 04:54 PM | #2 |
Are you sure you know which slot is slot 2? Why not just try with the item in the top left slot and order id 852008? (function is correct) |
| 04-12-2007, 06:11 PM | #3 |
That's right i completly mess this point but anyway i the id seems not the same for me I 've tried this : JASS:function Test_Actions takes nothing returns nothing local integer I=852007 loop set I=I+1 " call BJDebugMsg( GetUnitName(udg_U) ) call IssueImmediateOrderById( udg_U, 852008 ) call TriggerSleepAction (0.5) exitwhen I == 852013 endloop call IssueImmediateOrderById( udg_U, I ) endfunction //=========================================================================== function InitTrig_Test takes nothing returns nothing set gg_trg_Test = CreateTrigger( ) call TriggerRegisterPlayerChatEvent( gg_trg_Test, Player(0), "test", true ) call TriggerAddAction( gg_trg_Test, function Test_Actions ) endfunction The inventory of udg_U is full with the same item type and the unit can use it '"manually" I will try to get the id when i click on an item ... |
| 04-12-2007, 06:22 PM | #4 | |
Quote:
|
| 04-12-2007, 08:30 PM | #5 |
My trigger wasn't correct sorry for this post, anyway cause of the loop it's better to use a timer. @Blu_da_noob : That's right i completly mess this point but anyway the id seems to be different for me Cuctom script : JASS:function CheckId takes nothing returns nothing set udg_I=udg_I+1 call BJDebugMsg( GetUnitName(udg_U) ) // no need, just for see if udg_U != null call BJDebugMsg(I2S(udg_I)) // no need too call BJDebugMsg(" ") call IssueImmediateOrderById( udg_U, udg_I ) endfunction Trigger Init : Trigger: Trigger CheckId : JASS:function CheckId_Act takes nothing returns nothing call TimerStart(udg_Timer,0.5,true,function CheckId) endfunction //=========================================================================== function InitTrig_CheckId takes nothing returns nothing set gg_trg_CheckId = CreateTrigger( ) call TriggerRegisterPlayerChatEvent( gg_trg_CheckId, Player(0), "test", true ) call TriggerAddAction( gg_trg_CheckId, function CheckId_Act ) endfunction Trigger Stop : Trigger: Udg_U dont use any item ... I will try to get the id of the order when i use an item in a slot ... The only way i see, it's to make a loop and when it will display me : a valid ID for use an item slot =, i will get the right id. But the question is : Can you give me values ?. Beetween X and Y. (orderId) Cause i dont want to wait some hours xD |
| 04-13-2007, 04:17 PM | #6 |
Omg i didn't see there is a function in gui and in jass of course .. JASS:UnitItemInSlotBut i want to know if i can use the idOrder or not so I launch the test map in local area network and wait the defeat (instead of text message) . I increment udg_I by 6 cause these competences must follow themself |
