• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

help for tower defence

Status
Not open for further replies.
Level 2
Joined
Apr 4, 2023
Messages
4
Hello everyone

I'm a big novice, you could say I'm touching the world editor for the first time.
But I'm determined to do my tower defense as I imagine a Burbenog, Spiral Defense and Green td, all mixed with some addition I have in mind.

I'm already stuck with the spawn monsters of course my start red region, the problem is that I'd like it to spawn on start blue teal and purple too even if the players didn't join the game or left it later

here is the template i use Custom Tower TD uncle
if you have an idea thank you so much
 
Last edited:
Level 2
Joined
Apr 4, 2023
Messages
4
  • SETUP Game
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- CONFIGURE: --------
      • -------- It's important that you wait 1.00 second before working with Players/Player Groups, this gives the needed time for all players to have properly loaded into the game. --------
      • -------- That's why I use the Elapsed game time Event. For most other things it's safe to use the Map Initialization Event. --------
      • -------- Note: The order of these Actions is very important and things may break if you move them around. --------
      • -------- --------
      • -------- --------
      • -------- PLAYERS: --------
      • -------- Find all of the active Users (Players) and add them to the Users Player Group, this will make it easy to keep track of them: --------
      • -------- This is also a good time to do anything Player related inside the Player Group. --------
      • 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 VariableSet PN = (Player number of (Picked player))
              • Player Group - Add (Picked player) to Users_PG
              • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Playable map area)
              • -------- --------
              • -------- STARTING LIVES: --------
              • Set VariableSet Player_Lives[PN] = 100
            • Else - Actions
      • -------- --------
      • -------- Create and store the Move Regions for our Players (This also creates the Spawn_Hashtable): --------
      • Trigger - Run SETUP Move Regions <gen> (ignoring conditions)
      • -------- --------
      • -------- Keep track of our Player's Bases and Areas: --------
      • Set VariableSet Player_Base[1] = gg_unit_h001_0007
      • Set VariableSet Player_Base[2] = gg_unit_h001_0008
      • Set VariableSet Player_Base[3] = gg_unit_h001_0007
      • Set VariableSet Player_Base[4] = gg_unit_h001_0007
      • Set VariableSet Player_Base[5] = gg_unit_h001_0007
      • Set VariableSet Player_Base[6] = gg_unit_h001_0007
      • Set VariableSet Player_Area[1] = Area P1 <gen>
      • Set VariableSet Player_Area[2] = gg_rct_P2Area
      • Set VariableSet Player_Area[3] = gg_rct_P1Area
      • Set VariableSet Player_Area[4] = gg_rct_P1Area
      • Set VariableSet Player_Area[5] = gg_rct_P1Area
      • Set VariableSet Player_Area[6] = gg_rct_P1Area
      • -------- --------
      • -------- --------
      • -------- COMPUTERS: --------
      • -------- This determines who our Computer Players will be. I'm using Players 12 - 24 as Computers: --------
      • Set VariableSet Computer_Start = 12
      • Set VariableSet Computer_End = 24
      • -------- --------
      • -------- Add these Computers to our Computer Player Group so we can easily keep track of them: --------
      • -------- This is also a good time to do anything Computer related since we will loop through these players. --------
      • For each (Integer CN) from Computer_Start to Computer_End, do (Actions)
        • Loop - Actions
          • -------- Computers[CN] = The computer player --------
          • Set VariableSet Computers[CN] = (Player(CN))
          • Player Group - Add Computers[CN] to Computers_PG
          • Player - Change color of Computers[CN] to Green, Changing color of existing units
          • Player - Set name of Computers[CN] to Wave
          • Player - Turn Gives bounty On for Computers[CN]
      • Set VariableSet CN = Computer_Start
      • -------- --------
      • -------- Make these Computer Players are allies with one another (probably not necessary): --------
      • Player Group - Make Computers_PG treat Computers_PG as an Ally with shared vision
      • -------- --------
      • -------- --------
      • -------- OTHER: --------
      • -------- We were using Wave_Level in our Setup Waves trigger, so we need to reset it back to 0 since we will be reusing it later on: --------
      • Set VariableSet Wave_Level = 0
      • -------- --------
      • -------- The duration of Wave_Start_Text and Wave_End_Text (they're optional): --------
      • Set VariableSet Wave_Text_Duration = 10.00
      • -------- --------
      • -------- --------
      • -------- START WAVE 1: --------
      • -------- Here we can start our first wave. After this the system will handle spawning units for the rest of the game: --------
      • Wait 2.00 seconds
      • Trigger - Run Start Next Wave <gen> (ignoring conditions)
  • SETUP Move Regions
    • Events
    • Conditions
    • Actions
      • -------- We're going to create a Hashtable that will keep track of a lot of important information regarding Wave Spawns: --------
      • Hashtable - Create a hashtable
      • Set VariableSet Spawn_Hashtable = (Last created hashtable)
      • -------- --------
      • -------- CONFIGURE: --------
      • -------- Set PN to the Player's Number and adjust their Move Regions: --------
      • -------- --------
      • -------- Player 1 --------
      • Set VariableSet PN = 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player(PN)) is in Users_PG.) Equal to Vrai
        • Then - Actions
          • -------- Set this to the total number of Move Regions this player has: --------
          • Set VariableSet Move_Total_Regions = 54
          • -------- --------
          • Set VariableSet Move_Region[1] = Start Red <gen>
          • Set VariableSet Move_Region[2] = 01 <gen>
          • Set VariableSet Move_Region[3] = 02 <gen>
          • Set VariableSet Move_Region[4] = 03 <gen>
          • Set VariableSet Move_Region[5] = 04 <gen>
          • Set VariableSet Move_Region[6] = 05 <gen>
          • Set VariableSet Move_Region[7] = 06 <gen>
          • Set VariableSet Move_Region[8] = 07 <gen>
          • Set VariableSet Move_Region[9] = 08 <gen>
          • Set VariableSet Move_Region[10] = 09 <gen>
          • Set VariableSet Move_Region[11] = 10 <gen>
          • Set VariableSet Move_Region[12] = 11 <gen>
          • Set VariableSet Move_Region[13] = 12 <gen>
          • Set VariableSet Move_Region[14] = 13 <gen>
          • Set VariableSet Move_Region[15] = 14 <gen>
          • Set VariableSet Move_Region[16] = 15 <gen>
          • Set VariableSet Move_Region[17] = 16 <gen>
          • Set VariableSet Move_Region[18] = 17 <gen>
          • Set VariableSet Move_Region[19] = 18 <gen>
          • Set VariableSet Move_Region[20] = 19 <gen>
          • Set VariableSet Move_Region[21] = 20 <gen>
          • Set VariableSet Move_Region[22] = 21 <gen>
          • Set VariableSet Move_Region[23] = 22 <gen>
          • Set VariableSet Move_Region[24] = 23 <gen>
          • Set VariableSet Move_Region[25] = 24 <gen>
          • Set VariableSet Move_Region[26] = 25 <gen>
          • Set VariableSet Move_Region[27] = 26 <gen>
          • Set VariableSet Move_Region[28] = 27 <gen>
          • Set VariableSet Move_Region[29] = 28 <gen>
          • Set VariableSet Move_Region[30] = 29 <gen>
          • Set VariableSet Move_Region[31] = 30 <gen>
          • Set VariableSet Move_Region[32] = 31 <gen>
          • Set VariableSet Move_Region[33] = 32 <gen>
          • Set VariableSet Move_Region[34] = 33 <gen>
          • Set VariableSet Move_Region[35] = 34 <gen>
          • Set VariableSet Move_Region[36] = 35 <gen>
          • Set VariableSet Move_Region[37] = 36 <gen>
          • Set VariableSet Move_Region[38] = 37 <gen>
          • Set VariableSet Move_Region[39] = 38 <gen>
          • Set VariableSet Move_Region[40] = 39 <gen>
          • Set VariableSet Move_Region[41] = 40 <gen>
          • Set VariableSet Move_Region[42] = 41 <gen>
          • Set VariableSet Move_Region[43] = 42 <gen>
          • Set VariableSet Move_Region[44] = 43 <gen>
          • Set VariableSet Move_Region[45] = 44 <gen>
          • Set VariableSet Move_Region[46] = Coin HG 01 <gen>
          • Set VariableSet Move_Region[47] = Coin HG 02 <gen>
          • Set VariableSet Move_Region[48] = Centre 01 <gen>
          • Set VariableSet Move_Region[49] = Centre 02 <gen>
          • Set VariableSet Move_Region[50] = Centre 03 <gen>
          • Set VariableSet Move_Region[51] = Centre 04 <gen>
          • Set VariableSet Move_Region[52] = Centre HG 01 <gen>
          • Set VariableSet Move_Region[53] = Centre HG 02 <gen>
          • Set VariableSet Move_Region[54] = Kill End <gen>
          • -------- --------
          • -------- This will automatically create Points at each Move Region and store them in the Hashtable for later use: --------
          • For each (Integer Loop) from 1 to Move_Total_Regions, do (Actions)
            • Loop - Actions
              • Set VariableSet Move_Point_Index = (Move_Point_Index + 1)
              • Set VariableSet Move_Point[Move_Point_Index] = (Center of Move_Region[Loop])
              • Hashtable - Save Handle OfMove_Point[Move_Point_Index] as Loop of PN in Spawn_Hashtable.
        • Else - Actions
      • -------- --------
      • -------- Player 2 --------
      • Set VariableSet PN = 2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player(PN)) is in Users_PG.) Equal to Vrai
        • Then - Actions
          • -------- Set this to the total number of Move Regions this player has: --------
          • Set VariableSet Move_Total_Regions = 54
          • -------- --------
          • Set VariableSet Move_Region[1] = Start Bleu <gen>
          • Set VariableSet Move_Region[2] = 12 <gen>
          • Set VariableSet Move_Region[3] = 13 <gen>
          • Set VariableSet Move_Region[4] = 14 <gen>
          • Set VariableSet Move_Region[5] = 15 <gen>
          • Set VariableSet Move_Region[6] = 16 <gen>
          • Set VariableSet Move_Region[7] = 17 <gen>
          • Set VariableSet Move_Region[8] = Kill End <gen>
          • -------- --------
          • -------- This will automatically create Points at each Move Region and store them in the Hashtable for later use: --------
          • For each (Integer Loop) from 1 to Move_Total_Regions, do (Actions)
            • Loop - Actions
              • Set VariableSet Move_Point_Index = (Move_Point_Index + 1)
              • Set VariableSet Move_Point[Move_Point_Index] = (Center of Move_Region[Loop])
              • Hashtable - Save Handle OfMove_Point[Move_Point_Index] as Loop of PN in Spawn_Hashtable.
        • Else - Actions
      • -------- --------
      • -------- Player 3, etc... --------
  • SETUP Waves
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- === Required Variables === --------
      • -------- Wave_Level = Set this to the desired Wave Level. --------
      • -------- Wave_Unit = The unit that will spawn. --------
      • -------- Wave_Count = The number of units that will spawn in total. --------
      • -------- Wave_Interval = The interval between spawning another unit. --------
      • -------- Wave_Start_Delay = After the last unit has spawned for a wave, this is how long until the next wave starts. --------
      • -------- Wave_Lives_Lost = How many lives the player will lose when the unit reaches the end. --------
      • -------- --------
      • -------- === Optional Variables === --------
      • -------- Wave_Start_Text = The text that appears when a wave starts. (Optional) --------
      • -------- Wave_End_Text = The text that appears at the end of a wave. (Optional) --------
      • -------- Wave_Start_Trigger = A trigger that will run when a wave starts. (Optional) --------
      • -------- Wave_End_Trigger = A trigger that will run when a wave ends. (Optional) --------
      • -------- --------
      • -------- Note: If you don't set Wave_Count, Wave_Interval, Wave_Lives_Lost, and/or Wave_Start_Delay then their DEFAULT values will be used. --------
      • -------- DEFAULT values are determined in the Variable Editor. Press Control + B to open it. (There's a bug when editing variables outside of the variable editor so don't do that) --------
      • -------- --------
      • -------- Wave Configuration: --------
      • Set VariableSet Wave_Level = 1
      • Set VariableSet Wave_Unit[Wave_Level] = Wave 1
      • Set VariableSet Wave_Count[Wave_Level] = 10
      • Set VariableSet Wave_Interval[Wave_Level] = 0.25
      • Set VariableSet Wave_Start_Delay[Wave_Level] = 5.00
      • Set VariableSet Wave_Lives_Lost[Wave_Level] = 1
      • -------- --------
      • Set VariableSet Wave_Level = 2
      • Set VariableSet Wave_Unit[Wave_Level] = Wave 1
      • Set VariableSet Wave_Count[Wave_Level] = 10
      • Set VariableSet Wave_Interval[Wave_Level] = 0.25
      • Set VariableSet Wave_Start_Delay[Wave_Level] = 5.00
      • Set VariableSet Wave_Lives_Lost[Wave_Level] = 1
      • -------- --------
      • Set VariableSet Wave_Level = 3
      • Set VariableSet Wave_Unit[Wave_Level] = Cerf
      • Set VariableSet Wave_Count[Wave_Level] = 10
      • Set VariableSet Wave_Interval[Wave_Level] = 0.25
      • Set VariableSet Wave_Start_Delay[Wave_Level] = 5.00
      • Set VariableSet Wave_Lives_Lost[Wave_Level] = 1
  • Start Next Wave
    • Events
      • Time - SpawnStart_Timer expires
    • Conditions
    • Actions
      • -------- This is a new wave so we want to reset the counter which keeps track of how many units we have spawned so far: --------
      • Set VariableSet Spawn_Count = 0
      • -------- --------
      • -------- Then we want to increase the Wave Level, which will change the values of our Wave Variables: --------
      • Set VariableSet Wave_Level = (Wave_Level + 1)
      • -------- --------
      • -------- If you have set Wave_StartText for this Level then a message will be displayed: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Start_Text[Wave_Level] Not equal to (null)
        • Then - Actions
          • Game - Display to (All players) for Wave_Text_Duration seconds the text: Wave_Start_Text[Wave_Level]
        • Else - Actions
      • -------- --------
      • -------- If you have set Wave_StartTrigger for this Level then that trigger will run: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Start_Trigger[Wave_Level] Not equal to Wave_Start_Trigger[0]
        • Then - Actions
          • Trigger - Run Wave_Start_Trigger[Wave_Level] (ignoring conditions)
        • Else - Actions
      • -------- --------
      • -------- Then start a repeating timer which will spawn units every X seconds: --------
      • Countdown Timer - Start Spawn_Timer as a Repeating timer that will expire in Wave_Interval[Wave_Level] seconds
  • Spawn Wave Units
    • Events
      • Time - Spawn_Timer expires
    • Conditions
    • Actions
      • -------- First we're going to determine which Computer Player we should spawn the next unit for (CN = Computer Number): --------
      • Set VariableSet Spawn_Player = Computers[CN]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CN Less than Computer_End
        • Then - Actions
          • Set VariableSet CN = (CN + 1)
        • Else - Actions
          • Set VariableSet CN = Computer_Start
      • -------- --------
      • -------- --------
      • -------- Next we're going to loop through all of our active Users (Players) and spawn a unit in their area: --------
      • Player Group - Pick every player in Users_PG and do (Actions)
        • Loop - Actions
          • -------- Player Number: --------
          • Set VariableSet PN = (Player number of (Picked player))
          • -------- --------
          • -------- Create the spawned unit at the Player's first region: --------
          • Unit - Create 1 Wave_Unit[Wave_Level] for Spawn_Player at (Load 1 of PN in Spawn_Hashtable.) facing Default building facing degrees
          • Unit - Turn collision for (Last created unit) Off.
          • -------- --------
          • -------- Hashtable Child 0 = The spawned unit's next destination. --------
          • -------- Hashtable Child 1 = The spawned unit's lives removed. --------
          • -------- Hashtable Child 2 = The Player Number that this spawn belongs to (1 = Player 1) --------
          • Hashtable - Save 2 as 0 of (Key (Last created unit).) in Spawn_Hashtable.
          • Hashtable - Save Wave_Lives_Lost[Wave_Level] as 1 of (Key (Last created unit).) in Spawn_Hashtable.
          • Hashtable - Save PN as 2 of (Key (Last created unit).) in Spawn_Hashtable.
          • -------- --------
          • -------- Order the spawned unit to move to the Player's second region: --------
          • Unit - Order (Last created unit) to Move To (Load 2 of PN in Spawn_Hashtable.)
      • -------- --------
      • -------- --------
      • -------- We want to keep track of how many units we have spawned so far in this current wave: --------
      • Set VariableSet Spawn_Count = (Spawn_Count + 1)
      • -------- --------
      • -------- --------
      • -------- Now check if you've spawned the maximum number of units for this wave: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Spawn_Count Equal to Wave_Count[Wave_Level]
        • Then - Actions
          • -------- Pause this timer preventing units from spawning: --------
          • Countdown Timer - Pause Spawn_Timer
          • -------- --------
          • -------- Begin the next wave after a delay: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wave_Count[(Wave_Level + 1)] Not equal to 0
            • Then - Actions
              • -------- Begin the next wave after a delay: --------
              • Countdown Timer - Start SpawnStart_Timer as a One-shot timer that will expire in Wave_Start_Delay[Wave_Level] seconds
              • -------- --------
              • -------- If you have set Wave_EndText for this Level then a message will be displayed: --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_End_Text[Wave_Level] Not equal to (null)
                • Then - Actions
                  • Game - Display to (All players) for Wave_Text_Duration seconds the text: Wave_End_Text[Wave_Level]
                • Else - Actions
              • -------- --------
              • -------- If you have set Wave_EndTrigger for this Level then that trigger will run: --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_End_Trigger[Wave_Level] Not equal to Wave_End_Trigger[0]
                • Then - Actions
                  • Trigger - Run Wave_End_Trigger[Wave_Level] (ignoring conditions)
                • Else - Actions
            • Else - Actions
              • -------- There are no more waves, from here you could begin preparing the players for the end of the game --------
        • Else - Actions
  • Spawn Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Unknown (A000) for (Triggering unit)) Equal to 1
    • Actions
      • -------- This clears the unit's information from the Hashtable: --------
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit).) in Spawn_Hashtable.
I can't get the mobs to spawn on the start blue teal and purple regions when player is not in game
i am sure is so easy for some people but for me is hard (this is the last thing I need )
Or maybe the template not good for what i want
 
Status
Not open for further replies.
Top