PDA

View Full Version : Suggestion for a CoreRPG extension



lachancery
August 7th, 2014, 03:07
A small extension that would look for two graphics files in the campaign directory (ie: desktop.png & chatwindow.png), and if they are found, they would be layered (centered) on top of the desktop and in the chat window.

This extension would be especially useful to theme one-shot games like Pathfinder Society games.

Trenloe
August 7th, 2014, 04:57
Nice idea. But... I don't know if this is possible in an extension. The desktop is defined in the <desktopframe> definition: https://www.fantasygrounds.com/refdoc/desktopframe.xcp which points to a framedef of the desktop. For example, CoreRPG has:

<!-- Desktop background -->
<framedef name="desktop">
<bitmap file="graphics/frames/desktop.png" />
<top rect="0,1,324,151" />
<middle rect="1,154,200,200" />
<right rect="450,0,100,144" />
<bottomright rect="450,0,100,144" />
<bottom rect="219,437,567,132" />
<decal rect="830,0,510,510" />
</framedef>
This is pretty much a static graphics file whose components for the desktop are all composed in the same .png file with the above listed dimensions. https://www.fantasygrounds.com/refdoc/framedef.xcp

Essentially, if you want a different decal in the middle of the desktop then you need to include a whole new desktop.png file - but just change the 830,0,510,510 dimensions of the file for the new decal. Of course, this makes it very difficult to just change the decal within a desktop theme.

Similarly, the main section of the chat window is defined in a single file chatbox.png and the framedef is:

<framedef name="chatbox">
<bitmap file="graphics/frames/chatbox.png" />
<topleft rect="0,0,18,15" />
<top rect="18,0,487,15" />
<topright rect="505,0,18,15" />
<left rect="0,15,18,476" />
<middle rect="18,15,487,476" />
<right rect="505,15,18,476" />
<bottomleft rect="0,491,18,39" />
<bottom rect="18,491,487,39" />
<bottomright rect="505,491,18,39" />
</framedef>
So, you'd have to change the whole chatbox.png file, but only the middle rectangle coordinates: 18,15,487,476. The problem is that these wouldn't be centered if the user resized the chat window.

These changes would have to be done to the .png file before being loaded in Fantasy Grounds, so you're essentially doing just what a theme does - provide a new .png file for the whole frame (desktop or chatbox) not layering on top an interchangeable image.

damned
August 7th, 2014, 07:36
So a theme is basically an extension... and you wouldnt do it for CoreRPG you would have to do it for the particular ruleset - but as you are doing it for Pathfinder that wouldnt be a big deal?
I just tried a couple of things out - it would be a bit of fun to have these themes for Pathfinder and for FG Con <weg>
https://www.fg-con.com/wp-content/uploads/2014/08/themed-desktop.jpg

damned
August 7th, 2014, 17:07
Ok - Here is a super quick and small FG Con theme that should work with most CoreRPG rulesets.
You only have to edit the desktop.png file - changing only layers 1 and 2 and staying with those dimensions and teh name/description in the extension.xml file...

