| 07-29-2008, 07:33 PM | #1 |
Hi everyone, i would like to detect each time a unit receive an order with object as target, i mean if i mass right clic on an enemy unit i would like to dispaly a text detected for example. I noticed that in this case, WE just remember the first clic and the other times the trigger doesn't start. what can i do ? |
| 07-29-2008, 07:35 PM | #2 |
Unselect the unit every time it is clicked, so the click is re-registered. |
| 07-29-2008, 07:49 PM | #3 |
i'm not sure to understand. unselection change nothing about the problem, i mean it seems that we doesnt consider any smart order if there is already a current one and if the smart order is an attack order.so the trigger will not be launch again, as long as it is the same target, i tried unselection actions but it changes nothing. :s |
| 07-30-2008, 11:45 PM | #4 |
up |
| 07-31-2008, 06:58 AM | #5 |
JASS:library OrderDisplayer initializer Init //=========================================================================== private function H2I takes handle h returns integer return h return 0 endfunction //=========================================================================== private function Actions takes nothing returns nothing call DisplayTimedTextToForce( GetPlayersAll(), 30, ( "Order string: " + OrderId2StringBJ(GetIssuedOrderIdBJ()) ) ) call DisplayTimedTextToForce( GetPlayersAll(), 30, ( "Order Id: " + I2S(GetIssuedOrderId()) ) ) call DisplayTimedTextToForce( GetPlayersAll(), 30, ( "Item Id: " + I2S(H2I(GetOrderTargetItem())) ) ) endfunction //=========================================================================== private function Init takes nothing returns nothing local trigger trig = CreateTrigger() call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER ) call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER ) call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ISSUED_ORDER ) call TriggerAddAction( trig, function Actions ) endfunction endlibrary |
| 07-31-2008, 09:28 AM | #6 |
It displays the Order string only one time if i mass right clic on an ennemy unit. :'( |
| 08-01-2008, 01:01 PM | #7 |
up |
| 08-01-2008, 01:03 PM | #8 |
You can't do it. |
| 08-01-2008, 01:06 PM | #9 |
smart-attack/attack are hardcoded to act that way. By removing attack you can use smart-move, which will issue the order each time. |
| 08-01-2008, 01:20 PM | #10 |
i'm not sure about your solution, what i want is to detect each time a player do a right clic on an ennemy unit with his units. |
| 08-01-2008, 01:37 PM | #11 |
When you right click an enemy unit, the priority is Attack then Rally then Move. To get rally or move as the smart order (both of which can be re-ordered onto the same unit consecutively), attack must not be availiable. |
| 08-01-2008, 01:49 PM | #12 |
the problem is that i need to detect each time a player do a right clic on an ennemy unit no matter if his units can attack or not. |
| 08-01-2008, 02:13 PM | #13 |
Which, due to the nature of attack, cannot be done. |
| 08-01-2008, 02:17 PM | #14 |
ok thanks. So there are no world edit pros here ![]() |
| 08-01-2008, 03:30 PM | #15 |
You CAN detect right clicking. However, it might be sort of limited, unless you trigger it to instantly attack... Test with: Goblin Sapper ![]() |
