Hi guys, I've set up the following script to control victory conditions in an evolves map I wrote. There is a separate trigger for each player's victory, this is the one for player 1. What happens is that when a player LOSES, the dialog will spam "playerblah was victorious!" hundreds of times until the player actually leaves the map. The trigger for losing does not appear to be faulty, as it is saying they were defeated and THEN the victory trigger spams.
So anyway, the code is below. It's pretty self-explanatory, but I can explain it if it's needed. The issue is slightly complicated by the fact that the map can be played either ffa or 2v2. So, it needs to account for allies possibly still being alive. Thanks for any help.
Your script confuses me a little bit. It's the "not equal" and so on, that messes my mind up, in any language... Inspecting your code now, meanwhile, can you take a look at below? I wonder if it would work with your map or not.
Events
Game - Map initialization
Player - Player Any Player leaves the game with Any
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Number of players in (Active Players)) == 1
Then
Game - End game in Victory for player (Player 1 from (Active Players)) (Show dialogs, Show score screen)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
(Number of players in (Active Players)) == 2
(Player (Player 1 from (Active Players)) treats player (Player 2 from (Active Players)) as Ally) == true
Then
Game - End game in Victory for player (Player 1 from (Active Players)) (Show dialogs, Show score screen)
Game - End game in Victory for player (Player 2 from (Active Players)) (Show dialogs, Show score screen)
Else
Hi guys, I've set up the following script to control victory conditions in an evolves map I wrote. There is a separate trigger for each player's victory, this is the one for player 1. What happens is that when a player LOSES, the dialog will spam "playerblah was victorious!" hundreds of times until the player actually leaves the map. The trigger for losing does not appear to be faulty, as it is saying they were defeated and THEN the victory trigger spams.
So anyway, the code is below. It's pretty self-explanatory, but I can explain it if it's needed. The issue is slightly complicated by the fact that the map can be played either ffa or 2v2. So, it needs to account for allies possibly still being alive. Thanks for any help.
edit: nvm i realized i messed up
Hm I wouldn't know what's wrong with that script snippet.
Maybe post the map so we can take a closer look at the issue.
Your script confuses me a little bit. It's the "not equal" and so on, that messes my mind up, in any language... Inspecting your code now, meanwhile, can you take a look at below? I wonder if it would work with your map or not.
Events
Game - Map initialization
Player - Player Any Player leaves the game with Any
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Number of players in (Active Players)) == 1
Then
Game - End game in Victory for player (Player 1 from (Active Players)) (Show dialogs, Show score screen)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
(Number of players in (Active Players)) == 2
(Player (Player 1 from (Active Players)) treats player (Player 2 from (Active Players)) as Ally) == true
Then
Game - End game in Victory for player (Player 1 from (Active Players)) (Show dialogs, Show score screen)
Game - End game in Victory for player (Player 2 from (Active Players)) (Show dialogs, Show score screen)
Else
Good job digging out an almost 3-weeks old topic.
It doesn't matter if I dig up an old topic or not, maybe it'll help some other people, no?
Forum nazi alert!