HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting "null" orders

01-11-2004, 05:17 PM#1
Hunter0000
I did a test and found that when a unit has no real orders(or when on patrol witch I found quite interesting) its orderstring equals "(null)".

When I try to detect both "(null)" or "null" it doesnt work. What should I use todetect when a unit has no current orders?

EDIT: stop and none dont work either, so no one try to be a smartass
01-11-2004, 06:23 PM#2
chemo
E:
Unit - A unit owned by Player X Is issued an order with no target

A:
Unit - Order (Ordered unit) to Attack-Move To (Center of Destination[(Integer((Mana of (Ordered unit))))])

it works ^^
01-11-2004, 06:24 PM#3
Hunter0000
really? thats an odd way to do it, but il go check it out.

EDIT: nope it doesnt work

Events
Unit - A unit Is issued an order with no target
Conditions
((Owner of (Triggering unit)) controller) Equal to Computer
Actions
Unit - Order (Triggering unit) to Move To ((Position of (Triggering unit)) offset by 2000.00 towards (Random real number between ((Angle from (Position of (Triggering unit)) to (Position of Footman 0103 <gen>)) + 135.00) and ((Angle from (Position of (Triggering unit)) to (Position of Footman 0103 <gen>)) + 225.00)))

thats the trigger that I tried for your method.( And yes im watching comp units)
01-11-2004, 09:07 PM#4
Hunter0000
No ideas? this is what I have curently, I just need to know the orderstring.

Events
Time - Every 10.00 seconds of game time
Actions
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Current order of (Matching unit)) Equal to (Order(<Empty String>))) and (((Owner of (Matching unit)) controller) Equal to Computer))) and do (Do nothing)
Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by 2000.00 towards (Random real number between ((Angle from (Position of (Picked unit)) to (Position of Footman 0103 <gen>)) + 135.00) and ((Angle from (Position of (Picked unit)) to (Position of Footman 0103 <gen>)) + 225.
01-11-2004, 09:13 PM#5
Vexorian
the fact that it has a null string order doesn't mean that it has a null order id (that is an integer) so it is somehow difficult to do that
01-11-2004, 09:14 PM#6
Hunter0000
EDIT: uggg, how do I go about printing the current ordercode? I cant find it in the integer list(not even in UMSWE)
01-11-2004, 09:44 PM#7
Narwanza
i'm not quite following this thread, but if you want to find an integer, then just make a floating text that displayed the integer. Simple as that.
01-11-2004, 09:58 PM#8
Hunter0000
wow, you REALLY arnt getting it

I am trying to print a units current ordercode, that way I can detect when a unit has no orders by comparing the ordercode to that of a unit with no orders. nothing to do with floating text nothing to do with just a plain integer. Try acually reading my god damn trigger and you will get it. It is a trigger based AI-like fuction that has units with no orders run away from the footman in a general direction.
01-11-2004, 10:49 PM#9
Ligature
At what point do they switch from order "patrol" or "stop" to order "(null)"?

Could you use custom values of units to make your own Current Orders function and use that?
01-12-2004, 11:41 AM#10
Hunter0000
The point is that I cant tell when they do that. I might be able to do it via ordercode, but I cant find a way to detect a unit's current ordercode so I can give it as a mesage to me when im tested, that way I can use a matching condition to pick only the units with no orders.
01-12-2004, 12:02 PM#11
AIAndy
native GetUnitCurrentOrder takes unit whichUnit returns integer

That one returns a units current order id at any time. Its new from 1.13 so I have not tested it yet.
01-12-2004, 12:39 PM#12
Hunter0000
I cant find that option. Are you reffering to a JASS line?
01-13-2004, 04:58 PM#13
AIAndy
I am not sure if you will find it in the GUI so you will probably have to use a JASS line to use it.

set udg_my_var = GetUnitCurrentOrder(udg_unit_var)

Put the unit in the unit variable unit_var, run that Custom Script line and then you will have the current order id in the integer my_var.