Hey there, I made following trigger:
How do I change the trigger, that the unit spawned belongs to the owner of the building, which produces the unit? (not just specificly red like in this case)
-
Footman
-
Events
- Time - SpawnTimer expires
- Conditions
-
Actions
- Set VariableSet SpawnUnitGroup = (Units of type Barracks)
-
Unit Group - Pick every unit in SpawnUnitGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
-
Then - Actions
- Set VariableSet TempPoint = (Position of (Picked unit))
- Unit - Create 1 Footman for Player 1 (Red) at TempPoint facing Default building facing degrees
- Unit - Order (Last created unit) to Attack-Move To (Random point in Region 001 <gen>)
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call DestroyGroup (udg_SpawnUnitGroup)
-
Events
How do I change the trigger, that the unit spawned belongs to the owner of the building, which produces the unit? (not just specificly red like in this case)
Last edited: