Hi
I premade several points like 10 of them around my map and wanted to randomly spawn units between those points.
I know there's so called "random point in a region" and "random point between another point" but I only want my given points to work.
Any idea?
Condition; (Number of Living units in (Any units in "Large Region That overlaps all your points" owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) < "some number of units you want roaming around"
Event; General - Repeat (Actions) X times
Actions
General - Switch (Actions) depending on (Random integer between 0 and 3)
Cases
if 0
Actions
Unit - Create 1 "unit that you want" for player 15 at (Point facing 270.0 degrees) using default facing (No Options)
Depending on how your using those points, what your doing may not work.
If you have triggers where the Effect relies on the point that you have moved randomly. The trigger will not update to the new position of the point. In my own map I had to switch to using regions because triggers that rely on regions will update to the regions position when the region referenced is moved.
Hi I premade several points like 10 of them around my map and wanted to randomly spawn units between those points. I know there's so called "random point in a region" and "random point between another point" but I only want my given points to work. Any idea?
@jerberson12: Go
yup.
Spawns.
Event; Timer - Every 60.0 seconds of Game Time
Condition; (Number of Living units in (Any units in "Large Region That overlaps all your points" owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) < "some number of units you want roaming around"
Event; General - Repeat (Actions) X times Actions General - Switch (Actions) depending on (Random integer between 0 and 3) Cases if 0 Actions Unit - Create 1 "unit that you want" for player 15 at (Point facing 270.0 degrees) using default facing (No Options)
add more cases as needed
create an array of point type
initialize its values with your points location
create a timer event
then use randomize integer function
use the random integer as array index for the point array to where you want your units to spawn.
voila! apple pie!
@jerberson12: Go
Depending on how your using those points, what your doing may not work.
If you have triggers where the Effect relies on the point that you have moved randomly. The trigger will not update to the new position of the point. In my own map I had to switch to using regions because triggers that rely on regions will update to the regions position when the region referenced is moved.
create one region with multiple areas and use the random point in region trigger.
it can easily be combined with unit enters region and a send attack order.
@b0ne123: Go
Why would you create a region with multiple areas. ? Inless you want all the areas to do the same thing
he want all areas do the same thing?!
its way better and easier then these triggers to get a random point out of an array of points