Check the unit's main actor, change portrait.
Keep in mind that the new portrait won't have the talk animations for the unit's voice sounds.
To prevent one barrack hoging all the queue, extend your requirement to also require CountOfUnit(Marine,QueuedOrBetterAtUnit) == 0 (not quite syntax again). That will ensure a barrack will not be able to queue a marine if it already has one in the queue or building.
The training bar depends on another ability of type "queue", you can define if it's visible and so on.
a) Create a new behavior of type "buff".
b) Set behavior's period to 0.25 (or so), call the periodic effect created next step.
c) Create an effect type Issue Order, set ability to your train command, set Unit to "Source".
d) Create a new requirement for CountOfUnit(Marine) < CountOfUnit(Barracks)*4 (not quite the syntax, but you get the idea)
e) Set the train ability (new one, or a modified existing one) to take that requirement we just created to train more marines.
That's the big picture, you should manage to fill in the details, ask for more details about any specific part otherwise.
You mean you have a bunch of regions, and you need to find the closest region to the point P?
There's no native function for "closest" something that I'm aware of. "Closest region" is kind of ambiguous, I hope you don't mean the shortest distance to a region edge, do you mean the closest region center point? That would imply going through the list of regions and computing distance to center point.
But is this just to find in which hex tile a click lies? Then I would just use a little math based on that point's coordinates to compute the hex tiles, don't mess with 500000 regions.
Eheh, that looks fun.
The thread is slightly old, but if there's still a lag problem with a player quits and you have to remove all its units... Try doing it in smaller chunks : delete up to X units every 0.0625 second for example. The trail won't entirely disappear entirely, but it will disappear in order it was created from the starting point, so it won't look too bad.
Very interesting Kueken531, that's good to know. This is also potentially much more useful than the pre-patch 1.4 mechanisms (I have no idea what they were thinking, it was unused in all of SC2 and overall useless).
Are you sure you want to use triggers? This can be done entirely in data.
You can use a behavior with a periodic effect issuing order to train units, while the Train ability has a requirement that requires the count of marines (QueuedOrBetter) to be less than 4 * barracks to allow training.
I would really implement that kind of stuff in data rather than triggers. Triggers is best used for "higher level" stuff.
To train and send the new units, you can order the AI to do so through management of its attack waves. I'm not sure if you can easily "append" to the existing AIs, but creating one from scratch would work.
To use the unit's abilities, you have to create new Tactical AIs or Tactical AI functions.
Tactical AIs are entries in the data editor, you can look up the existing ones as a guide. For a more flexible solution than data Tactical AI (although in theory more computationally expensive), you can create Tactical AI Functions in Galaxy script. You can extract from the game MPQs the existing functions to learn from them. Either way, for each unit, you then set its "Tactical AI" or the "Tactical AI Function" in the unit's data.