1. #1
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    24,209

    Modifying the 3.5e/PFRPG ruleset

    This thread is a place to put info regarding modifications to the 3.5e/PFRPG ruleset. It's not meant to be a step-by-step guide, but a resource for people to get info that *might* help them get started on modifying a ruleset or answer some questions they may have, or give info they may never have known.

    As always, the guides in the library section of the FG site are good places to start:


    Always keep in mind that your best resource for examples is the ruleset itself! If you see something in your game that you think "wouldn't something similar be cool in window XYZ" then look in the ruleset how the functionality is coded and see about using that code for your modification.

    A few steps to do before getting started:
    1. Get the 3.5E.pak file from the Fantasy Grounds installation directory (usually Program Files\Fantasy Grounds II). Rename to .zip and extract to the <FG App Data Directory>\rulesets directory - but give it a new directory such as 3.5E_DEV. This will allow you to create a new campaign, with the ruleset name 3.5E_DEV and so you can modify the files in this ruleset and test, without impacting the normal 3.5E rules.
    2. If you don't already have a preferred good text editor (that includes syntax highlighting for XML and LUA, and has a find in files function) download Notepad++ (free) and add the XML plugin: http://notepad-plus-plus.org/ You can use this for modifying both XML and LUA files - and check the XML syntax with the XML plugin. Also, "Find in Files" is your friend for working out where things are in the ruleset.
    3. Have a look at the Ruleset Modification Guide - available under the "Library" link at the top of this page.
    4. Check some of the XML resources mentioned in the FG library: http://www.fantasygrounds.com/modguide/introduction.xcp
    5. Check the LUA resources too: http://www.fantasygrounds.com/modguide/scripting.xcp


    Many links provided in the developer guide Wiki page: http://www.fantasygrounds.com/wiki/i...eveloper_Guide

    Whichever text editor you use, make sure you utilise "find in files" all of the time, for the whole of the ruleset directory - this is your best way to find all references to specific functionality and to find XML template definitions that are being used. FG XML definitions frequently use nested templates, so make sure you search for all definitions within the ruleset to discover what they are actually defining!

    Directly modifying a 3.5E_DEV ruleset as mentioned in point 1 above is a "quick-and-dirty" way to change code. In the long run, you'll want to package your changes as an extension - so keep track of all of the files you modify so you can put these in an extension once complete. You can usually work out which files you modify by the date changed OS timestamp.

    Also - it is a good idea to comment any modifications you make in the XML or LUA files - so you know what changes you have made from the base code and why. Just a simple "Modified for XYZ" is a good start.
    Last edited by Trenloe; August 3rd, 2017 at 20:46.
    FG Con 15 Fantasy Grounds Online RPG Convention - Nov. 8-10, 2019
    Register at www.fg-con.com for all the latest info.

    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!

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    24,209

    3.5e rulset file locations

    A few pointers where "stuff" is in the 3.5E ruleset. This is the high level directories - most contain XML files (usually GUI objects and their layout) and associated LUA scripts in the underlying \scripts directory :
    • calendar - XML and LUA to do with the calendar. Now in CoreRPG.
    • campaign - XML and LUA to do with the campaign side of things, i.e. PCs, Story, Maps & Images, NPCs, Encounters, Items, etc.. Basically, the main icons along the right side of the FG desktop.
    • common - commonly used template and scripts. Buttons, lists, toolbars, etc..
    • ct - the Combat Tracker.
    • desktop - stuff that is on the desktop: chat window, dice tower, modifier stack, etc.
    • graphics - all of the graphics used within the ruleset.
    • ps - the Party Sheet.
    • ref - XML and LUA to do with the library reference (displaying library modules) and the different windows that can be displayed for library reference entries.
    • scripts - data_common.lua (contains a lot of 3.5E and Pathfinder relevant data - like skills, effects, abilities, conditions, energy types, immune types, damage types, bonus types, etc., etc.). Also has "manager" scripts - the main code that handles specific functionality within FG - like damage, attacks, initiative, exporting, spells, targeting, etc., etc..
    • strings - String resource definitions. Allows for easier changing and translations.
    • utility - basically the "stuff" hanging off the small grey icons in the top right of the FG desktop - character list, effects list, tokens, modifiers, options, tables.
    Last edited by Trenloe; April 15th, 2018 at 19:49.
    FG Con 15 Fantasy Grounds Online RPG Convention - Nov. 8-10, 2019
    Register at www.fg-con.com for all the latest info.

    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!

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    24,209

    Example coding thread

    Below is a link to a very long thread regarding a specific coding requirement - but has lots and lots of info and pointers on how to go about modifying a ruleset, some example coding and how to find information. I'd recommend at least skimming some of the early posts to get a few ideas.

    http://www.fantasygrounds.com/forums...ad.php?t=17909

    Custom Dice Rolling and Actions

    Learn more about dice rolling and actions (and how to modify/create them) here: http://www.fantasygrounds.com/forums...(dice-rolling)
    Last edited by Trenloe; December 14th, 2016 at 21:02.
    FG Con 15 Fantasy Grounds Online RPG Convention - Nov. 8-10, 2019
    Register at www.fg-con.com for all the latest info.

    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
    This is great, Trenloe - thanks for putting it together!

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    24,209
    Some more general info (with references) around modifying a ruleset here: http://www.fantasygrounds.com/forums...-Pen-amp-Paper
    FG Con 15 Fantasy Grounds Online RPG Convention - Nov. 8-10, 2019
    Register at www.fg-con.com for all the latest info.

    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!

  6. #6

  7. #7
    Quote Originally Posted by PolluxTroy View Post
    Thank you, it's ok for me
    I think you may have replied in the wrong thread .

  8. #8
    Since some of this is now out of date, I thought I'd mention that the top level directories are now:

    • campaign
    • common
    • ct
    • desktop
    • graphics
    • ps
    • ref
    • scripts
    • strings
    • utility


    The calendar stuff has been shoved into a module, while the character sheet stuff has been shoved into campaign. There may be other differences, but I imagine things are otherwise reasonably similar.

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    24,209
    Quote Originally Posted by mrgrey View Post
    Since some of this is now out of date, I thought I'd mention that the top level directories are now:

    • campaign
    • common
    • ct
    • desktop
    • graphics
    • ps
    • ref
    • scripts
    • strings
    • utility


    The calendar stuff has been shoved into a module, while the character sheet stuff has been shoved into campaign. There may be other differences, but I imagine things are otherwise reasonably similar.
    Thanks for the details on the changed info. I've updated the first post.

    FYI - Calendar code is in the CoreRPG ruleset, not a module. Calendar modules contain the data for a specific calendar.
    FG Con 15 Fantasy Grounds Online RPG Convention - Nov. 8-10, 2019
    Register at www.fg-con.com for all the latest info.

    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

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