• 🏆 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] How to detect Allied Victory

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
So I have a map that you can change teams throughout the game and it doesn't have the Wc Melee victory conditions enabled.

How do i detect who all has the Allied Victory checked and when the last one is checked? So everyone left in the game is a ally and no enemies are left.
 
Level 9
Joined
Jul 30, 2018
Messages
445
Make Player Groups for the teams, add and remove players to and from them according the alliances and then when a player leaves the game, check if all the other Player Groups are empty?
 
Level 13
Joined
Mar 24, 2010
Messages
950
Its a WW3 type map where alliances can change at any given time, so i dont want to just have it auto Ally vic after a last enemy is defeated because someone in that team may decide to go to war. So i dont want the game to end at least not until everyone checks the little allied victory checkbox and agrees they want to win together.

But i could maybe have a player group of players with that check box and add/remove players based on it being checked or not. But is there a event that detects players checking and unchecking that allied victory box in F11?
 
Level 9
Joined
Jul 30, 2018
Messages
445
I don't think there is a GUI equivalent, and I don't think there is an event for that, but you can check with a custom JASS script using GetPlayerState(whichPlayer, PLAYER_STATE_ALLIED_VICTORY) == 1.

Edit: Actually there is a GUI equivalent too: under a boolean condition there is Player - Player Flag Is On.
 
Last edited:
Status
Not open for further replies.
Top