View Full Version : Extension Compatibility

August 19th, 2017, 05:31
Hey all,

I'm trying to make my extension more co-extension friendly but am not sure how to go about it. What are the general guidelines you use when writing an extension to make sure other extensions don't override it (or get overridden)?

My specific example is that part of my extension for 5E (vitality and improved criticals) modifies the main character tab, and other extensions (hero points) get overridden and don't work.


August 19th, 2017, 05:42
The main areas to look at are:
1) Using merging attributes in the XML - don't copy/paste the whole XML file. Look at the windowclasses you're changing and then only merge in your changes wherever possible. See info here: http://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Rulesets_-_Templates#Merge_Behavior And also seeach for merge in the forums for many more example. Also look at the 5E ruleset for merge examples - use "find in files" to find examples.
2) If you're changing LUA functions in global packages then try to override the functions, don't include the whole .lua file if you're just making small changes.

But, in the end it will sometimes be impossible to make your extension play nicely with all other extensions. Do your best, and please document any clashes/compatibility issues in your extension thread.

August 19th, 2017, 15:28
Thanks Trenloe! I'll throw an update here if I need additional advice that hasn't been answered already.

August 24th, 2017, 01:21
Good Morning,
I am trying to make a ext to a rule set I have a template .

<template name="number_charabilityscore2">
<frame name="adnd_square" />
<anchored to="statstitle" position="insidetopleft"/>
<rollable />
<readonly />
<script file="campaign/scripts/number_abilityscore.lua" />

All I want to do is change the <frame> tag to <frame name="abilityscore_box"/>
Do I have to keep the whole Template or can I make the template with only the frame tag in it with a merge option?

August 24th, 2017, 04:13
Do I have to keep the whole Template or can I make the template with only the frame tag in it with a merge option?

As far as I'm aware, you can't merge templates. You'll have to include the whole (modified) template in its entirety.