Starfinder Playlist
  1. #1

    Roll on table on result

    Hey guys. How do I make the stress dice from my Alien RPG ruleset roll on a table. Looking for a mechanic like that of the d&D5e Critical Hit/Fumble option.

    Basically I want for my stress dice to automatically roll a number of dice on a table in game labeled “PANIC ROLL EFFECT RESULTS” if a 1 is rolled.

    I just can’t figure out how to call up the roll in the first place. Any suggestions/examples? I think I found it in the 5e code, but there’s a lot of excess from checking other options and Booleans that I can’t determine the difference between what’s needed in my code and what needs to be changed/removed.

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,824
    You would need an extension to do that I think.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    Quote Originally Posted by Zacchaeus View Post
    You would need an extension to do that I think.
    Yeah I’m looking for an example of how to code that.

    https://www.fantasygrounds.com/forum...ion&highlight=
    Last edited by pr6i6e6st; August 22nd, 2019 at 14:31.

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    In 5E the code to initiate the roll for a fumble or critical is handled via OOB messaging - yep, you're going to have to learn about that now!

    But, all that really does is call the handleApplyHRFC function that issues TableManager.processTableRoll("", msgOOB.sTable); where "msgOOB.sTable" is the table name to roll on. The dice to roll are set directly in that table.

    EDIT: essentially the TableManager.processTableRoll("", "tablename") is the same as issuing a chat command: /rollon tablename
    Last edited by Trenloe; August 22nd, 2019 at 16:17.
    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
    In 5E the code to initiate the roll for a fumble or critical is handled via OOB messaging - yep, you're going to have to learn about that now!

    But, all that really does is call the handleApplyHRFC function that issues TableManager.processTableRoll("", msgOOB.sTable); where "msgOOB.sTable" is the table name to roll on. The dice to roll are set directly in that table.
    Lol ok. Yeah I thought I was in the right spot there. So I’ll just have to play around with that a bit. Once I figure out how to work with all that, I can use it for npc attacks and initiative (works by drawing cards in this game, so I’ll be trying to incorporate your card extension somehow)

  6. #6
    Ok, cool, thank you. so I got that kind of working, or at least sort of figured out. So which function might I want to look at to tell the table to roll a variable amount of stress dice (dS) rather than what it has stored? Or is that possible?

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by pr6i6e6st View Post
    Ok, cool, thank you. so I got that kind of working, or at least sort of figured out. So which function might I want to look at to tell the table to roll a variable amount of stress dice (dS) rather than what it has stored? Or is that possible?
    Get it working using the /rollon chat command - see the syntax here: https://www.fantasygrounds.com/wiki/.../Chat_Commands

    Then use whatever you specify after /rollon in the chat as the second argument to TableManager.processTableRoll

    For example: TableManager.processTableRoll("", "myTable -d 2dS")

    If you want to see the code, look at the processTableRoll function in the CoreRPG TableManager global package (scripts\manager_table.lua).
    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!

  8. #8
    oh man, it's so close to working. can the number of dice be a variable?

    kind of like:
    nValue = getValue();
    TableManager.processTableRoll("", "myTable -d nValuedS")
    or
    TableManager.processTableRoll("", "myTable -d getValue()dS")

    the above doesn't work straight like that,

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by pr6i6e6st View Post
    oh man, it's so close to working. can the number of dice be a variable?

    kind of like:
    nValue = getValue();
    TableManager.processTableRoll("", "myTable -d nValuedS")
    or
    TableManager.processTableRoll("", "myTable -d getValue()dS")

    the above doesn't work straight like that,
    The argument you pass is a string. So, construct that string as you need - look up how to construct LUA strings in standard LUA tutorials. But you can use something like this: "myTable -d " .. nValue .. "dS"

    Info on string construction here: https://lua-users.org/wiki/StringsTutorial
    Last edited by Trenloe; August 22nd, 2019 at 21:51.
    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!

  10. #10
    awesome! that works! it doesn't recognize my stress or base dice that way yet, it seems, but a d6 works just fine in its place. you're a legend.

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
  •  
5E Character Create Playlist

Log in

Log in