• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] Working on a Loop!

Status
Not open for further replies.
Level 7
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 100 because it might cause lag with it running 100 times. plus i need to leak proof this
  • 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>
  • [/hidden]
Ok so lets clear this up. This is what the variables mean.
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 - Every 20.00 seconds of game time
    • 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
              • 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
  • [/hidden]
and honestly if anyone feels they can help me to improve the trigger it self in anyway... please feel free to tell me. i like to learn new stuff so any technique helps. =D
 
Last edited:
Status
Not open for further replies.
Top