I am trying to create a trigger that makes all Zerglings on the map attack move to a random direction every 10 seconds. The result will be that Zerglings attack moves in an irregular pattern. (The trigger starts when the game starts.)
I have something similar, although I don't have the 10 second wait in between. Instead, I just stack up 1000 commands to go to random points and let them go.
You'll want to create a Trigger based on a Periodic event running every 10 seconds. Inside the trigger you'll have some code that will either Pick Each Unit from Unit Group or you'll loop through your array containing zerglings (however you're tracking them) and then Issue Order Targeting Point and tell them to Move to a random point. If you want these points to be within a certain region I'd suggest generating points using Polar Offset and you can plug in your center point as a value or variable and then plug in Random Angle for polar offset and some random distance (between two integers) for distance. Hope that helps.
emm, it is random for each zergling. Is your map maybe, if random point is far they will try to go around any obstacles often taking similar path if they start in simillar spot
I am trying to create a trigger that makes all Zerglings on the map attack move to a random direction every 10 seconds. The result will be that Zerglings attack moves in an irregular pattern. (The trigger starts when the game starts.)
How can this be done?
@Kabelkorven: Go
periodic event 10 sec - pick all zerglings in entire map - order picked unit to attack random point in playable map area.
@Kabelkorven: Go
I have something similar, although I don't have the 10 second wait in between. Instead, I just stack up 1000 commands to go to random points and let them go.
You'll want to create a Trigger based on a Periodic event running every 10 seconds. Inside the trigger you'll have some code that will either Pick Each Unit from Unit Group or you'll loop through your array containing zerglings (however you're tracking them) and then Issue Order Targeting Point and tell them to Move to a random point. If you want these points to be within a certain region I'd suggest generating points using Polar Offset and you can plug in your center point as a value or variable and then plug in Random Angle for polar offset and some random distance (between two integers) for distance. Hope that helps.
there's behavior called "wander" you can take a look at it
This sounds simple and effective. But I canĀ“t get it to work. Can you clarify?
Try
Order check is here because if unit have not reached point in 10sec window another order will stack and eventually they can stack too much.(imo)
Thanks. Right now all Zerglings run in the same direction. Is it possible to make each Zergling recieve an individual order?
This code is probably the most efficient one.
Units will not move in the same direction, and with a timer of 0.1 seconds, no units will stand still when they reach their ordered point.
@Kabelkorven: Go
emm, it is random for each zergling. Is your map maybe, if random point is far they will try to go around any obstacles often taking similar path if they start in simillar spot