Tabletop Simulator

Tabletop Simulator

Kingdom Death: Monster v1.5 + CE 2.0 (by KarateSnoopy)
Marky Mark  [developer] 31 Mar, 2020 @ 7:56am
Monster Attack feature not working with non-white players
I've looked into this error, and it's due to 'Spawn D10 Die' scripts, specifically to it trying to print the name of the active player.

There is a line of code "s = Player[color].steam_name", which is trying to get the steam name of the player who clicked the button.

However the 'Player[color]' function always defaults to white, and therefore always tries to return white player name. If there is no white player, this causes an error. I don't understand why Player[color] always returns white, and how to instead get the player who clicked the button, however in the meantime I've added a bit of code to disable the steam name retrieve if steam name is nil (ie if there is no white player).

This needs to be added to all spawn dice scripts (d5, d10, Hit Location), and any other script that references Player[color].steam_name.

--Player name
if Player[color].steam_name == nil then
setting.print.player = false
end

if setting.print.player == true then
s = Player[color].steam_name

if setting.print.individual==true or setting.print.total==true then
s = s .. " " .. string.char(9679) .. " "

end
end

Anyone have any idea as to Player[color].steam_name is always returning white?
< >
Showing 1-2 of 2 comments
zazas 31 Mar, 2020 @ 9:28am 
There is line in script:
--Turn on/off printing of the player who rolled (true or false)
setting.print.player = true

Setting this to false also fixes error although throws some error when loading.
Marky Mark  [developer] 31 Mar, 2020 @ 4:08pm 
I saw that, and that was my initial proposed solution, however my solution above allows the print player name to work for white player, and only disables it for other players. However, either solution will solve the issues of attack button not working for non-white players
< >
Showing 1-2 of 2 comments
Per page: 1530 50