- Joined
- May 20, 2008
- Messages
- 433
Well I'm having the trouble with: ((spawning X units in random places in one region)*30)*3 (for those who can't do math, its spawning units in a random point in a region multiplied by 90 (give or take a few)).
I have about 30 hallways that needs population by 3 different types of units at the start of a game (determined through variables done at start). What I'm currently doing is setting a variable (with an array of 30, approximately the amount of hallways) to a random point in a region at the start (therefore it is much easier to destroy the leak). The problem with this is that X units will spawn at the same random point. Is there any way to spawn a bunch of units at random points in a region without causing a leak?
Please take into consideration that I will be doing this ~90 times, so if you know a shortcut without creating/keeping a leak, let me know.
I have about 30 hallways that needs population by 3 different types of units at the start of a game (determined through variables done at start). What I'm currently doing is setting a variable (with an array of 30, approximately the amount of hallways) to a random point in a region at the start (therefore it is much easier to destroy the leak). The problem with this is that X units will spawn at the same random point. Is there any way to spawn a bunch of units at random points in a region without causing a leak?
Note that the second trigger is extremely far from finished, where the leaks are not fixed, nor are all the hallways dealt with (I would rather do it wrong 5 times then do it wrong 90)
As a final note, for those who still don't see the problem: All the 5 units, who are set to spawn in Hallway[1], will spawn at the same point which will change every time the trigger is run. I want it so that those 5 units will spawn in their own random points in Hallway[1] without creating a leak (I know how to do it with right now, but it will create a leak that I have not found a fix for).
-
Game Startup
-
Events
-
Time - Elapsed game time is 0.10 seconds
-
-
Conditions
-
Actions
-
Trigger - Turn off (This trigger)
-
Game - Turn the day/night cycle Off
-
Game - Set the time of day to 24.00
-
-------- Variables --------
-
Set RRed_Controls = Red Controls <gen>
-
Set RYellow_Controls = Yellow Controls <gen>
-
Set RGreen_Controls = Green Controls <gen>
-
Set RBlue_Controls = Blue Controls <gen>
-
Set Objective_RNum1 = (Random integer number between 1 and 1)
-
Set Hallways[1] = (Random point in Hall1A <gen>)
-
Set Hallways[2] = (Random point in Hall1B <gen>)
-
Set Hallways[3] = (Random point in Hall2A <gen>)
-
Set Hallways[4] = (Random point in Hall2B <gen>)
-
Set Hallways[5] = (Random point in Hall3A <gen>)
-
Set Hallways[6] = (Random point in Hall3B <gen>)
-
Set Hallways[7] = (Random point in Hall4A <gen>)
-
Set Hallways[8] = (Random point in Hall4B <gen>)
-
Set Hallways[9] = (Random point in Hall5 <gen>)
-
Set Hallways[10] = (Random point in Hall6 <gen>)
-
Set Hallways[11] = (Random point in Hall7A <gen>)
-
Set Hallways[12] = (Random point in Hall7B <gen>)
-
Set Hallways[13] = (Random point in Hall8 <gen>)
-
Set Hallways[14] = (Random point in Hall9A <gen>)
-
Set Hallways[15] = (Random point in Hall9B <gen>)
-
Set Hallways[16] = (Random point in Hall9C <gen>)
-
Set Hallways[17] = (Random point in Hall9D <gen>)
-
Set Hallways[18] = (Random point in HallEco <gen>)
-
Set Hallways[19] = (Random point in HallMainA <gen>)
-
Set Hallways[20] = (Random point in HallMainB <gen>)
-
Set Hallways[21] = (Random point in HallMainC <gen>)
-
Set Hallways[22] = (Random point in HallMainD <gen>)
-
Set Hallways[23] = (Random point in HallMainE <gen>)
-
Set Hallways[24] = (Random point in HallMainF <gen>)
-
...(unrelated trigger mass)...
-
-------- Detrun --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Then - Actions
-
Set Enemy_Type[1] = Dethnor (Detrun) (Grunt)
-
Trigger - Turn on Detruns <gen>
-
Trigger - Run Detruns <gen> (ignoring conditions)
-
-
Else - Actions
-
-
-
-
Detruns (Disabled at start))
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Unit - Create 5 Enemy_Type[1] for Player 5 (Yellow) at Hallways[1] facing Default building facing degrees
-
Unit - Create 35 Enemy_Type[1] for Player 5 (Yellow) at Hallways[2] facing Default building facing degrees
-
Unit - Create 18 Enemy_Type[2] for Player 5 (Yellow) at Hallways[2] facing Default building facing degrees
-
Unit - Create 9 Enemy_Type[3] for Player 5 (Yellow) at Hallways[2] facing Default building facing degrees
-
Unit - Create 10 Enemy_Type[1] for Player 5 (Yellow) at Hallways[3] facing Default building facing degrees
-
Unit - Create 5 Enemy_Type[2] for Player 5 (Yellow) at Hallways[3] facing Default building facing degrees
-
Unit - Create 20 Enemy_Type[1] for Player 5 (Yellow) at Hallways[4] facing Default building facing degrees
-
Unit - Create 10 Enemy_Type[1] for Player 5 (Yellow) at Hallways[5] facing Default building facing degrees
-
-
As a final note, for those who still don't see the problem: All the 5 units, who are set to spawn in Hallway[1], will spawn at the same point which will change every time the trigger is run. I want it so that those 5 units will spawn in their own random points in Hallway[1] without creating a leak (I know how to do it with right now, but it will create a leak that I have not found a fix for).
Please take into consideration that I will be doing this ~90 times, so if you know a shortcut without creating/keeping a leak, let me know.
Last edited: