Tabletop Simulator

Tabletop Simulator

Not enough ratings
Pathfinder Scripted Dice Roller v2.0
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
File Size
Posted
16.928 KB
10 Sep, 2016 @ 9:47pm
1 Change Note ( view )

Subscribe to download
Pathfinder Scripted Dice Roller v2.0

Description
A tool that simulates dice rolls using scripting and prints them to chat, rather than physically rolling dice. This one in particular is designed for tabletop RPGs that use multiple types of dice. Basically, to make life a little easier.

Features:
  • Has d4, d8, d10, d12 and d20 buttons, plus a modifier which can add/subtract to/from the total.
  • Roll results are printed to chat, along with the player who rolled. Text is color coded to them too.
  • After each roll, tool automatically clears out the previous roll selections.
  • Reset button clears currently selected roll (but not memory).
  • ALL/GM button lets you select if all players see the roll results or if only the GM (Black seat) can.
  • 8 memory buttons let you save different common roll combination.
  • You get to name those memory slots so you can keep track of them. Font size adjusts to name length.
  • MemCLR button is used to clear a memory slot.
  • Works fully with save/load/undo/redo.
  • Use multiple instances of the tool at once without any issue.

Instructions:
This is all stuff I imagine you would figure out after playing with it for a few minutes. But just in case:
Standard Roll
  • Click on each die's button to add 1 of that type to the roll. Clicking "0d4" will make it "1d4".
  • (optional) Click + or - to add/subtract to/from the Modifier for that roll.
  • (optional) Click ALL/GM button to set who can see this roll.
  • Click Roll to print the roll to chat.
  • Click Reset if you make a mistake.

Memory Button Setup
  • Set up the roll as above, but do not hit the Roll button.
  • Instead, right click the tool (not the buttons).
  • Add a name to the "Name" field in the context menu for the tool.
  • Click an empty memory button (---) to save the roll settings for future use.

Memory Button Use
  • (optional) Click ALL/GM button to set who can see this roll.
  • Click the button with the saved information. Roll is automatically printed.
  • All other settings will be discarded.

Memory Button Clearing
  • Click MemCLR.
  • If you change you mind, the same button now says "Cancel" and lets you do just that.
  • Otherwise, next click on the memory slot you want erased. It is now reset back to ---.
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