PDA

View Full Version : Extension Questions



tdewitt274
November 6th, 2009, 15:24
I'm still pretty new to the program, so let me see if I understand how Extensions work.

Extensions are basically an external file that cannot retain information. They would be like an "Add On" piece to an existing application (ex, a Function add on for Excel). This would make sense because the extension is in an archive (zip) file.

That being said, Is it possible to maintain data in the db.xml?

Are there abilities in Lua scripting that would allow you to verify that the Extension is available so the script can maintain the Extension's information?

As an example, I like the idea of the Campaigndate (https://oberoten.dyndns.org/fgwiki/index.php/Campaigndate) extension. However, the data is not retained when FGII is closed. Is it possible that when the Extension is kicked off (using the /date command) that it will create a record in the db.xml that the Extension exists? With the appropriate commands modified, then check to see that the Calendardate Extension is available using that stored value and processing additional commands (such as the "Next Round" button, 4e_JPG's Extended Rest, etc) if the Extension is running?

Or, would the entire Extension need to be ported into the main XML files?

Any help is appreciated!

Thanks

Leonal
November 6th, 2009, 15:50
Campaigndate/calendar (https://www.fantasygrounds.com/forums/showpost.php?p=80787&postcount=9) stores information upon exit each time I've used it in my campaign if that's what you mean. Or I'm not understanding your post right.

Zeus
November 6th, 2009, 17:17
To answer your question summarily.

Extensions - can extend or overwrite the functionality defined within the ruleset the extension is designed for. In other words you can use an extension to change an existing ruleset component (note there are some constraints around soing this with some of the standard components like the location of the chatbox) or add components.

e.g. an extension to change the color of the default fonts used in a ruleset or an extension to add new fonts, rule functionaility etc. or even an extension that does a combination of both.

As with rulesets, extensions can make use of the campaign database to store/reference data.

Regarding the campaign date extension specifically. My version, much like the version Leonal is using, stores its data (date and time) in the campaign's db.xml file on close or campaign save.

Try closing the campaign date window and typing in /save before your quit FGII.

If that doesn't work, it sounds like the version you have may not be working correctly. Pop along to the FGWiki (sorry no link) and grab a new copy.

For a Forgotten Realms based version, you can grab this one:

https://zgp.eugenez.net/FGII%204E_JPG%20Extensions/4E_JPG%20FR%20Calendar%20v2.ext

tdewitt274
November 7th, 2009, 04:55
To answer your question summarily.

Extensions - can extend or overwrite the functionality defined within the ruleset the extension is designed for. In other words you can use an extension to change an existing ruleset component (note there are some constraints around soing this with some of the standard components like the location of the chatbox) or add components.

e.g. an extension to change the color of the default fonts used in a ruleset or an extension to add new fonts, rule functionaility etc. or even an extension that does a combination of both.

As with rulesets, extensions can make use of the campaign database to store/reference data.

Regarding the campaign date extension specifically. My version, much like the version Leonal is using, stores its data (date and time) in the campaign's db.xml file on close or campaign save.

Try closing the campaign date window and typing in /save before your quit FGII.

If that doesn't work, it sounds like the version you have may not be working correctly. Pop along to the FGWiki (sorry no link) and grab a new copy.

For a Forgotten Realms based version, you can grab this one:

https://zgp.eugenez.net/FGII%204E_JPG%20Extensions/4E_JPG%20FR%20Calendar%20v2.ext

Thanks Zephp and Leonal. It's likely that I didn't do something right. I'll try the Save function (didn't see that in the documentation), so that may resolve the issue.

Zephp, thanks for the breakdown of the two, this helps! I'm the "technical" person out of our group and trying to figure out what's useful and not for a player that's moving out of state.

Edit: I tried the /save on the CampaignCalendar and it did save the Day and Year, but not the date. Has anyone else had other results? - Thanks

Leonal
November 7th, 2009, 05:26
Is it similar in all campaigns or just one?

Too see if it's an general error or campaign specific I mean.

Ikael
November 7th, 2009, 14:44
The campaign calendar extension should persist all date data everytime it's changed without needing to type the /save. The data itself is stored in campaign registry. I will have to check the extension out tomorrow because this sounds like there is some unit testing material still included to it which resets the data every reload, sorry if this is the case.

Ikael
November 7th, 2009, 21:37
I did manage to check the extension out now but it functions as it should. All the date/time data is persisted to campaign registry file and is restored from there when FG is closed and opened again. So the extension works fine. What ruleset and other extensions are you using? It's possible that the ruleset and/or some other extension cleans up the campaign registry file which would cause the date/time data vanish/reset.

If you want to add new features to the campaigndate extension you must either integrate it to your ruleset as build-in feature by editing the ruleset itself or by editing the extension to include ruleset-specific features (in which case the extension would be ruleset-depended).