PDA

View Full Version : Trying to create an extension for a new 5E based campaign/world



tstory30
December 10th, 2018, 19:15
What is a good starting point on learning how to write an extension that will rename Spellcasting into Weavecasting and allow for more slots per level than current spellcasting gives?

I know I have to write XML and lua coding but I have no idea where to even start at this point.

Trenloe
December 10th, 2018, 19:16
https://www.fantasygrounds.com/wiki/index.php/Developer_Guide

Then look at a couple of small extensions from the forums - referencing the developer guide (especially the section on Extensions) understand how the extension works by overriding and adding to the existing code.

Then, look for where you will want to change the existing 5E code and see what's needed to make what you want.

tstory30
December 10th, 2018, 19:43
The Developer Guide doesn't point towards the lines/syntax I would have to make for editing the 5E ruleset. If someone could get me a better reference, I would appreciate it.

Trenloe
December 10th, 2018, 20:03
The Developer Guide doesn't point towards the lines/syntax I would have to make for editing the 5E ruleset. If someone could get me a better reference, I would appreciate it.
You won't get a line by line (or even function by function) description of a ruleset. Sorry.

To manage your expectations: this is not something that you can follow a step-by-step guide and do in 30 minutes. If you want to start hacking around FG, then you'll have to be prepared to spend time learning, looking at code, doing "find in files" to see how things are done in the ruleset or extension.

Have a look at the 5E ruleset campaign\scripts\manager_char.lua file - and look for "spellcasting" and see how this is defined and used within that script (as a variable called FEATURE_SPELLCASTING). The main area it is used is the addClassFeatureDB function, which is called a few times within that script file.

Some details on the main file structure of a ruleset here: https://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Rulesets_-_Files

The "Rulesets (Game System Frameworks)" section of the Developer Guide takes you through the various aspects of the FG code used in a ruleset - and ends in the API reference guide.

tstory30
December 10th, 2018, 20:19
That was actually enough information to figure out how to start. I didn't even know which LUA file to look at to begin.

LordEntrails
December 10th, 2018, 20:23
If you are like me, do the Custom Decal Tutorial found on this page; https://www.fg-con.com/free-downloads/

Yes you have no need for it. BUT, it is simple, easy and has step by step instructions. It's a very simple tutorial, but it gives a good sense of some of the simplest things to do and have to start etc.