View Full Version : Ruleset stuff
jmucchiello
February 16th, 2019, 01:37
So I'm trying to modify CoreRPG. I can't even put a string on the charsheet. In campaign/record_char_main.xml I have:
<windowclass name="charsheet_main">
<margins control="0,0,0,2" />
<sheetdata>
<frame_char name="attributesframe">
<bounds>15,0,-29,-5</bounds>
</frame_char>
<label_frametop name="attributesframetop">
<anchored to="attributesframe" />
<static textres="char_label_abilities" />
</label_frametop>
<label_fieldtop>
<anchored to="attributesframe" position="lefthigh" offset="15,5" />
<static textres="ABC" />
</label_fieldtop>
</sheetdata>
</windowclass>
strings.xml contains the string ABC and defines it as abc. Nothing show up. Just attributes text that comes with CoreRPG. What is wrong with label_fieldtop? I tried it with label too. Nothing. I've been programming for 30 years and I can't get a text field to show up.
damned
February 16th, 2019, 13:40
are you working in an unpacked copy of corerpg?
is fg loading your unpacked copy?
Ok label field top should be anchored to something like a numberfield not a frame...
and static textres is looking for a text resource called ABC - eg have a look in one of the strings files and you will see a bunch of text resources - so you would need to create one called ABC which contains the text you want displayed...
jmucchiello
February 16th, 2019, 16:16
are you working in an unpacked copy of corerpg?[quote]
Yes
[quote]is fg loading your unpacked copy?
Yes
Ok label field top should be anchored to something like a numberfield not a frame...
Is this documented anywhere? There are a lot of "helper" tags not part of the documented API in the rulesets. What "label" should I be using? I've only gotten anything to appear by using explicit <bound> tags.
and static textres is looking for a text resource called ABC - eg have a look in one of the strings files and you will see a bunch of text resources - so you would need to create one called ABC which contains the text you want displayed...
My OP says I added ABC string to the strings.xml.
Trenloe
February 16th, 2019, 17:04
I've only gotten anything to appear by using explicit <bound> tags.
Your code in post #1 is using an anchor position of “lefthigh” - which is outside of the frame you’re anchoring to and is also inheriting dimensions from that frame, so the control probably isn’t anywhere visible - hence why static bounds is working (I assume you’ve specified bounds within the visible areas of the window), but anchoring isn’t.
See info on anchoring here: https://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Rulesets_-_Interface#Anchoring
jmucchiello
February 16th, 2019, 18:21
Your code in post #1 is using an anchor position of “lefthigh” - which is outside of the frame you’re anchoring to and is also inheriting dimensions from that frame, so the control probably isn’t anywhere visible - hence why static bounds is working (I assume you’ve specified bounds within the visible areas of the window), but anchoring isn’t.
See info on anchoring here: https://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Rulesets_-_Interface#Anchoring
The anchoring section you reference (that I've read six times) doesn't explain how to combine left and top. I saw lefthigh in another file and used it. Again, is that documented anywhere?
I repeat. I've been a programmer for 30 years. I understand how this should work. The documentation is very spotty.
damned
February 16th, 2019, 23:22
The documentation is certainly not all encompassing.
The approach I use is to look for an example of what I want to do in an existing ruleset and mimic that code.
I keep unpacked copies of CoreRPG and 5E (I unpack to CoreRPG337 and 5E337 so that I am not preventing updates from working) plus I have over time collected many other extensions and community rulesets that have different UI features.
I do find anchoring to be plenty confusing still...
Bidmaron
February 17th, 2019, 00:01
Yep me too but it is an incredibly powerful system. The relative anchoring can make a lot of Windows very easy to do. And the merge system is not even short of amazing.
Moon Wizard
February 17th, 2019, 22:19
If you want something in the upper left interior of another object (such as a frame), use the "insidetopleft" position as the starting point. Or set the individual left and top anchors to parent from the target object.
Check out the Interface section in the Developer Guide wiki:
https://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Rulesets_-_Interface#Anchoring
Specifically, take a look at the graphic that's included to help you understand which anchors are set by each "position" option.
Regards,
JPG
Trenloe
February 18th, 2019, 01:38
The anchoring section you reference (that I've read six times) doesn't explain how to combine left and top. I saw lefthigh in another file and used it. Again, is that documented anywhere?
As mentioned by Moon Wizard - check the graphic in the anchoring section we both linked.
damned
February 18th, 2019, 01:45
https://www.fantasygrounds.com/wiki/images/thumb/2/24/Anchors.png/600px-Anchors.png
Trenloe
February 18th, 2019, 01:47
I repeat. I've been a programmer for 30 years. I understand how this should work.
I would recommend not coming into FG coding with preconceptions of how you think this should work based off other systems you may have programmed in. Over the years there have been a few experienced programmers who have posted in these forums about customising FG and a lot of their issues were because they made assumptions, based off their experience of other systems, that weren’t valid for FG.
There is documentation for FG, but SmiteWorks don’t have anyone dedicated to documentation, so it’s not as thorough as most mainstream applications may have. As damned mentions, it’s a good idea to unpack FG rulesets and search through those for examples. Also check the developer documentation, including the graphics! ;-) And also look at forums posts for thoughts, inspiration, etc.. Simple community extension may help to give you ideas of small modifications, for example. And, as you’ve done for this issue, come and ask the community.
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.