PDA

View Full Version : New D100 based Ruleset extension for D00lite - Where to start?



ImaTarget
May 28th, 2014, 15:24
Hi all,

I have bough FG a long while ago but abandoned it for Roll20 because it includes Google Hangout functionallity. But it simply can´t hold a candle to FG when it comes to easy of use, specially for the players. However it really suffers from the difficulty when you want to set up a Ruleset that is not mainstream enough to be already available. Hence I fear I will have to dig in myself if I ever want to play my favorite system in this fantastic tool. Anyway, the Ruleset in question is D00lite from https://www.dwdstudios.com/ .

My Goal would be:


Character Sheet
Dice Mechanic
Equipment Lists
New Graphics


I think this is the most basic thing to be able to run it. However automation which is the strong suit of FG, is propably out for me due to lack of skill. The problem is that I can neither do JS nor Lua and If I try to read the code my head spins. I wager this will be quiet a challenge! Where to start? Are there any suggested tutorials or any software one needs to get started? Besides Notepad++?

The game is published under Creative Commons and the peeps are very open to do with it whatever one wants, I am positive they would sign of on anything if one would try to do this. However this is primarily for my own enjoyment and use and not public consumption. Simpyl because it would be a crappy implementation propably.

The rules mechanic itself is not complicated


» If you are instructed to roll 2D, then you simply roll two dice and add them together. Note that a roll of “0” is 10, not zero.
» If the “D” is followed by “/2” then it means you divide the roll in half (round up). For instance, if you are instructed to roll 1D/2 then you roll one ten-sided die and divide in half. The expected range for a D/2 roll is 1-5 (1/2 rounded up is 1, while 9/2 is 5).
» If you are asked to roll D00 (“percentile dice”), roll two different colored dice. The darker die is the tens digit, the lighter die is the ones digit. For instance, roll a 4 on the darker-die and a 2 on the lighter-die, you’ve rolled 42. Important: a roll of two zeros is a roll of 0%, not 100% as in some game systems. Therefore, D00 is a random roll between 00 and 99.

I have started to look into the WIKI but most is pretty greek to me, I wager I need to start somewhere else before diving into a Ruleset. Any and all help is really appreciated.

Trenloe
May 28th, 2014, 15:44
I'd start by seeing how far you can get adding statistics/abilities to the free form character sheet in the CoreRPG ruleset. You can drag dice to the entries on the first tab and it has an inventory built in.

damned
May 28th, 2014, 15:54
Heya - this is worth checking out too: https://www.verkami.com/projects/7992-ruleset-wizard-for-fantasy-grounds

Trenloe
May 28th, 2014, 17:08
As an example, you can make the end result work the same by using the following:



d00lite dice
Result range
FG equivalent to produce same result


D00
0 - 99
1d100 - 1


1D
0 - 9
1d10 - 1


1D/2
1 - 5
/die 1d5


2D
0 - 18
2d10 - 2


2D+2
2 - 20
2d10



Here are some examples in the CoreRPG character sheet:

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/d00lite.jpg

The problem is the 1D/2. This can be written as /die 1d5 which results in a random number generator returning 1-5 - as can be seen in the screenshot this has been added as a shortcut key at the bottom of the screen as it cannot be dragged to the CoreRPG dice slot on the character sheet.

ImaTarget
May 29th, 2014, 18:18
Hello Trenloe, thank you very much for these, they do help. It is only the d100 that acts as a d100-1, all others normally, so that should not be such a big of a problem.

