Tabletop Simulator

Tabletop Simulator

Pathfinder Scripted Dice Roller v2.0
13 Comments
Niki 15 Jun, 2020 @ 2:29am 
I've re-uploaded a version of this wonderful calculator with a more random seed generation (using lua math.random () instead of operating system time) here:

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2130864721

Clearly, if not allowed - I'll take it down, but I'm using it at my table and figured other people might get some use out of it.
TikiTyler 1 Dec, 2019 @ 1:24pm 
If you want it even more random you could
on load math.randomseed(os.time())
on roll math.randomseed(math.random(1,9999999999))
That way you get new seeds each time that are not based on the time.
TikiTyler 1 Dec, 2019 @ 9:11am 
Hey so the seed generation is done wrong. Its based on time. Make a button with just a d20 and press it once every second or so and you will see its not random at all but time based.
Its because of where the seed generation happens on roll.

You need to take math.randomseed(os.time()) out of the roll function

Current location

--Roll function. Displays roller, then does the random rolls
function roll(o,c)
printThis("((Roll by " .. Player[c].steam_name.."))", c)
math.randomseed(os.time())
local modTotal = 0


Better Location
(Very Top)
function onload(saved_data)
math.randomseed(os.time())
if saved_data ~= nil and saved_data ~= "" then
memory = JSON.decode(saved_data)

I love this thing but the non random nature was pissing me off. If you click too quickly it still will give you duplicates but if you wait at least 1 second between clicks it now does it randomly instead of going 1, 11, 2, 12, 3, 13, 4, 14,...
tOXIC OVER 9K 7 Jul, 2018 @ 2:57pm 
where can i rename the dice buttons in script?
example: I would like rename d6 to black dice

and where can i change the result of d6 to: if 1,2,3 then 2, and elseif 4,5 then 1, and else 3
MrStump  [author] 10 Dec, 2017 @ 6:56pm 
Alternatively I am MrStump#7107 on Discord
MrStump  [author] 10 Dec, 2017 @ 6:55pm 
@Knosan, this has been a project I've been interested in re-visiting, since I saw it tends to get a lot of use. They've added a lot ot scripting, and I've learned some nice tricks, that could REALLY add a lot to it. But I'd like to discuss all the feature ideas (including the ones you mention) with someone who actually uses it (I don't actually play tabletop RPGs generally)

I'd love it if you added me to steam so we can talk through some ideas.
Ray 10 Dec, 2017 @ 12:42pm 
Thank you for the excellent mod, MrStump. This streamlines our D&D rolls dramatically.
Well done and thank you for the time and effort you've put into this essential addition to many hours of fun.

May I suggest an addition, for the sake of larger parties and chat clarity?
If feasible, printing the name of often used Memory Buttons would further help (ie. WHO > WHAT > RESULT on the same line; such as Melee ATK or Wisdom ST).

Or, similarly to using the Name field, we could use the Description field for a more spacious print out, allowing more flavour and flexibility, visually (RP friendly, no / higher character cap, improved readability / syntax, etc.)

This suggestion only comes from being in a larger-than-average party with active voice and text chat, where rolls may get lost, or need explaining or repeating. Hmm... perhaps a 'Repeat Last Result' button may also be handy as a refresher or spamming a great roll! Thanks for reading.
MrStump  [author] 3 Oct, 2017 @ 7:49am 
Replace math.random(1,20) with 20
$ILENCE 3 Oct, 2017 @ 5:53am 
And whether it is possible to make so that dropped out only 20 from 20 always
Gaudaloht 13 Jan, 2017 @ 5:44am 
ty
MrStump  [author] 12 Jan, 2017 @ 3:57pm 
Sure. Look for math.random(1,20) and replace the 20 with 100!
Gaudaloht 12 Jan, 2017 @ 3:28pm 
Please could you make it to roll d100? or just tell me where i can edit it
Dung3onlord 11 Sep, 2016 @ 12:02am 
OUTSTANDING!