Starfinder Playlist
  1. #1

    Rolling Dice without Graphics

    Is there a way to roll a dice in a script without the graphics in the chat window and get the result?
    Basically a function like this:
    Code:
    local result = rolldice({'d6'})
    Thank you

  2. #2

  3. #3
    The d6 was an example it should be more general. And I want it in a script not by dragging something into the tower.

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by Weltenbrand View Post
    And I want it in a script not by dragging something into the tower.
    So use math.random as mentioned by @damned.

    Or, for slightly more complex RPG type dice strings, use StringManager.evalDiceString(sDice, bAllowDice, bMaxDice) - this uses math.random to return the total of the dice string passed in the sDice variable. This function is in the CoreRPG ruleset (scripts\manager_string.lua file). And is used in some of the layered rulesets - search for StringManager.evalDiceString in rulesets for an example. To roll1d6 you'd use local nResult = StringManager.evalDiceString("1d6", true);
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    Quote Originally Posted by Trenloe View Post
    StringManager.evalDiceString(sDice, bAllowDice, bMaxDice)
    That is what I was looking for, thank you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Log in

Log in