hi guys. i made a trigger in my map: i want to do an out of combat system for each unit on the map (if theres no enemy in range the unit regenerates). i also used bribes unit indexer for that.
well now theres the problem that my map isn a rpg and there are lots of units on the map, cause of that it laggs a bit.
can you help me make this trigger more efficient so that it doesnt lag?
well now theres the problem that my map isn a rpg and there are lots of units on the map, cause of that it laggs a bit.
can you help me make this trigger more efficient so that it doesnt lag?
-
Combat
-
Events
- Time - Every 0.50 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
-
Loop - Actions
- Set Combat_Unit = (Picked unit)
- Set Combat_Integer = (Custom value of Combat_Unit)
- Set Combat_Point[Combat_Integer] = (Position of Combat_Unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- (Number of units in (Units within 550.00 of Combat_Point[Combat_Integer] matching ((((Matching unit) belongs to an enemy of (Owner of Combat_Unit)) equal to True) and (((Matching unit) is alive) equal to True)))) greater than 0
-
'THEN'-Actions
- Set Combat[Combat_Integer] = True
-
'ELSE'-Actions
- Set Combat[Combat_Integer] = False
-
'IF'-Conditions
- Custom script: call RemoveLocation (udg_Combat_Point[udg_Combat_Integer])
-
Loop - Actions
-
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
-
Events