However while Core RPG is fine to get a game going quickly it does not fulfill my personal needs. If CoreRPG was all I would be using I would stick with Roll20 as creating Roll macros etc in there is a lot easier. Even some rudimentary Character sheets are easily done with their newest release. I am already farther in Roll20 then what I would be with CoreRPG only. The primary reason I am considering FG again is the fact that I can automate a lot of things and prepare most of the stuff for my players already so they can just hop in and play. I want to be able to have them fill out their Character sheet and when they roll add their modifiers and the Chatwindow telling us if it succeeded or not. I want them to be able to drag their weapon to their weapon tab and have it work from there etc. Maybe I am doing it wrong. I have been watching the CoreRPG video and while the functionality is nice its just not quiet there with Roll20 ease of use I fear. For example, I can create a character sheet in FG but I cant figure out a way to copy it so I do not have to repeat each and every step for every NPC. Well, this sounds more ranty then it is meant to be. I want to learn and I am willing to put in the effort I am stuck on where to start though. I pop in SW Module and I am always blown away on how cool it is. I know I wont be THAT good, but some of this stuff should be doable.

@Damned I did actually back that already, however with this big goal and the niche of FG this wont gain much traction I fear. There are not so many GM around willing to create their own rule sets. And since the most popular are already available I would be surprised if he reaches 100 Backers by the end of the campaign at most. :-/


*EDIT*

I just saw the d10 to 0-9 thread and was thinking, would this not work for my needs as well where I need 0-99? While d100-1 gets the same results it looks ugly in the chat window. Something like this?



-- Code to change 100 rolled on a d100 to a 0
for k,v in ipairs (rRoll.aDice) do
--Debug.console("Index = " .. k .. ", type = " .. v.type .. ", result = " .. v.result);
if v.type == "d100" and v.result == 100 then
rRoll.aDice[k].result = 0;
end
end


Bit afraid to simply add it somewhere to try and destroying the BasicRPG Ruleset with it.

damned
May 30th, 2014, 08:35
@Damned I did actually back that already, however with this big goal and the niche of FG this wont gain much traction I fear. There are not so many GM around willing to create their own rule sets. And since the most popular are already available I would be surprised if he reaches 100 Backers by the end of the campaign at most. :-/

Sadly I dont think we will get near the target either.
It has received 300 votes over on the FG wishlist so there is definitely interest in the concept.
There are currently about 50 backers at an average of €50each

I want to get the word out there as widely as possible and see how high we can get so at least it can be re-evaluated and Psicodelix can decide whether or not to repitch at a lower value or if the interest is just not there for a commercial add-on...

Thanks or supporting the project!

regards
Damian

Trenloe
May 30th, 2014, 16:25
Bit afraid to simply add it somewhere to try and destroying the BasicRPG Ruleset with it.
Make a copy of the ruleset and do development against the copy.

More info on starting ruleset development here: https://www.fantasygrounds.com/forums/showthread.php?20651-Modifying-the-CoreRPG-ruleset

Griogre
May 30th, 2014, 16:58
ImaTarget (or anyone else), I'm curious because I've seen this comment before that RollD20 has easier to make macros than FG. I've always thought FG macros were trivial to make - just drag some die or an expression to the hotkey bar. I like to keep an eye on all the different VTTs but I didn't see anything special about their macros. What makes them better than FG? Do they auto compare to other values? List better? Are integrated into the character sheet?

damned
May 31st, 2014, 01:15
@Griogre - simple rolls or simple combination rolls or rolls + modifiers are all easy in FG. Set them up and drag them to a hot key.
What about exploding dice: https://wiki.roll20.net/Dice_Reference#Exploding_Dice
Dropping/Keeping High/Low dice: https://wiki.roll20.net/Dice_Reference#Drop.2FKeep
Reroll High/Low dice: https://wiki.roll20.net/Dice_Reference#Rerolling_Dice

ImaTarget
May 31st, 2014, 11:17
@Trenloe Duh of course, extract it, rename it and fiddle around in there. Sometimes I wonder how I survived until now, Thanks!

