M
Magus
Guest
I'm making a new TD for 4 players, but I want people to be able to play it with less than 4 players as well. So I'm doing triggers to disable creep spawn and stuff for players that are not playing. That I can do without a problem. I've created a trigger that checks if people are playing, and it changes variables accordingly.
The problem is that when I test the map, Player 2 is detected as "Is playing", even though he isn't. P1, P2, P3 and P4 is set to "User" in Player Properties.
This is my trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 1 (Red) slot status) Equal to Is playing
Then - Actions
Set player1 = True
Set playernumber = (playernumber + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 2 (Blue) slot status) Equal to Is playing
Then - Actions
Set player2 = True
Set playernumber = (playernumber + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 3 (Teal) slot status) Equal to Is playing
Then - Actions
Set player3 = True
Set playernumber = (playernumber + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 4 (Purple) slot status) Equal to Is playing
Then - Actions
Set player4 = True
Set playernumber = (playernumber + 1)
Else - Actions
Do nothing
If (player1 Equal to True) then do (Game - Display to (All players) for 5.00 seconds the text: Player 1 is playing!) else do (Do nothing)
If (player2 Equal to True) then do (Game - Display to (All players) for 5.00 seconds the text: Player 2 is playing!) else do (Do nothing)
If (player3 Equal to True) then do (Game - Display to (All players) for 5.00 seconds the text: Player 3 is playing!) else do (Do nothing)
If (player4 Equal to True) then do (Game - Display to (All players) for 5.00 seconds the text: Player 4 is playing!) else do (Do nothing)
The playernumber variable is just to check how many players there are. And the last four triggers are just so I can check which players are detected as "Is playing". All triggers have their inital value set to "False". I know I could've just skipped all these variables and just used the Slot Status condition, but I think it's better to work with variables.
So I'm just wondering why Player 2 is detected as "Is playing", when he clearly shouldn't be.
The problem is that when I test the map, Player 2 is detected as "Is playing", even though he isn't. P1, P2, P3 and P4 is set to "User" in Player Properties.
This is my trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 1 (Red) slot status) Equal to Is playing
Then - Actions
Set player1 = True
Set playernumber = (playernumber + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 2 (Blue) slot status) Equal to Is playing
Then - Actions
Set player2 = True
Set playernumber = (playernumber + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 3 (Teal) slot status) Equal to Is playing
Then - Actions
Set player3 = True
Set playernumber = (playernumber + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 4 (Purple) slot status) Equal to Is playing
Then - Actions
Set player4 = True
Set playernumber = (playernumber + 1)
Else - Actions
Do nothing
If (player1 Equal to True) then do (Game - Display to (All players) for 5.00 seconds the text: Player 1 is playing!) else do (Do nothing)
If (player2 Equal to True) then do (Game - Display to (All players) for 5.00 seconds the text: Player 2 is playing!) else do (Do nothing)
If (player3 Equal to True) then do (Game - Display to (All players) for 5.00 seconds the text: Player 3 is playing!) else do (Do nothing)
If (player4 Equal to True) then do (Game - Display to (All players) for 5.00 seconds the text: Player 4 is playing!) else do (Do nothing)
The playernumber variable is just to check how many players there are. And the last four triggers are just so I can check which players are detected as "Is playing". All triggers have their inital value set to "False". I know I could've just skipped all these variables and just used the Slot Status condition, but I think it's better to work with variables.
So I'm just wondering why Player 2 is detected as "Is playing", when he clearly shouldn't be.


