PDA

View Full Version : Help Needed: Extending the 5e Party Sheet with a new Tab



Shadoghast
August 19th, 2018, 04:29
Hey all,

I've started work on my first extension, which will (eventually) include 2 variant rule extensions for Overland Travel in 5e. In looking around, I figured that the best place to extend this functionality is in the Party Sheet, on a new tab. The rules utilize "roles" for travel and I'm looking to use the character icons next to a stringcycler with the roles. I'll muddle through the actual coding (my lua skills are rusty but I'll knock that rust off by playing with the code,) but I'm having some issues even starting. I can't seem to figure out how to add a separate subsheet and tab to the party sheet after the "order' tab. I've made some updates to the ps.xml that LOOKED like the right place to add a subsheet and tab entry, but I'm not seeing it reflected in the sheet against the campaign.

Does anyone have any thoughts on what else I'm missing or some resources that might get me along the path?

Thanks!

damned
August 19th, 2018, 04:41
Hi Shadoghast

The first thing Id is look at the PS in CoreRPG and then compare it to the PS in 5E.
You will basically be doing something similar in your extension.

Start with ps\ps.xml
under <sheetdata> add another entry like this:
<sub_ps name="overland">
<class>ps_overland</class>
</sub_ps>
Note you will need tow of these... one for partysheet_host and one for partysheet_client

and then under tabs_partysheet
<tab>
<icon>tab_overland</icon>
<subwindow>overland</subwindow>
</tab>
you will need an Icon... look in graphics\graphics_icons.xml for tab_xp

Then search on something like ps_xp in the 5E ruleset

You will see you will need an entry in \base.xml something like this:
<includefile source="ps/ps_overland.xml" />

And of course you will need to create that file... start by copying an existing sheet that is closest in layout to your new tab

Keep using that methodology - find something that exists - use find in files to find where/how its defined and duplicate for your new sheet.

Shadoghast
August 19th, 2018, 14:58
That's really helpful. I neglected to look in the CoreRPG, where I found a lot that I was looking for. Followup question on the base.xml. I see that in the Ruleset file structure, it is above the /ps folder, in the root folder of the individual Ruleset. Is it standard practice to override it by putting it in the root folder of the extension?

damned
August 19th, 2018, 15:00
That's really helpful. I neglected to look in the CoreRPG, where I found a lot that I was looking for. Followup question on the base.xml. I see that in the Ruleset file structure, it is above the /ps folder, in the root folder of the individual Ruleset. Is it standard practice to override it by putting it in the root folder of the extension?

Whooosh!
Straight past me. Ive no idea what you are asking!
Sorry...

Trenloe
August 19th, 2018, 15:04
Base.xml doesn’t override other (earlier loaded in the ruleset layering) base.xml files. It contains the instructions to load ruleset XML and LUA files, building on those already loaded. So, yes, it should go in the root of the ruleset, as this is where it is expected.

However, as you're creating an extension, this is a little different to a ruleset - extensions won’t automatically load base.xml like rulesets do. In fact, extensions don’t usually contain a base.xml file - files that need to be loaded when the extension starts are usually detailed in extension.xml

More info here: https://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Extensions_-_Overview

Shadoghast
August 19th, 2018, 15:11
Thanks guys :)

damned
August 19th, 2018, 15:15
Yes thats an error in my post above - extensions use extension.xml rather than base.xml