FG Con Fantasy (https://www.dropbox.com/s/vq4fr0pb9czwso7/FGConFantasy.ext)
FG Con Numenera (https://www.dropbox.com/s/evf2ot579vrixwh/FGConNumenera.ext)
FG Con Cthulhu (https://www.dropbox.com/s/92avhckzq6tc9ss/FGConCthulhu.ext)
and one Easter Egg for you Resire (https://www.dropbox.com/s/pa6abs0h8kbzz4a/FGConFantasyMage.ext) - You will have to download it to see it :)

Gimp File for Ease of Making New Images (https://www.dropbox.com/s/uhsga78tgurtrno/desktop-theme-fantasy.xcf)

Sreenshot
https://www.fg-con.com/wp-content/uploads/2014/08/new-theme-image.jpg

https://www.fg-con.com/wp-content/uploads/2014/08/fgcon-numenera.jpg

https://www.fg-con.com/wp-content/uploads/2014/08/fgcon-cthulhu.jpg

damned
August 8th, 2014, 00:52
Added a couple of extras... just desktop changes nothing else.

back to lachancery's post...
what order are things loaded?
CoreRPG+CoreRPGRuleset+Extensions and THEN Campaign?
If loaded in that order there is probably no way for an extension to get the Campaign folder path?

Blackfoot
August 16th, 2014, 23:18
They aren't that hard to do... I did a bunch of theme ones for my FGCon games last time. It was pretty cool.. I just basically dropped the cover art in as a decal. The one I added a curtain for a theater feel (it was that kinda game).

RTFallen
August 17th, 2014, 02:48
Little late seeing this, but thanks damned! :)

Resire

Trenloe
August 17th, 2014, 02:48
CoreRPG+CoreRPGRuleset+Extensions and THEN Campaign?
If loaded in that order there is probably no way for an extension to get the Campaign folder path?
The campaign doesn't contain code, it contains data in the campaign database (DB.XML file). The data from the database is available during Code initialisation and after.

There are some things in the campaign folder that can't be accessed through FG code - e.g. Desktop graphics files that aren't stored as images.

Trenloe
August 17th, 2014, 03:10
CoreRPG+CoreRPGRuleset+Extensions
As far as I understand it, the following process occurs. Taking loading a 3.5E campaign with one or more extensions as an example:

The 3.5E ruleset starts to load. base.xml is used as the main specificaion/declaration and load order of the ruleset XML and LUA code.
The first action that happens in base.xml is: <importruleset source="CoreRPG" /> This pauses the load of the 3.5e ruleset at this point and starts to load up CoreRPG.
The base.xml file in CoreRPG is used to load up the CoreRPG ruleset.
Once the CoreRPG ruleset has been loaded (base.xml has been processed all the way through) then control will be passed back to the paused base.xml in the 3.5E ruleset (step 2 above).
The 3.5E base.xml file is processed through, merging/replacing XML definitions and replacing LUA scripts as defined in the 3.5E ruleset.
Once the 3.5E ruleset has been loaded, any extensions will be loaded. The load order of extensions is not guaranteed unless the extensions have a <loadorder> defined in extension.xml. Extensions usually overwrite underlying ruleset code - although they can merge XML if the merge tags are used.

damned
August 19th, 2014, 15:50
Ive updated three of those theme extensions...

https://www.fg-con.com/wp-content/uploads/2014/08/newthemes20140820.jpg

SF Theme (https://www.dropbox.com/s/7z8nns8wnn06f4n/FGConSF.ext)
Fantasy Theme (https://www.dropbox.com/s/vq4fr0pb9czwso7/FGConFantasy.ext)
Fantasy Mage Theme (https://www.dropbox.com/s/jgco6vq04xygs1x/FGConMage.ext)

Depending on your ruleset you may have to tweak the extension.xml if its not showing as available....

lachancery
September 1st, 2014, 22:41
Another suggested extension for the Core RPG: an Export function for the notes of a campaign. Ideally the output format would be customizable to support multiple formats.

Specifically, I would use this function to do this: in one of the campaigns I am playing with, I have been using FG Notes to keep logs of our sessions. I would like to export them to the Obsidian Portal of the campaign (as Adventure Logs) with the least amount of editing (ie. support the formats in Notes).

Trenloe
September 1st, 2014, 22:46
https://www.fantasygrounds.com/forums/showthread.php?21758-Quick-Survey

Ikael
September 1st, 2014, 22:47
Another suggested extension for the Core RPG: an Export function for the notes of a campaign. Ideally the output format would be customizable to support multiple formats.

Specifically, I would use this function to do this: in one of the campaigns I am playing with, I have been using FG Notes to keep logs of our sessions. I would like to export them to the Obsidian Portal of the campaign (as Adventure Logs) with the least amount of editing (ie. support the formats in Notes).

I think this should be more like extension than part of the CoreRPG. Exporting notes is easy task and their output can be altered, but I don't know what format obsidian portal expects. Do you have specs about this?

lachancery
September 2nd, 2014, 02:29
I think this should be more like extension than part of the CoreRPG. Exporting notes is easy task and their output can be altered, but I don't know what format obsidian portal expects. Do you have specs about this?
@ Trenloe: Thanks for the interesting discussion thread. Wonder what will come out from it.

@ Ikael: OP has an end-user web-based editing tool to post stories, logs, etc. There are Wordpress-like tags to apply formating; I haven't been able to find a wiki page listing all the tags - only found references to "textile editing". Personally, I'd be happy to start with an exporter that parsed FG's formattedtext into a text file with Obsidian Portal's formatting, so I could copy/paste that into a new post on OP. There is an API (https://help.obsidianportal.com/kb/api/api-overview) for Obsidian Portal, but it strikes me as this would be a later, bigger project. (Which is what was being discussed in the thread Trenloe linked.)

Trenloe
September 2nd, 2014, 04:05
First step - try the extension below.

Load this up. I've made it ruleset agnostic and should work in any FG 3 CoreRPG based ruleset (and perhaps others).

Then, in a campaign that has some notes, type /notesexport (/notes should work) and a window will pop up. Save you XML and then you have access to all of the campaign notes in an XML file. You can then extract the <text> section of each note and do with it as you wish.

I based this on an extension I wrote to export the calendar entries: https://www.fantasygrounds.com/forums/showthread.php?18043-Feature-Request-Export-Calendar-Entries&p=141057#post141057 Post #4 of that thread had some instructions for using a basic XSL file to convert the XML into another format (HTML to view in a web page in this case). Perhaps some XSL (or similar XML conversion) could be written to give you the format you're looking for.

For now, at least you can export your notes! :)