STAR TREK 2d20
Page 2 of 2 First 12
  1. #11
    Quote Originally Posted by CaptJack2883 View Post
    I guess I should clarify. I knew you could use the /die command inside FG for the complex rolls. I just meant I didn't know you could put "6d6" into rRoll.aDice and have it work inside an extension/ruleset.

    The other part I'm still wondering about. I honestly have no clue how the Comm.throwDice() function is implemented. Does it call the /die command function?
    Comm.throwDice() is a platform API, while slash handlers are typically handled in ruleset code (see previous post) so Comm.throwDice() can't call the /die slash handler.

  2. #12
    Quote Originally Posted by damned View Post
    after my tests it seems that using dice = { expr = "xxx" } has the same effect as using dice = "xxx"
    Ruleset Wizard
    The Ruleset Development Environment
    www.rulesetwizard.com
    Ruleset Wizard Tutorials
    Damned's Ruleset Wizard Tutorials

  3. #13
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,650
    Blog Entries
    1
    Quote Originally Posted by darrenan View Post
    Comm.throwDice() is a platform API, while slash handlers are typically handled in ruleset code (see previous post) so Comm.throwDice() can't call the /die slash handler.
    Doesnt this suggest otherwise?

    Quote Originally Posted by Moon Wizard
    With the most recent update, any Comm.throwDice calls will now rebuild the individual dice entries for you, if dice.expr is set in the table passed to Comm.throwDice, and no individual dice are specified.
    Ex:
    local rThrow = { type = "dice", description = "COMPLEX ROLL", slots = { #1 = { dice = { expr = "4d6d2" }, number = 0 } } };
    Comm.throwDice(rThrow);

  4. #14
    No. Maybe I wasn't clear. My point was that the ruleset code for implementing slash handlers is implemented in LUA, and calls Comm.throwDice after building the table. As a platform API, the implementation of Comm.throwDice does not call back into LUA code.

  5. #15
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,650
    Blog Entries
    1
    Quote Originally Posted by darrenan View Post
    No. Maybe I wasn't clear. My point was that the ruleset code for implementing slash handlers is implemented in LUA, and calls Comm.throwDice after building the table. As a platform API, the implementation of Comm.throwDice does not call back into LUA code.
    Im sure you were clear - its just over my head!

  6. #16
    Quote Originally Posted by damned View Post
    Originally Posted by Moon Wizard
    With the most recent update, any Comm.throwDice calls will now rebuild the individual dice entries for you, if dice.expr is set in the table passed to Comm.throwDice, and no individual dice are specified.
    Ex:
    local rThrow = { type = "dice", description = "COMPLEX ROLL", slots = { #1 = { dice = { expr = "4d6d2" }, number = 0 } } };
    Comm.throwDice(rThrow);
    Doesnt this suggest otherwise?
    I think Moon Wizard was suggesting that Comm.throwDice now has similar logic to the /die command, in that it checks what's in the dice variable, and if it finds an expression, it evaluates the expression before rolling. Not that it actually calls the /die command.

    Is it possible that it's having a problem with the parenthesis being inside the string?

    "expr = (2*3)d6" vs "expr = 2*3d6"

    Although in the string without parenthesis, you'll probably get 3d6 rolled, and then the result doubled. You may have to put the math part separately, so that the math can be calculated before putting it into the string.

  7. #17
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,650
    Blog Entries
    1
    My current workaround is to do the math first and then send 6 instead of (2*3)
    It does work with the ActionsManager method.

    Also, I updated the ActionsManager global script in CoreRPG used by many layered rulesets to pass through roll tables that do not specify individual dice
    Ex:
    local rRoll = { sType = "dice", sDesc = "COMPLEX ROLL", aDice = { expr = "4d6d2" }, nMod = 0 };
    ActionsManager.performAction(nil, nil, rRoll);

  8. #18
    I would just like to say a Great Big Huge Thank You! to Moon Wizard, damned, and psicodelix for this entire thread. This has allowed me to simplify my ruleset and make it much easier to code. Thanks Y'all!

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