Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
P.S. This is not the solution, this is how to get it started.
You can also make regions, that checks if the Owner of Picked unit is Equal to Neutral Hostile/Passive and, if not, then order your units to go on that region.
In the World Editor, create a region on every Player's Start Location. Then, do this:
Tr
Events
Map Initialization
Conditions
Actions
Set Regions[1] = (Region 000 <gen>)
Set Regions[2] = (Region 001 <gen>)
...
Set Regions[10] = (Region 010 <gen>)
Trig
Events
Unit - A unit finishes training a unit
Conditions
Actions
For each (IntegerA) from 1 to 10, do (Actions)
Loop - Actions
Set Temp_Group = (Units in Region[(IntegerA)])
Unit Group - Pick every unit in (Temp_Group) and do (Actions)
Loop - Actions
If (All conditions are true) then do (Actions) else do (Actions)
If - Conditions
Or - Conditions
(Owner of (Picked unit)) Not Equal to Neutral Passive
(Owner of (Picked unit)) Not Equal to Neutral Hostile
Then - Actions
Set Point1 = (Center of (Regions[(IntegerA)])
Unit - Order (Trained unit) to Attack - Move to (Point1)
You can set all (enemy) buildings into a unit group, and then order them to attack-move to a position of random unit from the unit group.
Or you can order them to attack closest unit or building, this is the trigger that selects closest unit:
Closest Unit
Events
Conditions
Actions
Set Temp_Unit_1 = The unit you want to order to do something
Set Temp_Loc_1 = (Position of Temp_Unit_1)
Set Temp_Real_1 = 9999999.00
Set Temp_Group_1 = (Units in (Playable map area) matching (Temp_Unit_1 Not equal to (Matching unit))) // select all units you want to compare the distance to
Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
Loop - Actions
Set Temp_Loc_2 = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between Temp_Loc_1 and Temp_Loc_2) Less than Temp_Real_1
Then - Actions
Set Temp_Unit_2 = (Picked unit)
Set Temp_Real_1 = (Distance between Temp_Loc_1 and Temp_Loc_2)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.