Ok so we have 2 marines for a computer player, Unit A & B.
Unit A is preplaced before the starting of the map
Unit B is preplaced as well, but has already finished a 'Move' order.
Both Units are idle.... but only Unit B has 'become idle'
How do you create a trigger that can detect only unit A as in. "is idle" but hasnt "become idle"??
i can detect when Unit B becomes idle but cant detect Unit A, because it "is idle" but never had a pre-order to beforehand
(My theory): If i can detect unit A, i can simply issue it a "hold position" then a "stop", which will make the unit idle... which there is a event that can detect that, but i still need a condition for this. If Blizzard adds a condition "unit is idle" (IS could be changeable to WAS, IS or BECAME)
then this would be possible....
Note-
-The condition "idle units for player," doesnt detect units that are preplaced or if you "change ownership of unit"
-dont know how to detect units that have ownership changed.
None.
I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.
The Event detects that a unit goes into the idle status (= finishing an order; I don't know about spawning without rally point or trigger created).
Events will never detect a specific status, only actions that change stuff.
So you can track all idle units, if you track the functions that change the amount of these units.
You already stated some ways that can change the amount of idle units for a player without having the unit finishing/dropping an order (that's what the event detects).
So you can track all idle units, if you track the functions that change the amount of these units.
give examples on this
You already stated some ways that can change the amount of idle units for a player without having the unit finishing/dropping an order (that's what the event detects).
if you change ownership of unit, the unit is considered idle, but still hasnt "become idle". You would have to issue it an order to briefly complete.
Also same for created units as well...
None.
I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.
So you can track all idle units, if you track the functions that change the amount of these units.
give examples on this
- have a unit group variable that contains all idle units (from map or player)
- at map start, throw in all units into that group or order every unit to do something like moving onto their position (see next point)
- "unit becomes idle" -> add
- "unit stops being idle" -> remove
- unit enters entire map -> add (maybe only, I don't know how trained units behave if they have rally points; so check their order)
- unit owner changes -> add (check their order) / remove (if you track all owner's units, ignore)
- unit dies -> remove
But maybe there is a better way to achieve what you would like to achieve with this because I've no idea why you want to track idle units.
Just use the "Unit Order Count" comparison as a condition, the event can be anything.
If the unit's order count is zero then the unit is idle (command card shows Stop highlighted), anything other than Stop counts as 1 order.
🤙🏾
I've no idea why you want to track idle units.
Sneak peak: Sneaking mission! Units that "see you" become player 8.. After they "loose sight" or terminate the "intruder", they go back to player 7.
If they turn into player 8 but don't pursue the "intruder," they are idle but don't become idle...
Just use the "Unit Order Count" comparison as a condition, the event can be anything.
If the unit's order count is zero then the unit is idle (command card shows Stop highlighted), anything other than Stop counts as 1 order.
This might work, i'l report back.
Also i was thinking of periodically issuing every player 8 unit a "Hold position" and "Stop" Order after existing orders complete. We'll see
None.
I advocate Ahli's method. If you know when units should be counted as idle but won't return true on the "unit becomes idle" event, just check for the events that cause them to become idle without tripping the "unit becomes idle" event as well (in your case, that may be looking for a player gaining a unit, and possibly using the unit order count condition if you think you need to).
None.
I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.
If I would need the idle units often, I would use mine.
If I would need them rarely, I would do TF-'s solution.
I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.
I would like to add that I just saw that there is an unit group action that returns a unit group with all idle units of a player.
-> so you could just use that