PDA

View Full Version : Hotseat players not considered seated



Jabrwock
03-12-2017, 11:55 AM
See http://www.berserk-games.com/forums/showthread.php?2321-Hotseat-players-not-considered-seated

getSeatedPlayers() returns all colours of active players in hotseat mode, but player.colour.seated is false for all except the player who's turn it is. this has apparently been broken since v7.2.

MrStump
06-13-2017, 01:49 PM
I recently did some testing using hotseat and getSeatedPlayers detected the seats. This must have been fixed at some point.

OnlyAnEgg
08-04-2017, 10:42 AM
This is not fixed.
getSeatedPlayers() correctly returns a table of the colors of the seated players in Hotseat.
However, that wasn't the bug report.
The bug is that Player.color.seated is false for all except the player who's turn it is in Hotseat mode.

You can directly observe this with the following code (attach it to a button)


function PlayerCount()
local players = getSeatedPlayers()
for i, color in ipairs(players) do
if(Player[color].seated == true) then
print(color .. " is listed as a seated player and Player[color].seated == true")
else
print(color .. " is listed as a seated player but Player[color].seated == false")
end
end
end

Flolania
08-05-2017, 01:36 AM
It makes some sense that only the seated player value is returning true because that is the only player playing atm. Hotseat mode is like you get up and then I sit down. I would say this is working as intended for hotseat. Maybe a better thing would be getConnectedPlayers()

OnlyAnEgg
08-08-2017, 05:38 PM
Intended behavior that breaks otherwise working scripts when used in Hotseat?
It's inconsistent with behavior from other modes. In regular multiplayer all players are considered "seated" and this flag returns true whether it is their turn or not.
If this is intended behavior then the flag should be renamed to Player.color.turn, and it should return false for all but one player in regular multiplayer as well.
As it is, it's unwise to use this flag in your scripts unless you don't care that the script does not work the way you intended when used in Hotseat Mode.

MrStump
08-08-2017, 08:46 PM
Are we sure getSeatedPlayers() is returning only the active player and not the other chosen hotseats? Because I've used it before in hotseat mode and not run into that behavior. It worked just like it would have if there were people seated in those seats.

OnlyAnEgg
08-10-2017, 07:10 PM
getSeatedPlayers() works fine, and it's actually how I got around the flag being wrong. Run the code I posted above with a few players in hotseat, and it will probably make sense.