PDA

View Full Version : Extension Creation



TR0LL
November 6th, 2010, 20:57
Ive started making some modifications to d20_JPG for my Future campaign, what is the process for converting these changes into an extension instead of just making changes to the JPG ruleset?

Ive tried looking for more information, but the wiki appears to be down.

Moon Wizard
November 7th, 2010, 04:02
Extensions are loaded from the extensions subdirectory under the application data directory. (accessible via the Start Menu under FG2) Extensions can either be loaded as .ext files (ZIP file containing the files), or they can be loaded from a directory with the extension name. The core file is extension.xml which defines the attributes of the extension as well as the objects/files included.

You can unzip the 4E theme extensions to see an example.

Cheers,
JPG

StuartW
November 7th, 2010, 07:39
One basic principle is that anything defined in an extension (windowclass, template control, script block etc) overrides something with the same name in an underlying ruleset.

Another way for extensions to hook into rulesets is for them to execute global-level scripts on startup, for example invoking DesktopManager.registerDockShortcut to add a new item to the right-hand shortcut bar.

Stuart

StuartW
November 7th, 2010, 07:40
If you haven't already found it, take a look at the online documentation page (https://www.fantasygrounds.com/modguide/extensions.xcp).

Stuart

Stitched
November 19th, 2010, 11:01
Stupid question that may already be apparent:

What's the advantage of building an extension versus modifying a ruleset directly? Is it adding yet another level of complexity when trying to build rulesets (already an arduous undertaking) ?

Oberoten
November 19th, 2010, 11:38
Mostly that an extension can make use of any updates to the core ruleset. If you have relatively few changes, an extension is a good bet.

The more you change though, the less advantage.

- Obe

Stitched
November 19th, 2010, 11:49
Thanks for the reply. Wasn't sure if I was going in the wrong direction. Hacking 4E to make it work for my ruleset, while making some things easier, feels like digital Jenga : remove the wrong block of code and everything breaks.