PDA

View Full Version : Hacking 5e ruleset tutorials?



Weepdrag
June 9th, 2024, 20:04
Hello all,
I'm trying to learn what makes FGU work "under the hood" Are there any tutorials for the current 5e build, that cover:
Adding/subtracting side-bar elements and linking them to a sheet
adding/subtracting elements of the character sheet
any type of general programming structure reference, so I don't have to be a 'bug' about basics :)
?
I watched Damned's vids about ruleset creation, but they seem to revolve around "Ruleset Wizard" and considering I'm more trying to hack the 5e ruleset rather than a scratch build, they really didn't really apply so much. I've been "fairly" successful in reskinning 5e, but I need to up my game on the mechanics end.
Thanks in advance

LordEntrails
June 9th, 2024, 20:17
Current? Not sure. There have been other various extensions and such that add character sheet tabs and sidebar buttons, but not sure if they are current or where to look for them other than trying to find something similar on the Forge.

Have you looked at the Developer Guide? Developer Guide - Fantasy Grounds Customer Portal - Confluence (atlassian.net) (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644285/Developer+Guide)

Weepdrag
June 9th, 2024, 21:10
Thanks LordEntrails, I was trying to learn by reverse-engineering some extensions/themes, etc already out there, but it seems that almost every one that I've tried was a PW protected zip file. I also tried the "Developer's Guide" but it doesn't seem that it has kept up the the FGU revisions on the topics that I'm trying to learn.
Thanks again

damned
June 10th, 2024, 11:05
The ruleset is the tutorial.
That is the guidance from SmiteWorks.

You can look at older videos I did pre- Ruleset Wizard. There is at least one 5E extension video and a whole series on extending MoreCore - which while not directly relevant the general concepts are the same.

Weepdrag
June 10th, 2024, 16:20
Thanks Damned, I'll take another look and see what I can glean from what you have up there.I may have missed a few.

damned
June 11th, 2024, 01:07
https://www.youtube.com/watch?v=R_CulFJYs-M
https://www.youtube.com/watch?v=UPKJDwUt554
https://www.youtube.com/watch?v=x4leZBomtOc

Then MoreCore ones here:
https://www.youtube.com/watch?v=54PSYMXmyvs&list=PLsgd1zJLdiKW23yt4X2qc_9w1TWQfTPUA&pp=gAQBiAQB

Weepdrag
June 11th, 2024, 03:24
Thanks Damned,
I've been watching (and re-watching) those exact vids all day. Thanks a bunch. :)

Weepdrag
June 12th, 2024, 03:04
I've run into a small stumbling block... I've copied the code from record_char_main.xml and made all of the modifications that were needed and it works great except, I don't know how to express that "REFLEX" is equal to "DEXTERITY". I see how to link to a new ability value but not to an existing one.
This is my code:
<!-- Create new REFLEX Save based on Dexterity -->

<number_charabilitysave name="reflex" source="abilities.dexterity.save">
<target>reflex</target>
<modifierfield>abilities.reflex.savemodifier</modifierfield>
<anchored to="newsaves" width="40" height="30">
<top anchor="bottom" offset="15" />
<left anchor="center" offset="-60" />
<font>reference-b-large</font>
<description textres="char_tooltip_reflex" />
</anchored>
</number_charabilitysave>
<button_saveprof name="reflexsaveprof" source="abilities.dexterity.saveprof">
<anchored to="reflex" />
</button_saveprof>
<label_chardefense>
<anchored to="reflex" />
<static textres="REF" />
</label_chardefense>

In this configuration, the saving throws appear in the boxes, but aren't functioning for the dice roles on the "new" button. The dice roles stopped when I changed the location of the button with the <anchored> statement.
Thanks for any assistance

damned
June 12th, 2024, 03:43
Is it an additional record or it is replacing Dexterity?

