I can't seem to get a targeted unit order comparison to work. I have no idea why.
Events
Unit - Drone [75.28, 78.72] is issued an order to Any Ability Command
Local Variables
Conditions
((Triggering unit) order at index 0) == ( Move targeting (Target point for (Triggering order)))
Actions
UI - Display "True" for (All players) to Chat area
With this order, if I order the unit to stop, it works. But if it's targeted, it does not.
My goal is to compare a Drone's gathering. With the same command above (only with the 'Drone - Gather' ability and targeting a specific mineral patch or Extractor for simplicity sake) it doesn't work. My desires for the trigger are of course a lot more in-depth than above, but I can't even make something as simple as that work.
You need to compare order targets and order commands, not actual orders. Orders are unique every time you create them so comparisons will fail.
From the native file...
Order(abilCmd)==Order(abilCmd)// False (two different order instances)
Hence "((Triggering unit) order at index 0) == ( Move targeting (Target point for (Triggering order)))" always returns false. Order ability commands and order targets can be compared in such a way.
In your case you need to check the ability command of order at index 0 is equal to Move. You do not care about the order target so you do not need to test that.
Thanks a lot. This definitely pointed me in the right direction. I actually do care about the order target, and I was able to get that now that I understand.
Update: Resolved
I can't seem to get a targeted unit order comparison to work. I have no idea why.
With this order, if I order the unit to stop, it works. But if it's targeted, it does not.
My goal is to compare a Drone's gathering. With the same command above (only with the 'Drone - Gather' ability and targeting a specific mineral patch or Extractor for simplicity sake) it doesn't work. My desires for the trigger are of course a lot more in-depth than above, but I can't even make something as simple as that work.
So what am I doing wrong?
You need to compare order targets and order commands, not actual orders. Orders are unique every time you create them so comparisons will fail.
From the native file...
Hence "((Triggering unit) order at index 0) == ( Move targeting (Target point for (Triggering order)))" always returns false. Order ability commands and order targets can be compared in such a way.
In your case you need to check the ability command of order at index 0 is equal to Move. You do not care about the order target so you do not need to test that.
@ImperialGood:
Thanks a lot. This definitely pointed me in the right direction. I actually do care about the order target, and I was able to get that now that I understand.