Tabletop Simulator

Tabletop Simulator

Kingdom Death: Monster v1.5 + CE 2.0 (by KarateSnoopy)
Marky Mark  [开发者] 2020 年 3 月 31 日 上午 7:56
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?
< >
正在显示第 1 - 2 条,共 2 条留言
zazas 2020 年 3 月 31 日 上午 9:28 
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  [开发者] 2020 年 3 月 31 日 下午 4:08 
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
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50