• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Quick Question : Orders and Stuff

Status
Not open for further replies.
Level 23
Joined
Oct 20, 2012
Messages
3,075
  • Test
    • Events
      • 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
      • (Issued order) Equal to (Order(smart))
    • Actions
      • Game - Display to (All players) the text: (Angle (Target Point) : + (String((Angle from (Position of (Ordered unit)) to (Target point of issued order)))))
      • Game - Display to (All players) the text: (Angle (Target unit) : + (String((Angle from (Position of (Ordered unit)) to (Position of (Target unit of issued order))))))

Both game text will display a value. When there's a target unit, the first line will display the wrong value. When there's no target unit, the second line displays the wrong value. No target, then both game text will return the same wrong value.

Now I'm gonna ask:
1.) Where does the game get this value (The wrong one)? Shouldn't this be a null or something?
2.) Is there anyway to check if an order that can target either a unit or point has a target unit or not when issued to a unit?

EDIT: Nevermind no 2. I found a solution already.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
maybe a test map? Im too lazy to set up one.

Or maybe try printing Position of (Target unit of Issued order) and Target point of issued order, see if they are different.

If you want to get unit ordered you can use (Target unit of issued order), which can be found in Unit selection as Event Response - Target unit of issued order. Maybe this is not what you want, but this is what I understood from your question
 
Level 13
Joined
Oct 16, 2010
Messages
731
You need to add in some conditions to make it decide whether there is a target unit or not. Your first line relies on their not being a target unit, hence why it gives a wrong answer. Whereas the second line is the opposite, relying on a target unit.

Make a variable for "TargetUnit" that can be called "TempUnit" or something like that. Set it as the "Target of issue blah blah blah". Then have a condition that checks if TempUnit is equal to "No Unit". If it's equal to No Unit then you use your line that works for points, if not then you use the line that works for units.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
What you mean when "no target"?Smart order's target either a unit or point there is no 3rd option.
 
Status
Not open for further replies.
Top