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

End game trigger...

Status
Not open for further replies.
Level 9
Joined
Oct 6, 2007
Messages
406
Hi. I've made a map that's done, but the game won't end when I kill what I'm supposed to kill.

The game consists of 2 teams. Each team is trying to kill the other team's hero and their barracks. To win, all 3 total barrack's on that team (1 for each player, 3 players) must be destroyed, and all 3 hero's on that team must be dead (1 hero for each player, 3 players total)

I need someone to help me with this, cause I can't do this lol. And no, I don't have a game timer.

P.S. Yes, some of you might say "this should be in WE assistance" w/e it's called, but right now the "server is busy" so I've come here. This is a request anyways, so.......yeah :hohum:
 
Ok. This is how you do it.

  • Events
  • Unit X is killed
  • Conditions
  • Unit Y = Dead
  • Unit Z = Dead
  • Actions
  • Game- Victory for player X
  • Game- Victory for player y
(And list the team all the way down)

What you would have to do is to make a kill variable, so when you kill someone, it will load them with the variable. Once all variables are full, then you win.
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
You don't request help in world editor issues in the requests forum. Don't take the word 'request' as in request whatever you want. Read the forum description and the sticky threads first.

Moved to wehz.
 
Level 6
Joined
Jun 30, 2006
Messages
230
Okay, I'm having a similar problem. I'm converting all my spells from JASS to GUI (I have reasons you probably won't understand, so please don't ask), and when I recreated my trigger in GUI, it doesn't work. I am assuming I am missing something, but I cannot see what it is. My code:
  • VictoryAndDefeat
    • Events
      • Unit - Heart of Alliance 0041 <gen> Dies
      • Unit - Heart of Horde 0042 <gen> Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Heart of Alliance 0041 <gen>
        • Then - Actions
          • Player Group - Pick every player in Horde and do (Actions)
            • Loop - Actions
              • Custom script: local string PlayerColor = GetPlayerColourTag(GetEnumPlayer())
              • Custom script: if (IsPlayerInForce(GetLocalPlayer(), udg_Horde)) then
              • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8, PlayerColor + "You have achieved victory!|r")
              • Custom script: endif
              • Wait 3.00 seconds
              • Custom script: set PlayerColor = ""
              • Game - Victory (Picked player) (Show dialogs, Show scores)
          • Player Group - Pick every player in Alliance and do (Actions)
            • Loop - Actions
              • Custom script: local string PlayerColor = GetPlayerColourTag(GetEnumPlayer())
              • Wait 3.00 seconds
              • Custom script: call CustomDefeatBJ( GetEnumPlayer(), ( PlayerColor + "You have failed to achieve victory!|r" ) )
              • Custom script: set PlayerColor = ""
        • Else - Actions
          • Player Group - Pick every player in Horde and do (Actions)
            • Loop - Actions
              • Custom script: local string PlayerColor = GetPlayerColourTag(GetEnumPlayer())
              • Wait 3.00 seconds
              • Custom script: call CustomDefeatBJ( GetEnumPlayer(), ( PlayerColor + "You have failed to achieve victory!|r" ) )
              • Custom script: set PlayerColor = ""
          • Player Group - Pick every player in Alliance and do (Actions)
            • Loop - Actions
              • Custom script: local string PlayerColor = GetPlayerColourTag(GetEnumPlayer())
              • Custom script: //if (IsPlayerInForce(GetLocalPlayer(), udg_Alliance)) then
              • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8, PlayerColor + "You have achieved victory!|r")
              • Custom script: //endif
              • Wait 3.00 seconds
              • Custom script: set PlayerColor = ""
              • Game - Victory (Picked player) (Show dialogs, Show scores)
And yes, I do realize that most of it is custom script. It didn't start out that way, I had it all GUI stuff and then I wanted to do this and that and this and that... Kind of just happened. Also, the second time I test whether a player is in a force, the if and endif are commented out. I am guessing that if you say "Pick every player in Alliance" and then inside those actions, you say GetLocalPlayer(), then it should only trigger if you are in that group. I'm pretty sure that is the case, could someone verify it? If it works like I think it does, then I can get rid of more code.

Can anyone see what I've done wrong?
Edit1: It might be helpful to know that the proper text is displayed for each possible condition, it just doesn't end the game.
Edit2: I have figured out that it is the wait that causes it to fail. I want a 3 second delay, though. Any ideas?
 
Last edited:
Status
Not open for further replies.
Top