Thread: Modifying the CoreRPG ruleset
-
March 10th, 2014, 15:56 #1
Modifying the CoreRPG ruleset
This thread is a place to put info regarding modifications to the Fantasy Grounds (FG) 3.0 CoreRPG 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/filel..._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.
Note: This thread freqently refers to the <FG App Data Folder> - this is a directory on your hard drive where Fantasy Grounds stores all of its data. It can be reached by clicking the "Open data folder" icon in the top right of the main FG startup screen (above the version number).
A few steps to do before getting started:- Get the CoreRPG.pak file from the Fantasy Grounds <FG App Data Directory>\rulesets directory. Rename to .zip and extract to the same directory (<FG App Data Directory>\rulesets directory) so that you have a CoreRPG directory. Rename this to something like CoreRPG_DEV. This will allow you to create a new campaign, with the ruleset name CoreRPG_DEV and so you can modify the files in this ruleset and test, without impacting the normal CoreRPG rules. Do not leave the directory called CoreRPG as this will result in you still using this folder even after future updates to Fantasy Grounds.
- 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 in the Developer Guides section of the Wiki: https://www.fantasygrounds.com/wiki/...veloper_Guides.
- Check some of the XML resources mentioned in the FG library: https://www.fantasygrounds.com/modgu...troduction.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/...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 CoreRPG_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 or layered ruleset - 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 timestamp in your operating system File Explorer.
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.
Additional details on actions (dice rolls) here: https://www.fantasygrounds.com/forum...(dice-rolling)Last edited by Trenloe; August 3rd, 2017 at 19:46.
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!
-
March 10th, 2014, 15:56 #2
A few pointers where "stuff" is in the 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 :
- campaign - XML and LUA to do with the campaign side of things, i.e. Characters, Story, Maps & Images, NPCs, Encounters, Items, parcels, tables, etc.. Basically, the main icons along the right side of the FG desktop. The record_char_XXX.xml files contain the definitions for the PC character sheets: record_char.xml is the top level and record_char_main.xml, record_char_inventory.xml and record_char_notes.xml define the individual tabs (subwindows).
- 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 - The string resources that are used throughout Fantasy Grounds. These files help to facilitate translations of Fantasy Grounds.
- utility - basically the "stuff" hanging off the small grey icons in the top right of the FG desktop - calendar, character list, effects list, tokens, modifiers, options, exporting.
Last edited by Trenloe; May 30th, 2014 at 16:25.
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!
-
March 10th, 2014, 15:56 #3
Custom Dice Rolling and/or Actions
See how to create custom actions (the main background process used by CoreRPG for rolling dice and other processes) here: https://www.fantasygrounds.com/forum...(dice-rolling)
LUA resources
A good beginners guide to LUA programming: https://www.amazon.com/Beginning-Lua.../dp/0470069171Last edited by Trenloe; December 14th, 2016 at 20:01.
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!
-
March 10th, 2014, 16:59 #4
Yesterday you linked to a post containing information on ruleset layering that I didn't see in your posts. Might want to splice it in until we get official documentation on merging.
Good stuff by the way. Feel free to delete this post to make room for more.I never claimed to be sane. Besides, it's more fun this way.
-
March 10th, 2014, 17:29 #5
Too bad this seems to be about (or will be about) modifying CoreRPG. Unless very specific needs and knowledge, most things should be done via the new layering/cascading capability aren't they? Or will that go into placeholder 2 ?
Weekly Hurlements virtual tabletop rpg on TousRôlistes.fr
-
March 10th, 2014, 17:33 #6
I haven't yet decided exactly what will be included in this thread (if at all) as it is meant to be a "get started modifying a ruleset" primer. I do mention in post #1:
Originally Posted by Post #1Last edited by Trenloe; March 10th, 2014 at 17:59.
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!
-
March 11th, 2014, 00:36 #7
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Seems like this should be sticky'd.
-
March 29th, 2015, 12:54 #8
So there are advantages to modifying CoreRPG and not building an extension or layered ruleset. The biggest advantage is that changes to CoreRPG cant break your new ruleset as its a new fork.
Otherwise - yeah Id go with an Extension or Layered Ruleset to ensure you continue to receive Moon Wizards largesse!
In my experience - looking at a really basic Extension - like the Themes - helps to understand how the layering works.
The advantage of a Ruleset over an Extension is that a Ruleset will always load after CoreRPG but an Extension may load before or after another extension and thus give potentially unexpected results....
-
November 6th, 2015, 10:47 #9
Damned,
After our chat the other day, I was thinking and I have another suggestion for you to think about. First of all, I tried to do it myself, but I cant get the code to work right, as I am missing something.
But right now, we have two pages on the character sheet, "abilities" and "inventory" Both pages support the drag and drop option, but the "abilities" page only supports the drag and drop option for the title of what ever it is you are adding there. If you click on the little info box on the side, the description is blank. But if you drag and drop an item to the "inventory" page, the info box supports what ever is in the description.
If we could make the ability page, work the same as the inventory page. People with limited knowledge on how all this works, (like me) we can still make pretty good library mods, by using inventory items as skills, spells, special abilities, and be able to drag and drop items where ever we want.
I am not sure if what I am saying is making any sense, but I attached the screen shot, and hopefully it will give you the idea of what I am trying to suggest.
Attachment 11676
-
November 6th, 2015, 12:13 #10
You want to be able to have a Library of Skills that you can drag and drop?
Is that what you are saying? The quickest way to do this for you right now would be to have a dummy PC with the full list of skills and you can drag them from there on to other PCs.
If the library is what you are saying you want - I will have a look and see if I can work that out...
Thread Information
Users Browsing this Thread
There are currently 3 users browsing this thread. (0 members and 3 guests)
Bookmarks