| 09-08-2009, 08:02 AM | #1 |
How do you catch a 'cancel' type order? The order string 851976 doesn't work anymore. Is there any way to detect this particular order? |
| 09-08-2009, 08:51 AM | #2 |
Checked if this works? JASS:if GetIssuedOrderId() == 0 or OrderId2String(GetIssuedOrderId()) = "stop" |
| 09-08-2009, 10:02 AM | #3 |
if GetIssuedOrderId() == 0 <-- doesn't work OrderId2String(GetIssuedOrderId()) = "stop" <-- makes the editor crash, lol Also, I'm not very skilled with JASS, so I might be doing it wrong, but I replaced the above code in the condition, which is: JASS:if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("851976") ) ) then |
| 09-08-2009, 10:07 AM | #4 |
But the 851976 is an integer ID, why converting it again to an order? JASS:OrderId2String(GetIssuedOrderId()) = "stop" // makes the editor crash, lol So its JASS:OrderId2String(GetIssuedOrderId()) == "stop" |
| 09-08-2009, 10:16 AM | #5 |
Okay, it's still crashing, so I guess I'm doing it wrong. Also "But the 851976 is an integer ID, why converting it again to an order?" I don't really know what that means... I just converted the GUI trigger to custom text and replaced it. I'll paste the whole trigger in custom text: JASS:function Trig_Out_of_Build_Mode_Copy_Func002C takes nothing returns boolean if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'u00A' ) ) then return false endif if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("851976") ) ) then return false endif return true endfunction function Trig_Out_of_Build_Mode_Copy_Conditions takes nothing returns boolean if ( not Trig_Out_of_Build_Mode_Copy_Func002C() ) then return false endif return true endfunction function Trig_Out_of_Build_Mode_Copy_Func003001003001 takes nothing returns boolean return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true ) endfunction function Trig_Out_of_Build_Mode_Copy_Func003001003002001 takes nothing returns boolean return ( GetUnitTypeId(GetFilterUnit()) == 'u000' ) endfunction function Trig_Out_of_Build_Mode_Copy_Func003001003002002001 takes nothing returns boolean return ( GetUnitTypeId(GetFilterUnit()) == 'u008' ) endfunction function Trig_Out_of_Build_Mode_Copy_Func003001003002002002 takes nothing returns boolean return ( GetUnitTypeId(GetFilterUnit()) == 'u007' ) endfunction function Trig_Out_of_Build_Mode_Copy_Func003001003002002 takes nothing returns boolean return GetBooleanAnd( Trig_Out_of_Build_Mode_Copy_Func003001003002002001(), Trig_Out_of_Build_Mode_Copy_Func003001003002002002() ) endfunction function Trig_Out_of_Build_Mode_Copy_Func003001003002 takes nothing returns boolean return GetBooleanAnd( Trig_Out_of_Build_Mode_Copy_Func003001003002001(), Trig_Out_of_Build_Mode_Copy_Func003001003002002() ) endfunction function Trig_Out_of_Build_Mode_Copy_Func003001003 takes nothing returns boolean return GetBooleanAnd( Trig_Out_of_Build_Mode_Copy_Func003001003001(), Trig_Out_of_Build_Mode_Copy_Func003001003002() ) endfunction function Trig_Out_of_Build_Mode_Copy_Func003A takes nothing returns nothing call SelectUnitForPlayerSingle( GetEnumUnit(), GetOwningPlayer(GetTriggerUnit()) ) endfunction function Trig_Out_of_Build_Mode_Copy_Actions takes nothing returns nothing call ForGroupBJ( GetUnitsInRangeOfLocMatching(100.00, GetUnitLoc(GetTriggerUnit()), Condition(function Trig_Out_of_Build_Mode_Copy_Func003001003)), function Trig_Out_of_Build_Mode_Copy_Func003A ) endfunction //=========================================================================== function InitTrig_Out_of_Build_Mode_Copy takes nothing returns nothing set gg_trg_Out_of_Build_Mode_Copy = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Out_of_Build_Mode_Copy, EVENT_PLAYER_UNIT_ISSUED_ORDER ) call TriggerAddCondition( gg_trg_Out_of_Build_Mode_Copy, Condition( function Trig_Out_of_Build_Mode_Copy_Conditions ) ) call TriggerAddAction( gg_trg_Out_of_Build_Mode_Copy, function Trig_Out_of_Build_Mode_Copy_Actions ) endfunction |
| 09-08-2009, 12:04 PM | #6 | |
Quote:
JASS:if GetIssuedOrderId() != 851976 then |
| 09-08-2009, 01:05 PM | #7 |
Nope, still nothing happens when I click on cancel to exit the summon building menu. |
| 09-08-2009, 01:50 PM | #8 |
Display the current order of a unit everytime it does any action and check the ID while doing cancel. |
| 09-08-2009, 02:33 PM | #9 |
Wow, that's clever. Never would have thought of that. EDIT: it doesn't seem to have an ID. I got the display of the order from pretty much everything, from right-clicks to 'necropolis' when an acolyte was ordered to build a necropolis (and even (null) for ordering a research to start and wateelemental for summoning a water elemental). Alas, it didn't detect the 'cancel' order. |
| 09-08-2009, 02:38 PM | #10 |
Have you used the Event A unit gets an order or have you checked periodicly units current order? |
| 09-08-2009, 02:58 PM | #11 |
I did: Trigger: ![]() Events![]() Unit - A unit is issued an order targeting a point![]() Unit - A unit is issued an order targeting an object![]() Unit - A unit is issued an order with no target![]() Conditions![]() Actions![]() Game - Display to (All Players) for 10.00 seconds the text: (String((Current Order of (Triggering Unit))) |
| 09-08-2009, 03:22 PM | #12 |
try this: Trigger: Custom script: call BJDebugMsg("OrderId is: "+I2S(GetIssuedOrderId()))EDIT: I just tested and apparently there is no order issued when canceling the build menu, or the hero skill menu. Although when canceling a building/unit, 851976 is given. |
| 09-08-2009, 04:07 PM | #13 | |
Quote:
|
| 09-09-2009, 01:57 PM | #14 |
After some checking of ORDERS, I found this one as the stop order ID: 851972 in a few lists. Maybe check for that one too. Edit: Oh, the cancel order ID is: 851976 Try these aswell: 851991 851987 851973 851975 852019 |
| 09-09-2009, 03:15 PM | #15 |
Dusnt wurk :( |
