1. #1
    Oberoten's Avatar
    Join Date
    May 2006
    Location
    Älvsbyn, Sweden
    Posts
    2,569

    Adding in new dice-mechanics to the CoreRPG foundation?

    Culd someone give me a quick rundown on how to add new dice-functions in the new CoreRPG? In the older rulesets this was all under onDiceLanded in the chatmanager ut I can't seem to find it's equivalent in the CoreRPG.

    - Oberoten (working on Ars Magica 3.0...)
    For your Ars Magica needs :
    https://fgrepository.com




    Atque in perpetuum frater, Ave atque vale.

  2. #2
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,381
    I'd like to know this as well. It seems to be separated out in to two main phases, but I can't seem to get a dice handler to work properly. It'll roll the dice but not display anything in the chat.

    All I've found are, they may help:
    https://www.fantasygrounds.com/refdoc/Comm.xcp
    http://www.fantasygrounds.com/forums...ction_heal-lua
    http://www.fantasygrounds.com/forums...in-FG-Core-3-0
    Current Regular Games: European FG2 RPG

    Using Ultimate FGII - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets - Now also linked in the Wiki

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    22,018
    Most of the functionality is handled in scripts\manager_actions.lua - the action flow is described in the comments at the beginning of that file. What happens when the dice are rolled and land is based on the action type (rRoll.sType) which is used to trigger specific handlers before the dice are rolled (modifier handler) when the dice land (result handler). There's not a great example of this in the CoreRPG ruleset (the only action type that is a roll is "dice" as defined in scripts\manager_gamesystem.lua), but if you have a look in the 3.5e ruleset, for example, there are a lot more available "actions" defined in scripts\manager_gamesystem.lua. scripts\action_ability.lua is a good example of registering, rolling and handling the result of the roll for actions = "ability". It has two handlers registered in onInit: a modifier handler and a result handler that are all tied to determining modifiers to the "ability" action before the roll is made (in the modhandler function modRoll) and then processing and displaying the result of the roll in the result handler function onRoll.

    If you follow this route, you'll need to make sure that your action type is a valid one setup in the "actions" array in scripts\manager_gamesystem.lua otherwise FG won't recognise it.

    It's a different way of looking at things and can take a bit to get used to, but this action process (info in the header of manager_actions.lua) is a nice way of allowing actions to be added to a ruleset that are essentially encapsulated in their own LUA script file.
    Last edited by Trenloe; November 14th, 2014 at 14:04.


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    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!

  4. #4
    Oberoten's Avatar
    Join Date
    May 2006
    Location
    Älvsbyn, Sweden
    Posts
    2,569
    Many thanks. That at the least gives me something to start with. Kudos.

    - Obe
    For your Ars Magica needs :
    https://fgrepository.com




    Atque in perpetuum frater, Ave atque vale.

  5. #5
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,381
    I've managed to get the Yggdrasill dice mechanics coded up as a dice handler in the CoreRPG based ruleset I started for that. It's just the character sheet at the moment, but the dice are rolling from the sheet - both drag and drop and double-click. I seem to have lost the modifier box (where I'm putting the skill bonus) on the dice handler rolls though. I've got the modifier = true in the Actions manager script. Not sure what's going on there.

    The mechanic, for those interested, is a number of d10 rolls (dependent on an attribute). From the dice rolled, the top 2 results are taken. If the character suffers a severe wound, that drops to the top 1 result. So, if 3 dice are rolled only 1 or 2 of the dice are shown in the result. In addition, there's an exploding dice mechanic if a 10 is rolled on any of the initial d10s. The additional die keeps being added as long as a 10 is rolled.
    Last edited by Valarian; January 26th, 2015 at 13:35.
    Current Regular Games: European FG2 RPG

    Using Ultimate FGII - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets - Now also linked in the Wiki

Thread Information

Users Browsing this Thread

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

Posting Permissions

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

Log in

Log in