- Joined
- Dec 8, 2005
- Messages
- 319
Ok so basicly, here are the variables to start out with. I was just wondering if there was a way to set the number of times maxium number of times to the number of "Generators" in the regions? like i dont want to set it to 150 because it is inefficant with it running 150 times. when it only has to run like 10 or 20 or 30 but any ideas?
TwentyBuilding = specific building
TwentyUnit = Spawned unit... if player has the correctly built building
UnitSpawner = the region where the units are spawned.
UnitSelector = the region where you can build.
now there are 3 lanes. with a team1+team2 on either side. so units have to stay in the correct lane and spawn in the correct lane. but now here is my loop.(I guess you can say I am a noob at loops)
***EDIT***
ok well i seems like i got a double post... sorry for the confusion but this is what i ment... and this is the correct code this time around. sorry about that guy and my question is at the top... and yes ghost this is leakable... will fix it in a bit. but hey lets try this one more time =D
-
Variables
-
Events
- Map initialization
- Conditions
-
Actions
- Set TwentyBuilding[0] = Infantry Generator
- Set TwentyBuilding[1] = Machine Gunner Generator
- Set TwentyBuilding[2] = Tactics Generator
- Set TwentyBuilding[3] = Rocket Generator
- Set TwentyBuilding[4] = Heavy Infantry Generator
- Set TwentyBuilding[5] = Repair Generator
- Set TwentyUnit[0] = Clockwerk Goblin 20 Seconds
- Set TwentyUnit[1] = Clockwerk Machine Gunner 20 Seconds
- Set TwentyUnit[2] = Clockwerk Tactical 20 Seconds
- Set TwentyUnit[3] = Clockwerk Rocket Launcher 20 Seconds
- Set TwentyUnit[4] = Clockwerk Heavy Tank 30 Seconds
- Set TwentyUnit[5] = Clockwerk Repairer 20 Seconds
- Set UnitSpawner[0] = Crystal1 Team1 <gen>
- Set UnitSpawner[1] = Crystal2 Team1 <gen>
- Set UnitSpawner[2] = Crystal3 Team1 <gen>
- Set UnitSpawner[3] = Crystal1 Team2 <gen>
- Set UnitSpawner[4] = Crystal2 Team2 <gen>
- Set UnitSpawner[5] = Crystal3 Team2 <gen>
- Set UnitSelector[0] = UnitSelector1 Team1 <gen>
- Set UnitSelector[1] = UnitSelector2 Team1 <gen>
- Set UnitSelector[2] = UnitSelector3 Team1 <gen>
- Set UnitSelector[3] = UnitSelector1 Team 2 <gen>
- Set UnitSelector[4] = UnitSelector2 Team 2 <gen>
- Set UnitSelector[5] = UnitSelector3 Team 2 <gen>
-
Events
- [/hidden]
TwentyBuilding = specific building
TwentyUnit = Spawned unit... if player has the correctly built building
UnitSpawner = the region where the units are spawned.
UnitSelector = the region where you can build.
now there are 3 lanes. with a team1+team2 on either side. so units have to stay in the correct lane and spawn in the correct lane. but now here is my loop.(I guess you can say I am a noob at loops)
-
Spawner 20 Seconds
-
Events
- Time - TimerforSpawning[0] expires
- Conditions
-
Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
For each (Integer B) from 1 to 10, do (Actions)
-
Loop - Actions
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units in UnitSelector[(Integer B)]) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Picked unit)) Equal to TwentyBuilding[(Integer A)]
- (Owner of (Picked unit)) Equal to Player 1 (Red)
- (Owner of (Picked unit)) Equal to Player 2 (Blue)
- (Owner of (Picked unit)) Equal to Player 3 (Teal)
-
Then - Actions
- Unit - Create 1 TwentyUnit[(Integer A)] for Player 7 (Green) at (Center of UnitSpawner[(Integer B)]) facing Default building facing degrees
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Picked unit)) Equal to TwentyBuilding[(Integer A)]
- (Owner of (Picked unit)) Equal to Player 4 (Purple)
- (Owner of (Picked unit)) Equal to Player 5 (Yellow)
- (Owner of (Picked unit)) Equal to Player 6 (Orange)
-
Then - Actions
- Unit - Create 1 TwentyUnit[(Integer A)] for Player 8 (Pink) at (Center of UnitSpawner[(Integer B)]) facing Default building facing degrees
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Loop - Actions
-
For each (Integer B) from 1 to 10, do (Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Events
- [/hidden]
***EDIT***
ok well i seems like i got a double post... sorry for the confusion but this is what i ment... and this is the correct code this time around. sorry about that guy and my question is at the top... and yes ghost this is leakable... will fix it in a bit. but hey lets try this one more time =D
Last edited: