Curo
Why am I still playing this game...?
- Reaction score
- 109
Short version:
When a unit is given an order, how do I detect what type of thing is being targeted (unit, point, or item)?
Long version:
So say I want to have unit B mimic unit A's orders. I use a trigger that detects when unit A is ordered to do something. Stop and hold position are very simple: I just order unit B to stop/hold position. Even move and patrol aren't too difficult: all I have to do is order unit B to move to the target position of the order.
However, I get stumped when it comes to smart and attack, since these orders can target both points, units, and items. I can't order a unit to attack-move to a point if the target of the order was a unit or item. Similarly I can't order a unit to right click a unit if the target of the order was a point or item.
I tried using conditions like target unit of issued order = no unit and target item of issued order = no item to find if the target was a point. However these conditions don't seem to work properly together, and I'm having trouble detecting what the target of the order is.
When a unit is given an order, how do I detect what type of thing is being targeted (unit, point, or item)?
Long version:
So say I want to have unit B mimic unit A's orders. I use a trigger that detects when unit A is ordered to do something. Stop and hold position are very simple: I just order unit B to stop/hold position. Even move and patrol aren't too difficult: all I have to do is order unit B to move to the target position of the order.
However, I get stumped when it comes to smart and attack, since these orders can target both points, units, and items. I can't order a unit to attack-move to a point if the target of the order was a unit or item. Similarly I can't order a unit to right click a unit if the target of the order was a point or item.
I tried using conditions like target unit of issued order = no unit and target item of issued order = no item to find if the target was a point. However these conditions don't seem to work properly together, and I'm having trouble detecting what the target of the order is.