Tricky Trigger Problem

Leo

New Member
Reaction score
14
So I'm havign a trigger problem. My trigger runs when a certain king units die. The trigger forces the person whose king died into an alliance with the person who killed it. The trigger also compares the number of players who are playing and allied together with the total number of players playing, and if these 2 numbers are equal, the victory event runs.

The trigger works fine, if all players stay in the game, however if someone leaves after being conquered a problem occurs. For example if there are 4 players, here is what is supposed to happen. Player 1 kills player 2. They are now both allied, they then kill player 3, and player 3 joins their alliance. Finally, they kill player 4, and the victory event then runs.

However, say player 2 leaves the game after Player 1 conquers him, but before they conquer player 3, the victory event runs when player 1 kills player 3, even though player 4 is still alive (even though player 2 has left the game, he is still allied with player 1.

Any idea whats wrong with my trigger? The problem code is below

Code:
Player Group - Make (All allies of (Owner of (Triggering unit))) treat (All allies of (Owner of (Killing unit))) as an Ally with shared vision
Player Group - Make (All allies of (Owner of (Killing unit))) treat (All allies of (Owner of (Triggering unit))) as an Ally with shared vision
Set playergroup = (All allies of (Owner of (Killing unit)))
Set playergroup2 = (All players matching (((Matching player) slot status) Equal to Is playing))
Set playergroup3 = (All players matching ((((Matching player) is in playergroup) Equal to True) and (((Matching player) is in playergroup2) Equal to True)))
If ((Number of players in playergroup3) Equal to (Number of players in playergroup2)) then do (Player Group - Pick every player in playergroup and do (Game - Victory (Picked player) (Show dialogs, Show scores))) else do (Do nothing)
 

elmstfreddie

The Finglonger
Reaction score
203
Why 3 player groups, can't you just say...
Playergroup 1 = fine
Playergroup 2 = all players matching condition matching player is playing = true
If number of players in 2 = to 1, then win blah blah blah
 

Leo

New Member
Reaction score
14
It needs to be 3, the first group gets all the allies of the player, the 2nd gets the total number of players playing, the 3rd group is an AND function that is supposed to get the players who present in both of the 2 other groups.

If there are only 2 groups, it gets screwy if players leave the game because they are still counted in the ally count.
 

elmstfreddie

The Finglonger
Reaction score
203
K Sorry, I would be a lot more help if I wasn't so tired lol. If you still need help tomorrow, I'll try. Too tired to think things through straight.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top