Detecting when a rally-point order is issued.

CYBER_Aeon

New Member
Reaction score
11
I could use a little help getting this trigger to work. Not sure what i'm doing wrong. I suspect 'rally' isn't what I want for the order in the condition, even though I am trying to tell when a rally-point order is issued.
Code:
    Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Unit-type of (Ordered unit)) Equal to Teleport Rune (Magic)
        (Issued order) Equal to (Order(rally))
    Actions
        Set tmpPoint = (Target point of issued order)
        Set tmpPoint2 = (Position of (Ordered unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Distance between tmpPoint and tmpPoint2) Greater than or equal to 2000.00
            Then - Actions
                Unit - Set Rally-Point for (Ordered unit) to tmpPoint2
                Game - Display to (Player group((Owner of (Ordered unit)))) the text: |CFFFFCC00You canno...
            Else - Actions
        Custom script:   call RemoveLocation(udg_tmpPoint) 
        Custom script:   call RemoveLocation(udg_tmpPoint2)
 

CYBER_Aeon

New Member
Reaction score
11
Doesn't seem to work. I threw together some triggers for testing. Looks like whenever you issue a right-click command for a unit, it fires an order called 'smart', and whenever you issue a rally point (by clicking the ability icon) it fires an order called 'setrally' (I was checking for 'rally', whoops)

I should be able to do it from here, now. It's not the most optimal - I'd know when the right-click order issued is a rally, smart could be an attack order. But in this situation, it should work anyway. I'll just do a safety check on the rally point no matter what. If you didn't move the rally point, it shouldn't be out of range, so I should be alright.
 

Chocobo

White-Flower
Reaction score
409
"rally" is not an order (ConvOrder says it doesn't exist).

To get the orderId of that action, use :

More JASS...

Event
- Unit - A unit Is issued an order targeting an object
- Unit - A unit Is issued an order targeting a point
- Unit - A unit Is issued an order with no target
Conditions
Actions
- Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))

and a unit with the "illusions" item...
 

Insane!

Shh I didn't edit this, go away.
Reaction score
122
>Originally Posted by AceHart
>More JASS...

>Event
>- Unit - A unit Is issued an order targeting an object
>- Unit - A unit Is issued an order targeting a point
>- Unit - A unit Is issued an order with no target
>Conditions
>Actions
>- Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))

>and a unit with the "illusions" item...

yes but you also can put it like this

game - display text message to all players ( issued order )
 

CYBER_Aeon

New Member
Reaction score
11
Yeah, I did it the way Insane! suggested, actually. Turns out Rally fires as two different things, depending on how you activated it. If you click the ability and specify you're setting the rallypoint, it fires as 'setrally'.

If you just right-click, it fires as 'smart', which probably means the game decides if the unit should move somewhere, start attacking or change the rally point location.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top