I need a quick answer. I'm trying to make a spawn trigger that creates a unit at a random point in a collage of 6 different regions every 2 seconds of game time. It looks like this currently, and I know it's wrong. I'm looking for a way to combine the parts of the array into one huge region.
-------------- Create The Desolace1 Events Time - Every 2.00 seconds of game time Conditions (Number of units in (Units in Desolace[(Integer A)] matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True))) Greater than 0 (Number of units in (Units in Desolace[(Integer A)] matching (((Matching unit) is in (Units owned by Neutral Hostile)) Equal to True))) Less than or equal to 20 Actions Set RandomDice = (Random integer number between 1 and 1) If (RandomDice Equal to 1) then do (Unit - Create 1 Wild Pig for Neutral Hostile at (Random point in Desolace[(Random integer number between 1 and 6)]) facing (Random point in (Playable map area))) else do (Do nothing) ------------
Array[0]=4 (area of first region) Array[1]=6 (sum of area of second region and Array[0]) Array[2]=7 (sum of area of third region and Array[1]) Array[3]=9 Array[4]=13 Array[5]=17
EVERY 2 SECONDS 1 - Generate a random integer between 0 and (Array[5]-1)
2 - Do a loop from 0 to (6 - 1), if Array[loop iterator] is less than your random number, spawn unit, skip remaining actions
Create The Desolace1 Events Time - Every 2.00 seconds of game time Conditions (Number of units in (Units in Desolace[(Integer A)] matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True))) Greater than 0 (Number of units in (Units in Desolace[(Integer A)] matching (((Matching unit) is in (Units owned by Neutral Hostile)) Equal to True))) Less than or equal to 20 Actions Set RandomDice = (Random integer number between 1 and 1) If (RandomDice Equal to 1) then do (Unit - Create 1 Wild Pig for Neutral Hostile at (Random point in Desolace[(Random integer number between 1 and 6)]) facing (Random point in (Playable map area))) else do (Do nothing) << I noticed here is anywhere a For Loop Index from 1 to *count of rects*
You have to pick all the rects first than you can do something with them , lol!!!
Use : General - For Each Integer A From 1 to *yourintegerofrects* do ( multiplicate actions )