@Griogre I play a lot of MMO`s and am familiar with writing macros that way. In Roll20 I click on a Macro button, and editor window opens, I type in the roll macro save it and done. In FG it is more "Opaque" as It probably works the same but the documentation in that regard is lacking and it is not that clear to see how to put it in. At least for me. I am a total newb and creating a diceroll macro with a simple modifier is easy enough. But as soon as I want to have a roll compare to something else or reference an attribute or anything I need to dig into LUA and XML, in Roll20 I do not. Heck the simple functionality of "Popoup" to ask for a modifier is brilliant in Roll20. Pop up asks you what dice to roll asks you for a modifier on the roll and then you can add in the difficulty it rolls and shows you success or not. There is no programming necessary, just a simple macro. Maybe this is not as hard in FG as I think it is, but it sure seems that as soon as I want to get a tiny bit fancy I have to delve into the depth of XML and LUA. Roll20 Macros are far easier to understand for a layman as myself then digging into any FG ruleset. It may be as easy in FG as well but it does not show me how to do it . That is probably because FG wants to sell the ready made rulesets, and that is fine, however it creates an unnecessary barrier for anyone not playing a mainstream system. Sorry, this was a lot longer then I anticipated. I still like FG better, that is why I am here trying to figure out what I need to do to get it working like I want it to. The CoreRPG Ruleset is a big step in the right direction, and with a custom Character sheet will probably work perfectly for most of my needs.

ImaTarget
May 31st, 2014, 11:35
As suggested I created a new Ruleset to fool around in, I wanted to use CoreRPGExtended as a base because I like the Abilities Page there. I added a folder Scripts and copied the manager_actions.lua over, added the code from above and rolled some d100. A 100 was still 100, the script did not fire properly.

To make sure I did the code correctly I then took the CoreRPG, extracted it to a new folder and edited the manager_actions.lua directly. When I roll D100 there it works! A 100 is counted as a 0!

Though I know now that the code would work I do not quiet understand why it did not in CoreRPGExtended. My gut tells me it has something to do with the files and where they are. I assume that simply adding the single LUA Script may not be sufficient to make it work within Cascading ruleset.

ImaTarget
May 31st, 2014, 16:56
All right, tried to work out how the Charsheets work but not as much success as I would like. Where the heck can I define how big a window is? It seems there are so many different ways to define how a window looks like that it is really hard for me to figure out how to do it properly as every ruleset seems to do it differently.



<frame_char name="overviewframe">
<bounds>15,20,-140,45</bounds>
</frame_char>
<string_labeled name="name">
<anchored to="overviewframe" position="insidetopleft" offset="15,10" height="20">
<right offset="-145" />
</anchored>
<labelres>char_label_name</labelres>
</string_labeled>


<!--MB ADD RACE to name -->

<string_labeled name="race">
<anchored>
<to>name</to>
<position>right</position>
<offset>5,0</offset>
<size>
<width>130</width>
</size>
</anchored>
<labelres>char_label_race</labelres>

</string_labeled>


<!--MB ADD AGE to name-->

<string_labeled name="age">
<anchored>
<to>name</to>
<position>below</position>
<offset>0,10</offset>
<size>
<width>50</width>
</size>
</anchored>
<labelres>char_label_age</labelres>

</string_labeled>


This is what I added in record_char.xml to try to figure out how stuff works. There must be an easier or better way to do it this?? At the moment I can´t figure out for the life of me where the size of the frames is defined. I can´t get it bigger to encompass the added field. See the attached screenshot. Help? There must be something fundamental I did not grasp in the documentation or I am not seeing in record_char.xml.

Moon Wizard
May 31st, 2014, 23:55
FYI, there's an Abilities tab in the CoreRPG ruleset in beta testing.

Frames are defined in the ruleset using "framedef" objects defined in the ruleset files. In CoreRPG, these are defined in ./graphics/graphics_frames.xml file and the graphics are in the ./graphics/frames/ folder.

Here is the developer reference for that tag to see how they are defined.
https://www.fantasygrounds.com/refdoc/framedef.xcp

The frame only defines the corners, sides and center graphics to use when a frame is used. The size of the window or control that the frame is applied to is what controls the ultimate display size of the frame.

There is a "frame" tag defined for most controls defined within a windowclass (or inherited through templates). Also, a frame tag can be defined for each windowclass as well.

I'm away from my machine currently. I believe that the framedef for character sheets is "charsheet" which is defined in ./graphics/graphics_frames.xml and the windowclass for the character sheet is also called "charsheet" and defined in ./campaign/record_char.xml. An instance of this windowclass is created when a character is selected or created in the character selection window.

Just keep asking questions, and I'll answer if someone doesn't beat me to it. Great community here.

Also, make sure to check out the developer guides. They are more of a reference than a walk through, but it's good to know where they are if you're digging in. Especially the Ruleset Reference.
https://www.fantasygrounds.com/wiki/index.php/Developer_Guides

Cheers,
JPG

damned
June 1st, 2014, 03:57
Some other dice rollers that seem to have more command line options:

https://anydice.com/
https://rolz.org/
https://dicelog.com/dice

ImaTarget
June 1st, 2014, 11:42
Thanks for these tips!

I was able to figure that one out! First Success! I had to change a different <bounds> value in the charsheet then I thought I needed. Big DUH from my end, so easy once you know how.


<frame_char name="overviewframe">
<!-- changed from 15,20,-140,45 -->
<bounds>15,20,-140,75</bounds>
</frame_char>

Still have the problem that the Age field does not show the underline as the Name and Race fields do though. Any idea where this comes from? Code seems pretty identical for all three to me.


<string_labeled name="name">
<anchored to="overviewframe" position="insidetopleft" offset="15,10" height="20">
<right offset="-145" />
</anchored>
<labelres>char_label_name</labelres>
</string_labeled>


<!--MB ADD RACE to name -->

<string_labeled name="race">
<anchored>
<to>name</to>
<position>right</position>
<offset>5,0</offset>
<size>
<width>130</width>
</size>
</anchored>
<labelres>char_label_race</labelres>

</string_labeled>


<!--MB ADD AGE to name-->

<string_labeled name="age">
<anchored>
<to>name</to>
<position>below</position>
<offset>0,10</offset>
<size>
<width>100</width>
</size>
</anchored>
<labelres>char_label_age</labelres>

</string_labeled>

Trenloe
June 1st, 2014, 16:48
Still have the problem that the Age field does not show the underline as the Name and Race fields do though. Any idea where this comes from? Code seems pretty identical for all three to me.
Specify a height instead of a width for the age control. Using the below anchor shorthand shares the bottom-left and bottom-right positions of the "name" control - this inherits the width of the anchor control, but not the height. The reason why "race" works OK is that it uses the right anchor shorthand which gets the top and bottom right corners from the anchor control, hence inheriting the control height.

Trenloe
June 1st, 2014, 16:52
By-the-way, you do know that race and age are included on the "Notes" tab in the CoreRPG ruleset? Adding race and age to the title section adds it on all tabs and so reduces the space available to every tab.

ImaTarget
June 1st, 2014, 17:06
Ah, OK I will try that, thank you very much. <below> is then just a good choice if I have the same length but if the length it is different I will have to use <bound> again, is that correct?

Right now I am just fumbling about trying to grasp what does what, and then I will figure out how the final sheet should look like. The system has a very small character sheet, I wager I will have Attributes and Skills on the first page. Combat relevant things on the second tab, a third tab for the inventory. And notes then on the 4th or somesuch. You are right of course that it won´t make much sense to add too much to the title if that is repeated on every page. Good point, I will have to remember that.

Trenloe
June 1st, 2014, 17:16
Ah, OK I will try that, thank you very much. <below> is then just a good choice if I have the same length but if the length it is different I will have to use <bound> again, is that correct?
It will probably be easier to use one of the corner shorthand anchors (e.g. belowleft) to give you one corner of another control and then use <width> and <height> entries in the <size> section. For example:

<string_labeled name="age">
<anchored>
<to>name</to>
<position>belowleft</position>
<offset>0,10</offset>
<size>
<height>20</height>
<width>25</width>
</size>
</anchored>
<labelres>char_label_age</labelres>
</string_labeled>

Would give:

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/belowleft.jpg

Trenloe
June 1st, 2014, 17:17
More info on the shorthand anchors in the "Using the anchoring shorthand notation" section here: https://www.fantasygrounds.com/modguide/windowing.xcp

ImaTarget
June 2nd, 2014, 10:05
Thank you, I am trying to understand the documentation, read it all, but Ifeel this is more usable for someone who knows what they are doing. I am a visual learner and hence the documentation without any examples (This is the code, this is what it looks like on the sheet) is sadly not very helpful. Your tips and examples help a lot though!

damned
June 2nd, 2014, 13:24
Sadly - I think that that programming for FG - unless you are a programmer - is beyond the abilities of the vast majority of us...

ImaTarget
June 2nd, 2014, 15:23
I actually would not agree with that. It does not seem so complicated, the problem is more the fact that there are no good tutorials and well documented practical exaples for the layman. Reading the documentation is really hard if you have no basics at all. I think this is the weakest point that FG has. it is powerfull and wants to give all this power to the user. However some users may not want that power. I think CoreRPG is a step in the right direction. I wager what most people want is a working and a bit automated character sheet, nothing too fancy. And I think this should be doable without years of programming experience. Because this will make or break the future of FG in my opinion. It is not so much about power, flexibility and features as much as it is about ease of access and usabillity. It can learn a lot from Roll20 and how they are doing things in my opinion. Anway, back on topic:

I saw that several Character sheets do not actually contain the Skills themselves but have them generated with a script. While I feel comfortable to fiddle around with XML having to use LUA to simply populate a skill list seems overkill to me. Why is it done that way? Seems needlessly complicated for a laymen like me.

Griogre
June 2nd, 2014, 16:10
It's done that way for flexibility - and because it makes it very easy to modify skill lists. Skill lists are often housed ruled. Its easy to write an extension that just changes that one scrip instead of a lot a changes - one for every skill you add or subtract on the character sheet. The fewer things you do in an extension the more likely other extensions will co-exist with it. It also may have originally been done to show off LUA functionality. FG2's major feature add was LUA support.

ImaTarget
June 3rd, 2014, 10:51
OK, so I do not need to do that right? Because editing a LUA script seems a lot harder to me then changing an XML. not that I am successful in any of it yet. FG must have been written for developers, not users. :-/

I am starting to think that using CoreRPG is a mistake for what I am trying to do. Pretty much most of the functionality I want is within the BRP Ruleset. Sadly that is set up totally different then CoreRPG. *pullshairout* How is anyone understanding this stuff? I was thinking about layering functionality from BRP to CoreRPG but that seems an act of futility again as that seems even more complicated. *sigh* And If I do it for current BRP my stuff wont work if BRP is updated to use CoreRPG setup right? I am close to tears, I tell you. The completed sheets are so full of information I have a hard time seeing anything. for example I want to change the core layout from the one big window to several smaller ones, similar to BRP. I have been staring at the XMLs for 3 hours and I just don´t see how to do it. I can see where the overview frame is defined and I understand that the lower big frame is defined in record_char_main.xml. But... where in record_char.xml is that other XML referenced?! I don´t get how the pages of this thing are set up. I think I understand that it is not as easy as "One file per view" though. Looking at record_char_notes.xml at the moment because that layout is close to what I have in mind for the main page. Is there any searchable FG XML tag reference? For example what is a <label_frametop> ? How does <frame_char > work? I have been looking in the documentation but am unable to find stuff this anywhere. I have trouble understanding how the size of a frame is defined if only the bounds tag is there. I know there are height and width tags but it seems they are not used anywhere.

Moon Wizard
June 3rd, 2014, 11:38
You should get your hands on a good text editor with XML folding/collapsing as well as multi-file search. It does wonders with helping you find where things are defined. I have used NotePad++ for a while, and it's free.

Both "label_frametop" and "frame_char" are templates. Templates are used to abstract and re-use controls that are used over and over again. By doing a multi-file search, I found "frame_char" defined in campaign\template_char.xml and "label_frametop" defined in common\template_common.xml.
https://www.fantasygrounds.com/modguide/templates.xcp

If there is an unknown tag within a windowclass.sheetdata tag, then it must be a template. Try multi-file search for <template name="tagname">.
If there is an unknown tag within a control object, then it is a custom XML tag used by the scripts attached to that control.
https://www.fantasygrounds.com/refdoc/

The bounds tag is an absolute layout of a control within the window coordinate system in which it is defined. The comma-separated numbers in the bounds tag correspond to X,Y,W,H (when positive) where X,Y is the position of the top-left corner of the control relative to the top-left corner of the window and W,H are the desired width and height of the control. When negative, the X,Y positions are offsets from the bottom and right edges of the window for the top-left corner of the control, and the W,H become offsets from the bottom and right edges of the window for the bottom-right corner of the control. The negative values are useful to specify relative positioning within a window.
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp

Example 1: <bounds>10,5,20,50</bounds>
This means that the control will be located at X,Y coordinates 10,5 within the window where the top left of the window is 0,0.
The remaining two numbers indicate width 20 and the height 50.
Example 2: <bounds>-20,-20,10,10</bounds>
This means that the top-left corner of the control will be located at X,Y coordinates which are 20 pixels each from the bottom right corner of the window
The remaining two numbers indicate width 10 and the height 10.
Example 3: <bounds>0,0,-1,-1</bounds>
The 0,0 means that the top-left corner of the control is located at the top-left corner of the window (i.e. 0,0 in window coordinates).
The following -1,-1 means that the bottom-right corner of the control is located 1 pixel each from the bottom right corner of the window.

Regards,
JPG

ImaTarget
June 3rd, 2014, 13:25
Thanks Moon Wizard. I am using Note++ since my manual HTML days, so I am covered there. It does help see relations and wich brackets belong together, it already helped me a great deal!

All right, if I look into the template file I see


<template name="label_frametop">
<label>
<anchored position="insidetop" offset="0,10" />
<center />
</label>

So the tag <label_frametop> just means it is always anchored inside top and offset 0,10? But what does "label" do?

Label again is also defined


<template name="label">
<stringcontrol>
<anchored height="20" />
<font>sheetlabel</font>
<nodrag />
<readonly />
</stringcontrol>
</template>

I think that tells FG that If I tag something with Label it will be anchored to a height of 20, use the sheetlabel font, is not draggable and read only. If I understand this correctly label_frametop will also inherit the tags from the underlying label definition?

I finally grasped that there is no such thing as a html tag in XML, I can write whatever I want, however how it is used and displayed depends on what the programmer has told FG to with the tag. Hence by using templates I can define my own tags. That is really impressive and powerful. By drilling down I should end up with something that is in the reference document. Fine so far, still would love a full tag library of at least the standard defined ones ;-)

And a minor success: It took me three days, but I finally got the abilities where they should be. Well. Almost ;) Need to amend the custom strings and fiddle with the offset so they are centered and evenly spaced. And I could use some code pointers. This is really rough and basic and probably much more convoluted as it needs to be. i tried collapsing the basicnumber tag in the way the label is collapsed, but I do not know how to properly annotate the width and height of the numberfield. I may also have done the visible box thing in a cumbersome way, it is copy pasted from the template file as I was unable to find the correct template to use for an editable number field with frame :-/ Also I want to use these scores later in auto-calculations for skill values, do I need to do set it up differently? I think I need to write them into a database node, but not sure. Thank you all for your patience! I learned a lot already, can only get better from here ;-)


<!--Ability scores -->
<label name="strength_label">
<anchored to="abilityframe" position="insidetopleft" offset="15,12" />
<static textres="char_label_str" />
</label>

<basicnumber name="str_score">
<anchored>
<to>strength_label</to>
<position>right</position>
<offset>10,0</offset>
<size>
<width>20</width>
<height>20</height>
</size>
</anchored>
<font>sheettext</font>
<stateframe>
<keyedit name="fieldfocus" offset="5,5,5,5" />
<hover name="fieldfocus" offset="5,5,5,5" />
<drophilight name="fieldfocus" offset="5,5,5,5" />
</stateframe>
</basicnumber>

<label name="dexterity_label">
<anchored to="str_score" position="right" offset="10,0" />
<static textres="char_label_dex" />
</label>

<basicnumber name="dex_score">
<anchored>
<to>dexterity_label</to>
<position>right</position>
<offset>10,0</offset>
<size>
<width>20</width>
<height>20</height>
</size>
</anchored>
<font>sheettext</font>
<stateframe>
<keyedit name="fieldfocus" offset="5,5,5,5" />
<hover name="fieldfocus" offset="5,5,5,5" />
<drophilight name="fieldfocus" offset="5,5,5,5" />
</stateframe>
</basicnumber>

<label name="logic_label">
<anchored to="dex_score" position="right" offset="10,0" />
<static textres="char_label_log" />
</label>

<basicnumber name="log_score">
<anchored>
<to>logic_label</to>
<position>right</position>
<offset>10,0</offset>
<size>
<width>20</width>
<height>20</height>
</size>
</anchored>
<font>sheettext</font>
<stateframe>
<keyedit name="fieldfocus" offset="5,5,5,5" />
<hover name="fieldfocus" offset="5,5,5,5" />
<drophilight name="fieldfocus" offset="5,5,5,5" />
</stateframe>
</basicnumber>

<label name="wil_label">
<anchored to="log_score" position="right" offset="10,0" />
<static textres="char_label_wil" />
</label>

<basicnumber name="wil_score">
<anchored>
<to>wil_label</to>
<position>right</position>
<offset>10,0</offset>
<size>
<width>20</width>
<height>20</height>
</size>
</anchored>
<font>sheettext</font>
<stateframe>
<keyedit name="fieldfocus" offset="5,5,5,5" />
<hover name="fieldfocus" offset="5,5,5,5" />
<drophilight name="fieldfocus" offset="5,5,5,5" />
</stateframe>
</basicnumber>

ImaTarget
June 3rd, 2014, 16:34
And already another question.. I cant seem to change the width of all the labels. The width tag does nothing since I put them above each other. I get why it wont work for the lower ones, they should take info from the parent. But if I amend the width for STR or BP it should change the width of those. But it doesn´t. I read through the documentation several times, I can´t see why this should not work.

Moon Wizard
June 3rd, 2014, 22:35
Exactly right on the XML and very close on the templates.

The tags from templates are merged until there are no templates remaining. So, using the template code you posted and applying it to my previous post, you should be able to see how tags are merged together to form the final XML used to build the control. (for the "label_frametop" example above)

The basicnumber template ends up distilling (after template merges) into a numberfield object (which is a base FG object), which automatically creates a database value to hold the number within the data space of the window containing it (in this case, the PC). The "basicnumber" template is essentially a number field that saves a copy to the database, displays the number in the default black number font, draws a frame around the number, and supports hover and drop frames too. It is exactly the template you want to use for an editable number field that will be stored in the character record.

You asked about what tags FG supports. Remember, every valid FG XML tag is tracked in the ruleset reference document.
https://www.fantasygrounds.com/refdoc/

For the last question about the widths; when you use the "below" position tag, the remaining labels inherit the left and right anchors of the parent tag (thus defining the width). If the left and right anchors are both defined, then the width tag is ignored. Basically, width is defined twice, and the anchors win the tie. Try using the "belowleft" position tag and removing the width from your labels. This means that the tags will become as wide as necessary to fit the label text.

Regards,
JPG

ImaTarget
June 6th, 2014, 12:32
Thank you again, I will experiment with the belowleft tag.

EXTROMEDIA
October 16th, 2023, 08:36
I just figured this out using MoreCore with a Dice String: /rollunder 1d100x(p1)
Where (p1) is the input field or a value such as 65 for your Ability Score value.
Set this up on the character sheet or use it in the chat window.

Hope this helps someone.