Weepdrag
June 12th, 2024, 05:15
this would be an additional record like you did with Sanity BUT with no original ability score. It should just draw from the Dexterity save modifier. I have two other added buttons as well for "Mind" and "Fortitude" but they're identical to Reflex, drawing from Intelligence and Constitution saves.
Thanks

damned
June 12th, 2024, 12:37
Im not understanding.
Dis you already add Mind and Fortitude?
Do they work?

I dont think I "draw from the Dexterity save modifier" in the Sanity extension?

I am not following the description sorry.

Weepdrag
June 12th, 2024, 17:29
I'm sorry for my lack of clarity, Damned,
Let me start over... I created three new saving throws that do not have a matching ability. In your video when you created the new SANITY ability and saving throw, they were paired, so that the SANITY saving throw would be derived from the SANITY Ability. What I have done is to create three new saving throws that don't have a unique or paired ability. The new saves are Reflex (Dexterity), Mind (Intelligence), and Fortitude (Constitution). All three pieces of code are identical with exception of the particular parameter that it's for. And, all three act identically in their dis-function.
The main issues at this point for all three pieces of code is that once the <anchored> statements were added to relocate the buttons from the right side column to the middle of the main window the buttons failed to function (no dice rolls). When the <anchored> statements are commented out, the buttons act as they should (dice rolls work again). But, of course, the buttons go back to their original position in the right column.
Here is the <anchored> section in question the placement is still as in the OP:
<anchored to="newsaves" width="40" height="30">
<top anchor="bottom" offset="15" />
<left anchor="center" offset="-60" />
<font>reference-b-large</font>
<description textres="char_tooltip_reflex" />
</anchored>
I guess my questions are
1. Where should the <anchored> statements be placed (if correct at all) to regain the dice roll function? The <anchored> function itself for placement of the elements on the Character Sheet are acting as expected.
2. The LUA file (manager_actor2.lua) that you referenced in your video for SANITY doesn't seem to exist in current incarnation of CoreRPG or 5e BUT, there is manager_actor_5e.lua. Considering I'm not creating a new ability and only referencing an existing ability, do I need to make a LUA file entry at all? Just for best practices purposes?
Thanks again, and again sorry about my lack of clarity

damned
June 13th, 2024, 01:52
Perhaps you could mock up a screenshot of what you are trying to do?

You say your new Saves are not paired but then you list them followed by an Attribute, one might describe them as pairs....

Are you saying that your saves dont have dedicated/unique Attributes but share existing attributes? If so why do they exist if they have identical values to existing saves?

Weepdrag
June 13th, 2024, 03:15
I understand the question... It isn't my game design. In their book, the game designer has saves for Reflex, Fortitude, and Mind but they also have saves for all of the "normal" abilities (STR, DEX,CON,INT, Technology (WIS), People (CHA)). It is redundant, but again, not my design. If they were going to use 5e as a basis, they should have stuck with it IMO. The game is Carbon 2185
Screenshot
https://ibb.co/2Yr8nzB
Thanks again

damned
June 13th, 2024, 03:48
OK great that helps. Share what you have done so far. I wont get to look at it until tomorrow evening but if you havent solved it by then I will put something together.

