Tabletop Simulator

Tabletop Simulator

Not enough ratings
Scripted Scoreboard
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
Tags: Misc, Templates
File Size
Posted
19.416 KB
Jul 17, 2016 @ 5:57am
1 Change Note ( view )

Subscribe to download
Scripted Scoreboard

Description
A scoreboard for up to 8 players. It is designed to replace the process of moving pieces around a track in order to keep score (ex. Ticket to Ride, Carcassonne, etc) with a simple to use scripted score tracker.

Simply activate it once the players are seated and it will create an entry for each one. To increase/decrease scores, click the player's name, then +/-, then =. It keeps the players ordered so the most points is listed in first place, second most points in second, etc. Make a mistake? Clicking the display will clear it out. Includes memory so that it works with undo/redo and save/load without issue.

Save a copy to your chest for use in your games. Enjoy, and as always, if any bugs are located, please make me aware of what happened so I can fix it.
13 Comments
gwalborn Feb 15, 2021 @ 2:32pm 
I have a possible bug report and a suggestion. First, when using the scoreboard with an Oculus Touch controller, pressing a number button on the keypad causes the number to repeat. It is practically impossible to get a single occurrence. So pressing 8 will give you 888 or 88888 or 88888. Also, it would help if there were a "back" (or "erase" or "delete") button that would erase a digit if you make a mistake.

Also, I'm new to Steam, so I'm not sure how to add this to my "chest". Is there some way that I can modify the code? I'd be interested in enhancing this tool. I'm a coder, but I'm very new to steam.

Thanks,
wally0623
Bish Jun 23, 2020 @ 5:53pm 
Hey pestilentpawnlogin, good work.

However if the current score is minus (-) and you try to subtract from it, it doesn't work as the string search finds the first minus symbol.
Any ideas as my game counts minus scores and plus scores?
pestilentpawnlogin Jun 15, 2020 @ 5:16pm 
Also, this line in function minus()

b_display.label = b_display.label .. ' + '

Should become this:

b_display.label = b_display.label .. ' - '
pestilentpawnlogin Jun 15, 2020 @ 5:15pm 
Becomes:

function enter()
if operator == 'add' then
local valueOld = b_standings[designatedPlayer].value
local s = b_display.label
local sn = string.find(s, '+')
local valueNew = string.sub(s, sn + 2, -1)
player_scores[designatedPlayer].score = valueOld + valueNew
updateScores()
elseif operator == 'subtract' then
local valueOld = b_standings[designatedPlayer].value
local s = b_display.label
local sn = string.find(s, '-')
local valueNew = string.sub(s, sn + 2, -1)
player_scores[designatedPlayer].score = valueOld - valueNew
updateScores()
end
end

There's probably better/neater ways but that'll work.
pestilentpawnlogin Jun 15, 2020 @ 5:14pm 
For Bane and Slipstream,

Split this chunk in two:

function enter()
if operator == 'add' or operator == 'subtract' then
local valueOld = b_standings[designatedPlayer].value
local s = b_display.label
local sn = string.find(s, '+')
local valueNew = string.sub(s, sn + 2, -1)
if operator == 'add' then
player_scores[designatedPlayer].score = valueOld + valueNew
elseif operator == 'subtract' then
player_scores[designatedPlayer].score = valueOld - valueNew
end
updateScores()
end
pestilentpawnlogin Jun 15, 2020 @ 5:11pm 
I know y'all have probably solved this for yourselves, but just in case anyone's having these same problems (I'm adapting this for my purposes so playing with the scrips)...

For tinnesaile, to color code the player's name insert this line:

b_standings .color = player_scores .color

or

b_standings .font_color = player_scores .color

between

b_standings .value = player_scores .score

and

self.editButton(b_standings ).
SkunkDave May 28, 2020 @ 10:18am 
I think this will work well for tracking how long each player gets the spotlight in d&d
Tryin not to leave anyone out
Bane / Imo May 13, 2020 @ 3:28pm 
Using the negative works but it shows a plus sign.
Hanniah (she/they) Jan 9, 2020 @ 9:33am 
Ignore the 2nd question, my bad
Hanniah (she/they) Jan 9, 2020 @ 9:32am 
Is this too long dead to get a version that color codes the player names, and can it read more players?