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

MEGA BUG! Need help please!

Status
Not open for further replies.
Level 5
Joined
May 1, 2006
Messages
131
Ok, heres the deal. Im working on an arena type game and I have almost everything done except for some custom items and this DAMN trigger thats making my game screw up!
  • Actions
    • For each (Integer A) from 1 to 10, do (Set Kills[(Integer A)] = 0)
    • Leaderboard - Create a leaderboard for (All players) titled Kills
    • Wait 1.00 seconds
    • Set TheLeaderBoard = (Last created leaderboard)
    • Leaderboard - Add Neutral Hostile to (Last created leaderboard) with label Team 1 Kills and value 0
    • Leaderboard - Change the color of the label for Neutral Hostile in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
    • Leaderboard - Change the color of the value for Neutral Hostile in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
    • Player Group - Pick every player in Team1 and do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0)
    • Leaderboard - Add Neutral Passive to (Last created leaderboard) with label Team 2 Kills and value 0
    • Leaderboard - Change the color of the label for Neutral Passive in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
    • Leaderboard - Change the color of the value for Neutral Passive in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
    • Player Group - Pick every player in Team2 and do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0)
    • Leaderboard - Add Neutral Victim to (Last created leaderboard) with label (Win = + ((String(250)) + Team Kills)) and value 250
    • Leaderboard - Change the display style for Neutral Victim in (Last created leaderboard) to Show the label, Hide the value, and Hide the icon
    • Leaderboard - Change the color of the label for Neutral Victim in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
    • Trigger - Turn on Update Leaderboard <gen>
It runs the update!

  • Actions
    • Player Group - Pick every player in (All players) and do (Leaderboard - Change the value for (Picked player) in TheLeaderBoard to Kills[(Player number of (Picked player))])
    • Leaderboard - Change the value for Neutral Hostile in TheLeaderBoard to Team1Kills
    • Leaderboard - Change the value for Neutral Passive in TheLeaderBoard to Team2Kills
    • Trigger - Run Team 1 Win Game <gen> (checking conditions)
    • Trigger - Run Team 2 Win Game <gen> (checking conditions)
This runs the win game triggers!

TEAM1
  • Team 1 Win Game
    • Events
    • Conditions
      • Team1Kills Greater than or equal to 250
    • Actions
      • Sound - Stop music After fading
      • For each (Integer A) from 1 to 5, do (Unit - Move Heroes[(Integer A)] instantly to (Random point in WINNERS <gen>))
      • For each (Integer A) from 6 to 10, do (Unit - Move Heroes[(Integer A)] instantly to (Random point in LOSERS <gen>))
      • Player Group - Pick every player in (All players) and do (Camera - Pan camera for (Picked player) to (Center of GAME END <gen>) over 1.00 seconds)
      • Game - Display to (All players) the text: Team 1 Wins!
      • Leaderboard - Hide TheLeaderBoard
      • Countdown Timer - Hide DuelTimerWindow
      • Wait 1.00 seconds
      • For each (Integer A) from 6 to 10, do (Unit - Kill Heroes[(Integer A)])
      • Wait 5.00 seconds
      • Player Group - Pick every player in Team2 and do (Game - Defeat (Picked player) with the message: Your soul will burn...)
      • Player Group - Pick every player in Team1 and do (Game - Victory Player 1 (Red) (Show dialogs, Show scores))
      • Wait 1.00 seconds
      • Sound - Play UndeadDefeat <gen>
TEAM2
  • Team 2 Win Game
    • Events
    • Conditions
      • Team2Kills Greater than or equal to 250
    • Actions
      • Sound - Stop music After fading
      • For each (Integer A) from 6 to 10, do (Unit - Move Heroes[(Integer A)] instantly to (Random point in WINNERS <gen>))
      • For each (Integer A) from 1 to 5, do (Unit - Move Heroes[(Integer A)] instantly to (Random point in LOSERS <gen>))
      • Player Group - Pick every player in (All players) and do (Camera - Pan camera for (Picked player) to (Center of GAME END <gen>) over 1.00 seconds)
      • Game - Display to (All players) the text: Team 2 Wins!
      • Leaderboard - Hide TheLeaderBoard
      • Countdown Timer - Hide DuelTimerWindow
      • Wait 1.00 seconds
      • For each (Integer A) from 1 to 5, do (Unit - Kill Heroes[(Integer A)])
      • Wait 5.00 seconds
      • Player Group - Pick every player in Team1 and do (Game - Defeat (Picked player) with the message: Your soul will burn...)
      • Player Group - Pick every player in Team2 and do (Game - Victory (Picked player) (Show dialogs, Show scores))
      • Wait 1.00 seconds
      • Sound - Play UndeadDefeat <gen>
What the problem is is that right when i start the game.. It wont even create the leaderboard and it goes straight to "TEAM 2 WINS!"
And spams that for a while...

Anyone got an idea of whats wrong?
 
Level 3
Joined
Feb 24, 2008
Messages
67
Is the event of your first trigger "Map Initialization"? If it is, then no wonder it can't work, because leaderboard/multiboard cannot be displayed at map initialication.

Solution: Set the event in your first trigger as the "Game Time is 0.01 seconds" so that people won't notice the difference.

As for the Team 2 Wins bug, I have no idea how it happens, I need to see the full trigger (with events, condition and actions) to be sure of what happened to cause the trigger to malfunction.

Are you sure the the initial values of the two variables "Team1Kills" and "Team2Kills" are zero?
 
Level 5
Joined
May 1, 2006
Messages
131
Yeah, in the triggers i have them both starting as 0.. And once the game starts the damn leaderboard wont show up. And no i dont have the map initialization i deleted that first thing.
 
Level 3
Joined
Feb 24, 2008
Messages
67
  • Leaderboard - Create a leaderboard for (All players) titled Kills
  • Wait 1.00 seconds
  • Set TheLeaderBoard = (Last created leaderboard)
Put the wait somewhere else instead of between the leaderboard creation and the variable referring to it.
 
Level 5
Joined
May 1, 2006
Messages
131
OHH! So lets say.. Move it to after the creation of the variable? Nice, thank you very much for the help! :D
 
Level 11
Joined
Jun 21, 2007
Messages
505
But players in your game win only when their Kills reach 250. Leaderboard is used to just let players see how much kills they have.
And you can use event "Time - Elapsed game time becomes equal to 0.00" it works with no problems.
And you shouldn't use "Trigger - Turn Off" or "Trigger - Run", just add some events to the triggers such as "Unit - A unit dies"
  • Events:
    • Unit - A unit dies
  • Conditions:
  • Actions:
    • If ((Player number of (owner of (triggering unit))) less than or equal to 5) then do (set KillsOfTeam1 = (KillsOfTeam1 + 1)) else do (set KillsOfTeam2 = (KillsOfTeam2 + 1))
    • Set Kills[(Player number of (owner of (killing unit)))] = Kills[(Player number of (owner of (killing unit)))] + 1)
    • Change the value in TheLeaderboard for Player[(Player number of (owner of (killing unit)))] to Kills[[(Player number of (owner of (killing unit)))]
    • If (KillsOfTeam1 greater than or equal to 250) then do (Pick every player in (All Players, matching ((matching player is an ally of (Neutral Hostile)) and do (Player - win (picked player)) else do (If (KillsOfTeam2 greater than or equal to 250) then do (Pick every player in (All Players, matching ((matching player is an ally of (Neutral Passive)) and do (Player - win (picked player)) else do (Do nothing)
 
Status
Not open for further replies.
Top