Weepdrag
June 13th, 2024, 06:02
Thanks Damned,
This is the entire added section on record_char_main.xml and reflected in the screenshot:
<!-- NEW SECTION START-->
<label_charframetop name="newsaves">
<anchored height="20">
<top anchor="bottom" offset="-210" />
<left offset="105" />
<right offset="-105" />
</anchored>
<static textres="char_label_newsaves" />
<icons>char_stats</icons>
</label_charframetop>
<!-- Create new REFLEX Save based on Dexterity -->
<number_charabilitysave name="reflex" source="abilities.dexterity.save">
<target>reflex</target>
<modifierfield>abilities.reflex.savemodifier</modifierfield>
<anchored to="newsaves" width="40" height="30">
<top anchor="bottom" offset="15" />
<left anchor="center" offset="-95" />
<font>reference-b-large</font>
<description textres="char_tooltip_reflex" />
</anchored>
</number_charabilitysave>
<button_saveprof name="reflexsaveprof" source="abilities.dexterity.saveprof">
<anchored to="reflex" />
</button_saveprof>
<label_chardefense>
<anchored to="reflex" />
<static textres="REF" />
</label_chardefense>
<!-- Create new FORTITUDE Save based on Constitution -->
<number_charabilitysave name="fortitude" source="abilities.constitution.save">
<target>fortitude</target>
<modifierfield>abilities.constitution.savemodifier</modifierfield>
<anchored to="newsaves" width="40" height="30">
<top anchor="bottom" offset="-30" />
<left anchor="center" offset="-15" />
<font>reference-b-large</font>
<description textres="char_tooltip_fortitude" />
</anchored>
</number_charabilitysave>
<button_saveprof name="fortitudesaveprof" source="abilities.constitution.saveprof">
<anchored to="fortitude" />
</button_saveprof>
<label_chardefense>
<anchored to="fortitude" />
<static textres="FOR" />
</label_chardefense>
<!-- Create new Mind Save based on Intelligence -->
<number_charabilitysave name="mind" source="abilities.intelligence.save">
<target>mind</target>
<anchored to="newsaves" width="40" height="30">
<top anchor="bottom" offset="-30" />
<left anchor="center" offset="65" />
<font>reference-b-large</font>
<description textres="char_tooltip_mind" />
</anchored>
<modifierfield>abilities.intelligence.savemodifier</modifierfield>
</number_charabilitysave>
<button_saveprof name="mindsaveprof" source="abilities.intelligence.saveprof">
<anchored to="mind" />
</button_saveprof>
<label_chardefense>
<anchored to="mind" />
<static textres="MIN" />
</label_chardefense>
<!-- NEW SECTION END-->

From what I can suss out, the problem is the <anchored> statements or in particular the placement of them within each section. As you can see from the screenshot, the elements are placed on the character sheet BUT they are not functional. If I comment out the <anchored> statements, the elements return to the right side under the other saves and work correctly. Considering all three code snippets are basically identical, all three perform identically. Everything else on the [Main] sheet works as expected,
Thanks again

damned
June 13th, 2024, 13:59
Hopefully this will help you.
It also might not answer all your questions.
They have made the character sheets so much more complicated with subwindows inside subwindows.

I basically made the charsheet taller and then because teh bottom section was anchored to the bottom it dropped down by the 80px I increased the sheet size by.
That allowed me to add my code without <insertbefore> by also anchoring to the bottom - just a bit further away from the bottom.

It probably wont teach you as much as it might had I done it another way.

Weepdrag
June 13th, 2024, 16:31
Thanks Damned,

*** UPDATE ***
While I was waiting on support (Derek) to show me the error of my ways with why attachments wouldn't appear... (problem solved). I tried a few things:

1. at least one of my original incarnations of code would have worked if placed correctly.
2. the placement of my code was wrong and was causing the issues. I needed to ADD it to the bottom of the <sheetdata> section rather than interspersing it into the existing code.

After receiving your attachment:
1. for each parameter (Reflex, Fortitude, Mind) the only reference to the original (Dexterity, Constitution, Intelligence) is the <target> value </target>

I hope this is educational for anyone trying to do this in the future.

Thanks again Damned, you helped immensely

damned
June 13th, 2024, 23:43
I kinda briefly explained above I was able to just add the code at the end because the object below it was anchored tl the bottom. Had it been relatively anchored to the object above it as everything else is, we would have needed an insertbefore in there on the first element.

Weepdrag
June 14th, 2024, 01:47
Thanks Damned,
The devil is always in the details.

Well [MAIN] is done, time to work on the [INVENTORY] Tab, that will be a new experience :pirate:

Thank you again, you're a gentleman and scholar:D

damned
June 14th, 2024, 03:45
The target key/value is not a part of most controls - it is part of the number_charabilitysave template as it uses that to know where to pull the attribute modifier from. That control is more complex than many other number fields.