- Joined
- Mar 24, 2020
- Messages
- 80
Hi guys,
I am trying to create a hot spot system. What I am trying to achieve is when there are multiple players building in an area of the map, the periodically spawned roaming creeps will gravitate that way.
So, some context. I have a system that spawns creeps every 15 seconds and they randomly roam around the map. What I would like is for a separate system to run every 60 seconds which pulls the creeps towards the hot spots. If a player is building alone (so has 1 main structure), they won't pull creeps, they just need to fight off the ones that randomly come across their base.
So far I've created a 60 second timer and the below trigger. Unfortunately it doesn't work. Basically, the idea is that every 60 seconds a point is put on every town hall, counts how many other town halls are in close proximity and then pulls creeps in X radius towards the town hall, depending on how many town halls are close by. (I have also included the improved tiers).
If I can get some help perhaps fixing the below trigger, or creating a better system, please let me know!
I am trying to create a hot spot system. What I am trying to achieve is when there are multiple players building in an area of the map, the periodically spawned roaming creeps will gravitate that way.
So, some context. I have a system that spawns creeps every 15 seconds and they randomly roam around the map. What I would like is for a separate system to run every 60 seconds which pulls the creeps towards the hot spots. If a player is building alone (so has 1 main structure), they won't pull creeps, they just need to fight off the ones that randomly come across their base.
So far I've created a 60 second timer and the below trigger. Unfortunately it doesn't work. Basically, the idea is that every 60 seconds a point is put on every town hall, counts how many other town halls are in close proximity and then pulls creeps in X radius towards the town hall, depending on how many town halls are close by. (I have also included the improved tiers).
If I can get some help perhaps fixing the below trigger, or creating a better system, please let me know!
-
Loop
-
Events
-
Time - Every 60.00 seconds of game time
-
-
Conditions
-
Actions
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units of type Settlement) and do (Actions)
-
Loop - Actions
-
Set VariableSet SpawnLocation = (Position of (Picked unit))
-
Set VariableSet CountTownHalls = (((Number of units in (Units within 2500.00 of SpawnLocation matching ((Unit-type of (Matching unit)) Equal to Settlement).)) + (Number of units in (Units within 2500.00 of SpawnLocation matching ((Unit-type of (Matching unit)) Equal to Keep).))) + ((Number o
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CountTownHalls Equal to 1
-
-
Then - Actions
-
Else - Actions
-
Set VariableSet TownHallPull = (CountTownHalls x 2500)
-
-
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within (Real(TownHallPull)) of SpawnLocation matching (((Matching player) is in UndeadForces.) Equal to True).) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Current order of (Picked unit)) Not equal to (Order(attack))
-
(Current order of (Picked unit)) Not equal to (Order(rainoffire))
-
(Current order of (Picked unit)) Not equal to (Order(carrionswarm))
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To SpawnLocation
-
AI - Ignore (Picked unit)'s guard position
-
Custom script: call RemoveLocation(udg_SpawnLocation)
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation(udg_SpawnLocation)
-
-
-
-
Last edited: