Results 1 to 3 of 3

Thread: any way to orient dice by right side up after rolling??

  1. #1

    any way to orient dice by right side up after rolling??

    thanks on advance for replies. Loving the TTS so much for prototyping -

    So my custom dice have symbols on them instead of pips. I would love to be able to roll 5 of them at the same time in my dice tray, and have them come up rotated correctly. That is, still randomized as to which side comes up, but when a side does come up, it should be rotated so the symbols are right side up.

    this can be achieved right now, by me hovering over a die after it's been rolled, and just pressing the numeric key on the keyboard for that face of the die-.

    Ive messed with the rotation snap, but that seems to only work in a tiny area. I even put multiple rotation snaps in my dice tray, but that is clumsy and doesnt work right.

    is there a way maybe to increase the actual size of the rotation snap? Then i could make it the entire bottom of my dice tray?

    Or is there a better way to have my dice always come up rotated correctly?

    Maybe there's a function to dice that makes them not come up right side up that can be disabled?

    thanks again!!!

  2. #2
    Join Date
    Sep 2017
    Posts
    397
    You will need to write a script for your dice. This is a good introductory project to begin learning about it if you are not already familiar. Do a web search for tabletop simulator scripting tutorial to find several resources you will need to get started.

    The function onRandomize(playerColor) is called whenever a die is rolled. The idea will be to first wait until the die is resting and then set its rotation relative to the player that rolled it, which you get from the parameter. See https://api.tabletopsimulator.com/event/#onrandomize for details on the function; then look up getPointerRotation and setRotation for the other functions you will need.

  3. #3
    oh wow thanks. I have never used scripting. Thanks for the info - looks like this will point me in the exact right direction!

Similar Threads

  1. Requesting assistance on dice rolling mod.
    By BaconCatBug in forum Scripting
    Replies: 2
    Last Post: 10-11-2017, 11:55 AM
  2. Replies: 19
    Last Post: 04-02-2016, 09:17 PM
  3. Dice Rolling
    By Direshadow in forum General Discussion
    Replies: 0
    Last Post: 08-21-2015, 07:59 PM
  4. Orientation of sixth side of dice
    By SmileyChris in forum Bug Reports
    Replies: 1
    Last Post: 07-11-2015, 10:34 PM
  5. Interesting Dice Rolling Option...
    By BrashFink in forum General Discussion
    Replies: 0
    Last Post: 04-10-2015, 01:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •