• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Multiple Region Spawning Error

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
Hi

In my map, enemies will come from various regions. 1 different region for each player.
So when the game starts, if you are 3 players, 3 Gateways will be open.
You should be able to type in -gw to open yet another one, making 4 gateways open for 3 players afterwards.

It is typically the same trigger as in X Hero Siege, if people know this map.

So far my triggers work, but I cannot make the -gw command work. Can someone spot my error?

These are my triggers:

Trigger 1 will count how many players have joined the game. Next it will count the numbers of which regions should be opened.
  • Start Area Count Players
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Integer = 0
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Set Integer = (Integer + 1)
              • Player Group - Add (Picked player) to PlayerGroup
            • Else - Actions
      • Set PlayerCount = Integer
      • Set Integer = 1
      • Set Start_Region_Integer = 0
      • For each (Integer A) from Integer to PlayerCount, do (Actions)
        • Loop - Actions
          • Set Start_Region_Integer = (Start_Region_Integer + 1)
          • Set Start_Region_String[Start_Region_Integer] = open
Trigger 2 is supposed to open the next region in the row. It has a game text to display for testing.
  • Start Area Open Gateways
    • Events
      • Player - Player 1 (Red) types a chat message containing -gw as An exact match
    • Conditions
    • Actions
      • Set Start_Region_Integer = (Start_Region_Integer + 1)
      • Set Start_Region_String[Start_Region_Integer] = open
      • Game - Display to (All players) the text: (String(Start_Region_Integer))
Trigger 3 will save all regions for variables and save points for it to avoid leaks. All regions are closed and will open by trigger 1 and 2.
  • Start Area Regions
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Start_Region[1] = Start Gateway 1 <gen>
      • Set Start_Region[2] = Start Gateway 2 <gen>
      • Set Start_Region[3] = Start Gateway 3 <gen>
      • Set Start_Region[4] = Start Gateway 4 <gen>
      • Set Start_Region[5] = Start Gateway 5 <gen>
      • Set Start_Region[6] = Start Gateway 6 <gen>
      • Set Start_Region[7] = Start Gateway 7 <gen>
      • Set Start_Region[8] = Start Gateway 8 <gen>
      • Set Start_Region[9] = Start Gateway 9 <gen>
      • Set Start_Region[10] = Start Gateway 10 <gen>
      • Set Start_Region_Point[1] = (Center of Start Gateway 1 <gen>)
      • Set Start_Region_Point[2] = (Center of Start Gateway 2 <gen>)
      • Set Start_Region_Point[3] = (Center of Start Gateway 3 <gen>)
      • Set Start_Region_Point[4] = (Center of Start Gateway 4 <gen>)
      • Set Start_Region_Point[5] = (Center of Start Gateway 5 <gen>)
      • Set Start_Region_Point[6] = (Center of Start Gateway 6 <gen>)
      • Set Start_Region_Point[7] = (Center of Start Gateway 7 <gen>)
      • Set Start_Region_Point[8] = (Center of Start Gateway 8 <gen>)
      • Set Start_Region_Point[9] = (Center of Start Gateway 9 <gen>)
      • Set Start_Region_Point[10] = (Center of Start Gateway 10 <gen>)
      • Set Start_Region_String[1] = closed
      • Set Start_Region_String[2] = closed
      • Set Start_Region_String[3] = closed
      • Set Start_Region_String[4] = closed
      • Set Start_Region_String[5] = closed
      • Set Start_Region_String[6] = closed
      • Set Start_Region_String[7] = closed
      • Set Start_Region_String[8] = closed
      • Set Start_Region_String[9] = closed
      • Set Start_Region_String[10] = closed
Trigger 4 is supposed to create the same quantity and level of enemies in each open region. I have a feeling like this is where the issue lies.
  • Start Area Gateway Waves
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Integer = 1
      • For each (Integer A) from Integer to PlayerCount, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Start_Region_String[Integer] Equal to open
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 1
                • Then - Actions
                  • Unit - Create 1 Footman for Player 1 (Red) at Start_Region_Point[Integer] facing Default building facing degrees
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 2
                • Then - Actions
                  • Unit - Create 1 Rifleman for Player 1 (Red) at Start_Region_Point[Integer] facing Default building facing degrees
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 3
                • Then - Actions
                  • Unit - Create 1 Knight for Player 1 (Red) at Start_Region_Point[Integer] facing Default building facing degrees
                • Else - Actions
            • Else - Actions
I hope someone has the capability and generosity to help me. Thanks for stopping by, your time is much appreciated!
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
well the condition in the last trigger is using the array integer "integer" it should be integer A
atm its looping through checking array 1 every time

i suggest u use a custom loop integer instead of integer A because it can cause issues
 
For each (Integer A) from Integer to PlayerCount, do (Actions)
PlayerCount is upper End of the loop but, your open trigger increases Start_Region_Integer.
Therefore PlayerCount will never change and also the amount of active spawning positions.
 
Last edited:
Level 8
Joined
Jun 13, 2010
Messages
344
Hmm I think I follow you guys, but I am not sure I quite understand how to make an example or fix the problem yet.

well the condition in the last trigger is using the array integer "integer" it should be integer A

Im unsure of which part you want me to redo.
- Do you want me to choose the "For each integer variable, do multiple actions" or keep the Integer A and use a loop integer?

PlayerCount is upper End of the loop but, your open trigger increases Start_Region_Integer.
Therefore PlayerCount will never change and also the amount of active spawning positions.

I see your point. However the Start_Region_Integer was meant to follow the amount of active players joined = how many regions opened and furthermore how many you choose to open.
But is it still an issue? How do I fix it? :)


Do you guys happen to able to give an example in a short or something? It would be very helpful.

Thanks for your time. :)
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
  • Start Area Gateway Waves
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • For each (NEW_INTEGER) from 1 to Start_Region_Integer, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Start_Region_String[NEW_INTEGER] Equal to open
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 1
                • Then - Actions
                  • Unit - Create 1 Footman for Player 1 (Red) at Start_Region_Point[NEW_INTEGER] facing Default building facing degrees
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 2
                • Then - Actions
                  • Unit - Create 1 Rifleman for Player 1 (Red) at Start_Region_Point[NEW_INTEGER] facing Default building facing degrees
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 3
                • Then - Actions
                  • Unit - Create 1 Knight for Player 1 (Red) at Start_Region_Point[NEW_INTEGER] facing Default building facing degrees
                • Else - Actions
            • Else - Actions
 
Level 8
Joined
Jun 13, 2010
Messages
344
What part of it isnt working. I also dont see where the wave lvl variable is set witch may be your issue

I have not configured a level change set for my lvl integer. It is standard put to 1 to begin with and I will be changing it later as I make everything work out as it is supposed to. :)

This is what I changed in the trigger:

  • Start Area Gateway Waves
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Integer = 1
      • For each (Integer Integer) from 1 to Start_Region_Integer, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Start_Region_String[Integer] Equal to open
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 1
                • Then - Actions
                  • Unit - Create 1 Footman for Player 1 (Red) at Start_Region_Point[Integer] facing Default building facing degrees
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 2
                • Then - Actions
                  • Unit - Create 1 Rifleman for Player 1 (Red) at Start_Region_Point[Integer] facing Default building facing degrees
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_Level Equal to lvl 3
                • Then - Actions
                  • Unit - Create 1 Knight for Player 1 (Red) at Start_Region_Point[Integer] facing Default building facing degrees
                • Else - Actions
            • Else - Actions
 
Status
Not open for further replies.
Top