PDA

View Full Version : Modifying the 3.5e/PFRPG ruleset



Trenloe
June 26th, 2013, 16:09
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:

Ruleset modification guide: https://www.fantasygrounds.com/modguide/
Anatomy of a ruleset : https://www.fantasygrounds.com/filelibrary/community/Anatomy_of_a_Ruleset.pdf A bit dated now, but a lot of things are still relevant.
Ruleset Reference: https://www.fantasygrounds.com/refdoc/


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:
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.
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: https://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.
Have a look at the Ruleset Modification Guide - available under the "Library" link at the top of this page.
Check some of the XML resources mentioned in the FG library: https://www.fantasygrounds.com/modguide/introduction.xcp
Check the LUA resources too: https://www.fantasygrounds.com/modguide/scripting.xcp


Many links provided in the developer guide Wiki page: https://www.fantasygrounds.com/wiki/index.php/Developer_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.

Trenloe
June 26th, 2013, 16:09
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.

Trenloe
June 26th, 2013, 16:14
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.

https://www.fantasygrounds.com/forums/showthread.php?t=17909

Custom Dice Rolling and Actions

Learn more about dice rolling and actions (and how to modify/create them) here: https://www.fantasygrounds.com/forums/showthread.php?35531-Fantasy-Grounds-v3-X-CoreRPG-based-Actions-(dice-rolling)

Callum
June 26th, 2013, 22:05
This is great, Trenloe - thanks for putting it together!

Trenloe
October 9th, 2013, 15:57
Some more general info (with references) around modifying a ruleset here: https://www.fantasygrounds.com/forums/showthread.php?19018-Fallout-Pen-amp-Paper

PolluxTroy
May 22nd, 2017, 19:56
Thank you, it's ok for me ;)

mrgrey
May 23rd, 2017, 10:48
Thank you, it's ok for me ;)

I think you may have replied in the wrong thread ;).

mrgrey
April 15th, 2018, 04:11
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.

Trenloe
April 15th, 2018, 18:50
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.

mrgrey
April 16th, 2018, 00:23
Ah, my mistake.

Michael Hopcroft
December 26th, 2021, 18:54
Can character classes, ancestries (I know they're officially referred to as "races", but I like the newer term much better) be transferred between the 3.5 and PF1 modules? Since I have access to both, I wonder if the content is comp;atible enough to use.

Kelrugem
December 26th, 2021, 21:20
Can character classes, ancestries (I know they're officially referred to as "races", but I like the newer term much better) be transferred between the 3.5 and PF1 modules? Since I have access to both, I wonder if the content is comp;atible enough to use.

Yup, they are compatible :) You can use 3.5E modules in PF1 campaigns and vice versa :)

Michael Hopcroft
December 27th, 2021, 03:18
Thank you! Nowe that I've upgraded at last, I feel I need to start over. Tutorial, here I come.

Kelrugem
December 27th, 2021, 09:33
Hehe, have fun :)

Morenu
June 2nd, 2022, 02:31
I am not sure where to put this (and if is even worth putting in as a "bug") but any time you do a d1 or #d1 request (say DMG: 2d1) it throws an error. I know I know its DMG:2 but there was something to do with HD and an NPC my DM wanted to do involving 75d1 (not totally sure what) so I played around and places where die rolls work, d1 does not. doubt it is worth anyone's time but my sense of consistency forces me to write this.