• 🏆 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!

PLEASE HELP! (TD Spawn system)

Status
Not open for further replies.
Level 5
Joined
Jan 23, 2020
Messages
86
I have been at this spawn system for two weeks now. I think I'm going to go mad...

I've got it to work to the point where if there are 0 units from X unit group in the map for X player number. THEN spawn next wave for that picked player.

PROBLEM: if the player leaks. They don't get their next spawn...

Next level trigger:

  • Levels Players
    • Events
      • Time - WaveTimer[1] expires
      • Time - WaveTimer[2] expires
      • Time - WaveTimer[3] expires
      • Time - WaveTimer[4] expires
      • Time - WaveTimer[5] expires
      • Time - WaveTimer[6] expires
      • Time - WaveTimer[7] expires
    • Conditions
    • Actions
      • Player Group - Pick every player in HumanPlayers[(Player number of (Picked player))] and do (Actions)
        • Loop - Actions
          • Set VariableSet Level_Number[(Player number of (Picked player))] = (Level_Number[(Player number of (Picked player))] + 1)
          • Player - Add (5 x Level_Number[(Player number of (Picked player))]) to (Picked player).Current gold
          • Multiboard - Set the text for MultiBoard item in column 3, row ((Player number of (Picked player)) + 2) to (String(Level_Number[(Player number of (Picked player))]))
          • Game - Display to HumanPlayers[(Player number of (Picked player))] for 12.00 seconds the text: (Round bonus: |cffffff00 + ((String((5 x Level_Number[(Player number of (Picked player))]))) + Gold|r))
          • Game - Display to (All players matching (Players_Active[(Player number of (Picked player))] Equal to True).) for 12.00 seconds the text: LevelText[Level_Number[(Player number of (Picked player))]]
          • Game - Display to (All players matching (Players_Active[(Player number of (Picked player))] Equal to True).) for 12.00 seconds the text: LevelTextNext[Level_Number[(Player number of (Picked player))]]
          • Set VariableSet RoundOver[(Player number of (Picked player))] = False

Leak trigger:

  • Leak Players
    • Events
      • Unit - A unit enters EndPoint <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Player Group - Pick every player in HumanPlayers[(Player number of (Picked player))] and do (Actions)
        • Loop - Actions
          • -------- NORMAL --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is in PlayerLaneUnits[(Player number of (Picked player))].) Equal to True
            • Then - Actions
              • Set VariableSet AllLives[(Player number of (Picked player))] = (AllLives[(Player number of (Picked player))] - 1)
              • Game - Display to (All players) for 2.00 seconds the text: (|cffff0000Oops|r + ((String(AllLives[(Player number of (Picked player))])) + (( chances for + Color_Text[(Player number of (Picked player))]) + (Name of (Picked player)))))
              • Sound - Play QuestFailed <gen> at 30.00% volume, attached to (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Kill (Triggering unit)
            • Else - Actions
          • -------- BONUS --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is in (Units of type Golden Coin - BONUS lvl 30).) Equal to True
              • ((Triggering unit) is in (Units of type Golden Coin - BONUS lvl 49).) Equal to True
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Kill (Triggering unit)
            • Else - Actions
          • -------- BOSS -10 lives --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is Undead) Equal to True
              • ((Triggering unit) is in PlayerLaneUnits[(Player number of (Picked player))].) Equal to True
            • Then - Actions
              • Set VariableSet AllLives[(Player number of (Picked player))] = (AllLives[(Player number of (Picked player))] - 10)
              • Set VariableSet Multiboard_Spots[(Multiboard_Spots[(Player number of (Picked player))] + 2)] = List
              • Multiboard - Set the text for MultiBoard item in column 4, row List to (String(AllLives[(Player number of (Picked player))]))
              • Game - Display to (All players) for 2.00 seconds the text: (|cffff0000Oops|r + ((String(AllLives[(Player number of (Picked player))])) + (( chances for + Color_Text[(Player number of (Picked player))]) + (Name of (Picked player)))))
              • Sound - Play QuestFailed <gen> at 50.00% volume, attached to (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Kill (Triggering unit)
            • Else - Actions
          • -------- BOSS -5 lives --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is An Ancient) Equal to True
              • ((Triggering unit) is in PlayerLaneUnits[(Player number of (Picked player))].) Equal to True
            • Then - Actions
              • Set VariableSet AllLives[(Player number of (Picked player))] = (AllLives[(Player number of (Picked player))] - 5)
              • Set VariableSet Multiboard_Spots[(Multiboard_Spots[(Player number of (Picked player))] + 2)] = List
              • Multiboard - Set the text for MultiBoard item in column 4, row List to (String(AllLives[(Player number of (Picked player))]))
              • Game - Display to (All players) for 2.00 seconds the text: (|cffff0000Oops|r + ((String(AllLives[(Player number of (Picked player))])) + (( chances for + Color_Text[(Player number of (Picked player))]) + (Name of (Picked player)))))
              • Sound - Play QuestFailed <gen> at 30.00% volume, attached to (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Kill (Triggering unit)
            • Else - Actions
 
Level 5
Joined
Jan 23, 2020
Messages
86
How do I get these two to communicate?
full
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
It looks like it should work fine. Does the rest of the Wave Trigger work? One way to debug this is create a text message and have it display the value of List in your Multiboard trigger and do the same thing for the value of Multiboard_levels in your Wave trigger. This way you can see if they match.

Also, you can display those 3 text message to the Picked Player instead of "All players matching...", use Convert Player To Player Group to do so.
  • Game - Display to (Player group((Picked player))) for 30.00 seconds the text: blah blah blah
And maybe go through and replace all instances of (Last created multiboard) with your MultiBoard variable.

And a small tip, if you're using (Player number of a player) a lot, use an Integer variable to make your life easier:
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Set VariableSet PN = (Player number of (Picked player))
        • Set VariableSet Level_Number[PN] = (Level_Number[PN] + 1)
        • Set VariableSet Round_Over[PN] = True
Just something I do to help keep things clean and easier to manage.

Another thing, what's the deal with the 7 Wave Timers? That trigger will run for ALL HumanPlayers each time ANY of those 7 Timers goes off.
 
Last edited:
Status
Not open for further replies.
Top