PDA

View Full Version : Character sheet, how to make a simple one extended from CoreRPG?



Lundgren
January 30th, 2015, 10:09
I have read the Anatomy of a Ruleset, and while I don't feel I have grasped it yet, I feel it is within reach. But, as I understand it, it is from a previous version and not using the strengths of FG3.

The ruleset I have looked at, that are based on extending CorePRG, are full rulesets with a lot of bells and whistles. So what I'm looking for is mixed up with a lot of other things. ...or at least, what I'm looking for is not apparent enough for my winter fatigued brain. My Search-Fu have also failed me.

What I'm looking for is a very bare bone example of a character sheet XML-file. Something only having, say two tabs, one of the tabs having two sections (where one of the sections have at least two stats/values/whatyawannacallit) and the other tab can have just one or two items.

Anyone who can link me to a good thread on the topic, or perhaps whip up an example and post it here (I'm guessing it is fairly simple when one know the system... But I don't know enough yet to be even sure of that :o ).

damned
January 30th, 2015, 10:28
can you draw what you want?
can you provide an example of the dice rolls you want?

it might be fairly simple if you are ok at LUA and XML.
im neither but Im ever so slowly plugging away at a CoreRPG extension ruleset...

Lundgren
January 30th, 2015, 11:07
can you draw what you want?
can you provide an example of the dice rolls you want?

it might be fairly simple if you are ok at LUA and XML.
im neither but Im ever so slowly plugging away at a CoreRPG extension ruleset...
Hm... I guess I need expand a bit on what I'm looking for and why :)

But to directly answer the questions:
Yes, but actually drawing up what I think is simple might add unnecessary complexity to any XML example.
At the moment, assume any (or none) dice mechanic but with no functionality tied to the character sheet.

What I'm currently looking for is not a specific example, just a simple one that is advanced enough to use two tabs, and divide things in one tab into two sections (say Attributes and Skills). But nothing more. So no functions where it can add dices and modifiers, by clicking in the sheet.

What I'm plan to do is a few "bare bone" rulesets. The basic idea is to have:
1. Hide the dices not used (got that part down :) )
2. A character sheet containing the fields needed, but no automation
3. A widget for quickly selecting the correct amount of dice and a "roll" button (ie. 27D10 for exalted or D8+D4+D12+D2 for cortex)
4. Changing the dice mechanics to fit the system in question (which might not be needed for some, but might need exploding dice or counting "successes" for others)

The idea is to have it "quick and dirty" so I can get the first one together and completed. I can easily create a new one if I want to play something else. Also, it should be easy for someone else to use it and throw something together, so they can start playing (and by sharing them, those who don't know anything about neither XML nor Lua will have more things to download).

I'm currently trying to figure out step 2 above... But I'm not getting of the ground at all at the moment.

damned
January 30th, 2015, 12:59
Im not following so Ill try doing the drawing :)

Here are 2 CoreRPG character sheets - the first is Core Only
https://www.fg-con.com/wp-content/uploads/2015/01/bajar.jpg
If you click on personality you will get a d20+1 rolled and you will see output like:
Bajar: Personality 14 <7>+1 8
Actor - Bajar
Attribute - Personality
Score - 14
Rolls - 7
Attribute Bonus - 1
Result - 8

The second is using Psicodelix's most excellent CoreRPG Improved Character Sheet extension which allows you to add /die commands....
https://www.fg-con.com/wp-content/uploads/2015/01/onango.jpg
And using Trenloes Custom Dice Extension will allow you to add some funkier dice results if needed - though not exploding ones or drop/keep rolls as yet.

Can you see what you need in either of these examples?

https://www.fantasygrounds.com/forums/showthread.php?22683-CoreRPG-Improved-Charsheet
https://www.fantasygrounds.com/forums/showthread.php?23013-Demi-Dice

Lundgren
January 30th, 2015, 14:40
Not what I was looking for, but something I most likely will find useful in the future. :)

It is the XML files, or file, to create something like this I'm looking for.

8907

Just a sheet with as few things as possible, so I can see what I need to do so the XML-file is called and how to put a few elements on there. If we were talking about driving, I'm at the "Okay, but how do I open the door?" level :)

Valarian
January 30th, 2015, 15:08
What timezone are you in?

Lundgren
January 30th, 2015, 15:33
What timezone are you in?
I'm on GMT+1 (Central European Time).

But to avoid another misunderstanding :) I'm not looking for how to set up a character sheet for CoreRPG from inside FG; but on how to create the XML files that define a character sheet, when having them inside a new ruleset layered above CoreRPG.

Trenloe
January 30th, 2015, 15:39
Take a look at the 3.5e ruleset as an example. This has a lot of controls in it, but is a good example of many ways of displaying controls - try to tune out the stuff that you're not interested in. I know you've said you want to do this within CoreRPG - but there is not a good bunch of ready examples of control placement in CoreRPG. Once you get to grips with it in 3.5e you can transfer the code (and templates if you need to) toy CoreRPG.

I've added some links to the developer reference for some entries below.

Most rulesets will start with a <windowclass> (https://www.fantasygrounds.com/refdoc/windowclass.xcp) that defines the size and main structure of the character sheet as a whole. The "charsheet" windowclass in the campaign\record_char.xml file does this for 3.5e. In this <windowclass> you have things like the graphics frame to use for the outline, the width and heigh of the sheet, if it can be resized (this one can't) a few other properties and then the <sheetdata> section - which is the main area where all of the controls are defined.

This windowclass does primarily two things in terms of controls: it defines the controls that will be seen at the top of all character sheet pages and it defines the data for each <tab> which are defined as <subwindow> controls (https://www.fantasygrounds.com/refdoc/subwindow.xcp). The <subwindow> entries define the size of the subwindow on each of the tabs (usually the same) and the <windowclass> to use for each of the subwindows. Then the <tabs_character> section defines each <tab>: the order in which they will be displayed down the right hand side, the graphic to use for the label (<icon>) and the name that FG uses to refer to the <subwindow> which references the previous <subwindow> sections.

So, looking at the first <subwindow>main</subwindow> <tab> entry for the main tab, it uses the following definition:


<subwindow name="main">
<bounds>0,65,-1,-20</bounds>
<class>charsheet_main</class>
</subwindow>

The main thing here is <class>charsheet_main</class> - this is telling FG to load the "charsheet_main" <windowclass> within the <bounds> of this subwindow.

See here for more info on windowclasses, bounds and controls: https://www.fantasygrounds.com/modguide/windowing.xcp

So, we need to find where the "charsheet_main" <windowclass>. Knowing this ruleset, I know that it is in the campaign\record_char_main.xml file. But, if you're not sure where it is, do a find in files for ="charsheet_main this should find the definition of the <windowclass>. The following is the start of this <windowclass>:


<root>
<windowclass name="charsheet_main">
<script file="campaign/scripts/char_main.lua" />
<sheetdata>
<!-- Abilities -->
<frame_char name="abilityframe">
<bounds>15,0,240,200</bounds>
</frame_char>

<number_charabilityscore name="strength" source="abilities.strength.score">
<anchored to="abilityframe" position="insidetopleft" offset="100,23" />
<description textres="char_tooltip_str" />
</number_charabilityscore>
<string_charabilitylabel>
<anchored to="strength" />
<static textres="strength" />
</string_charabilitylabel>

The <sheetdata> property starts the section where all of the graphics/controls will be defined:

<frame_char> defines the frame to use and it's bounds within the <subwindow>. The defintion for frame_char is found in the CoreRPG ruleset in campaign\template_char.xml, which defines that it is using the <frame> "groupbox", which is finally defined in the CoreRPG graphics\graphics_frames.xml file.
Next come the strength score and label controls - basically FG uses separate controls for the labels and the actual data containing controls.


Controls are usually anchored to one control - so you'll see the position of the first control that will be used as the anchor and then subsequent controls will be anchored to the first. See "Anchoring" here: https://www.fantasygrounds.com/modguide/windowing.xcp The <number_charabilityscore name="strength"> control above is anchored inside the top left of the abilityframe frame with an offset of 100,23. It also has a reference to the source of the value held in the control - this is within the FG campaign database: source="abilities.strength.score" Then, every other control is anchored off this control. There are a set number of base control types, see the "elements" sections here: https://www.fantasygrounds.com/refdoc/ but FG has a lot of templates based off these controls (and other templates), you'll frequently see templates using other templates so it can get very confusing quickly - and you'll have to use find-in-files across rulesets to find out what's going on.

For example, the <template> for "string_charabilitylabel" is:


<template name="string_charabilitylabel">
<label>
<anchored position="lefthigh" width="85" height="20" />
<static />
</label>
</template>

This uses another template: <label> which is found in the template_common.xml file in CoreRPG:


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

And this uses a <stringcontrol> control - which, thankfully for this example, is a base FG element: https://www.fantasygrounds.com/refdoc/stringcontrol.xcp

Back to our "string_charabilitylabel" control, the template simply defines that it is anchored "lefthigh" and has a static width and height and the <template name="label"> defines the <stringcontrol>, height (again) font and a couple of properties. The main things here are the anchored position and the width/height. See the "Anchoring Shorthand notation" section here for info on "lefthigh": https://www.fantasygrounds.com/modguide/windowing.xcp"

Finally, the <string_charabilitylabel> control has the <static textres="strength" /> property - this defines the actual text to use in the label. This uses a <textres> entry, which is referring to a separate file that has all of the text resources - this is done so that translation is easier to do as just the textres entries need to be changed. You'll find the <string name="strength">Strength</string> entry in the 3.5e ruleset, strings\strings_35.xml file.

Phew! There you go, hopefully that wasn't too confusing. Just step through things methodically, don't expect to be able to just jump in and be coding a character sheet in 2 minutes. I'd suggest you do the following:


Create a new tab in the recordchar.xml file - with its associated <windowclass> reference.
Copy one of the existing <windowclass> entries and modify this - remove a lot of the controls to get down to a basic layout. Don't remove the anchor controls though!

Lundgren
January 30th, 2015, 16:04
Take a look at the 3.5e ruleset as an example. This has a lot of controls in it, but is a good example of many ways of displaying controls - try to tune out the stuff that you're not interested in. I know you've said you want to do this within CoreRPG - but there is not a good bunch of ready examples of control placement in CoreRPG. Once you get to grips with it in 3.5e you can transfer the code (and templates if you need to) toy CoreRPG.
Thank you :)

The 3.5e ruleset is one of those I've been looking at, and just got confused and overwhelmed. But with your post, I might be able to start hack my way through it (or at least be able to formulate more specific questions). So while not what I asked for, it might be a good angle of attack from the opposite direction :D

Trenloe
January 30th, 2015, 16:30
So while not what I asked for, it might be a good angle of attack from the opposite direction :D
Sorry, I'd rather teach you how to fish than give you a big smelly fish! ;)

Plus, 3.5e has soooo many controls on the character sheet that it has lots of good examples - open up a 3.5e character sheet in the Fantasy Grounds application, find something that looks like what you want to do and then find the relevant control/s in the XML file to see how it works. CoreRPG is great as a freeform character sheet but, because it is freeform, it has very few examples of how to define static controls - that's why looking at rulesets with defined character sheets is a good place to start - just look at individual control definitions, try not to get overwhelmed with the number of controls; most of them are just the same control used again and again.

Valarian
January 30th, 2015, 16:33
Crumbs, I was going to offer a Skype session or a Hangout. Trenloe's written an essay on the subject :)

Lundgren
January 30th, 2015, 17:03
Sorry, I'd rather teach you how to fish than give you a big smelly fish! ;)
If I got what I asked for, it would have been a fishing pole and a good spot to fish at. What I got was a good description to where I could buy an axe, a knife, a hook and a line; combined with an instruction on what type of small tree that makes a good pole and a description on where to find water to fish in and what to look for to find a good spot. ;)

So I guess I should start working on my fishing tools :)

Lundgren
January 30th, 2015, 17:08
Crumbs, I was going to offer a Skype session or a Hangout. Trenloe's written an essay on the subject :)
I'm sort of on a dance class frenzy, so it would have been a few days until I would have time for a more direct communication style (currently posting during small gaps at work). But thanks for the thought :)

Trenloe
January 30th, 2015, 17:31
If I got what I asked for, it would have been a fishing pole and a good spot to fish at. What I got was a good description to where I could buy an axe, a knife, a hook and a line; combined with an instruction on what type of small tree that makes a good pole and a description on where to find water to fish in and what to look for to find a good spot. ;)

So I guess I should start working on my fishing tools :)
So I'm guessing you actually haven't gone through my post in detail? The code snippets I included show you how to do a lot of what you asked for in post #5 - it shows how to add a group box on the main tab (check) , it shows how to add a Strength label (check), it shows how to add a strength field where you can enter a value for strength (check). Basically what is highlighted here:

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/3.5e%20Strength%20field.JPG

Definitely giving you the tools to go fishing!

Putting it all together for you in a usable package would have taken me at least another hour of my valuable time and you probably would have come back with a bunch of questions about how it all hangs together, how templates work, what bounds and anchoring are etc..

Lundgren
January 30th, 2015, 18:42
Definitely giving you the tools to go fishing!

Putting it all together for you in a usable package would have taken me at least another hour of my valuable time and you probably would have come back with a bunch of questions about how it all hangs together, how templates work, what bounds and anchoring are etc..
I think you misinterpreted me. It was a "Yes, you taught me how to fish and more." But metaphors sometimes tend to not carry well over Internet, even if it isn't as bad as irony.

So I'm really grateful for your post. I have not had time to dig into the files yet, but your text have already made it a lot clearer to me. :)

Trenloe
January 30th, 2015, 18:51
I think you misinterpreted me. It was a "Yes, you taught me how to fish and more." But metaphors sometimes tend to not carry well over Internet, even if it isn't as bad as irony.

So I'm really grateful for your post. I have not had time to dig into the files yet, but your text have already made it a lot clearer to me. :)
Yeah, sorry - I was reading that providing you too much info was a problem. Sorry for the misunderstanding and for clearing that up. :)

damned
January 30th, 2015, 21:58
Not what I was looking for, but something I most likely will find useful in the future. :)

It is the XML files, or file, to create something like this I'm looking for.

8907

Just a sheet with as few things as possible, so I can see what I need to do so the XML-file is called and how to put a few elements on there. If we were talking about driving, I'm at the "Okay, but how do I open the door?" level :)

Sorry - I *know* thats not what you were after - I posted it because a lot of people underestimate how much can be done with CoreRPG and no coding.
You still get all of CoreRPGs goodness you just have to trial a few different ways of displaying your stats and setting up your rolls.

damned
January 30th, 2015, 22:01
you can download Trail of Cthulhu or Extinction Event from the https://www.fantasygrounds.com/wiki/ and see the Character Sheet modifications they have done.
couple those examples with Trenloes directions and you will be able to configure what you want.
be aware - it is probably going to take you a lot longer than you think it will...

Moon Wizard
February 3rd, 2015, 21:27
I would look at Numenera for a much simpler execution of a ruleset. It doesn't have as much automation, since Numenera is a rules-light system; and it has custom character/NPC sheets.

Cheers,
JPG

damned
February 3rd, 2015, 22:19
i still really struggle with <windowclass> and with <rightanchor>.... any pointers on either of these...


https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-5.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

Trenloe
February 4th, 2015, 03:46
i still really struggle with <windowclass> and with <rightanchor>.... any pointers on either of these...
A <windowclass> is generally a set of XML definitions that define what goes in a window (a frame, controls, etc.) - this could be a complete window, a window within a window, a row within a windowlist and other such stuff. The text in the windowclass entry in the developer's guide gives some techie description: https://www.fantasygrounds.com/refdoc/windowclass.xcp

This might get complex - take your time to read through this, take time to look at the code and the documentation referenced, look at the screenshots, load up FG and see how the dynamic anchoring works. <rightanchor> is usually a control that is on the right hand side of a window/subwindow/row/etc. it usually isn't visible. It is used as an anchor for other controls that are tied the the right hand side of a window (usually dynamic controls such as the iAdd and iDelete controls that appear when you press the brown / button to enter edit mode). See the "Anchoring" section here: https://www.fantasygrounds.com/modguide/windowing.xcp What probably isn't helping you understand the fill structure is that most of the time controls anchored on an anchor control have "relative" anchoring - this means that the seconds control to have relative anchoring off <rightanchor> will actually use it's position offsets off the first control to have relative anchoring off <rightanchor>, then the third control to have relative anchoring off <rightanchor> will use it's offsets from the second relative control, and so on. It allows controls to be dynamically placed as other controls (the best example is the iAdd and iDelete controls I mentioned above) are enabled and disabled.

A good example of this is the inventory tab in a PC in the CoreRPG ruleset. Click the brown / button in the top right of the main item section of this tab, you'll see that the green iAdd button is added to the header row and everything to the left (except the # on the far left) shifts left to make room for the button. You can see this in the charsheet_inventory windowclass, all of the heading controls are anchored to <rightanchor> (with the exception of the # heading control and rightanchor itself).


<windowclass name="charsheet_inventory">
<sheetdata>
<frame_char name="inventoryframe">
<bounds>15,0,-29,-205</bounds>
</frame_char>

<label name="count_label">
<anchored to="inventoryframe" position="insidetopleft" offset="20,10" width="20" />
<center />
<static>#</static>
</label>
<genericcontrol name="rightanchor">
<anchored to="inventoryframe" width="0" height="0">
<top offset="10" />
<right offset="-20" />
</anchored>
<invisible />
</genericcontrol>
<genericcontrol name="idelete_header">
<anchored to="rightanchor" width="20" height="20">
<top />
<right anchor="left" relation="relative" offset="-5" />
</anchored>
<disabled />
</genericcontrol>
<genericcontrol name="shortcut_header">
<anchored to="rightanchor" width="20" height="20">
<top />
<right anchor="left" relation="relative" offset="-2" />
</anchored>
<disabled />
</genericcontrol>
<genericcontrol name="carried_header">
<anchored to="rightanchor" width="12" height="10">
<top offset="5" />
<right anchor="left" relation="relative" offset="-5" />
</anchored>
<icon>char_encumbrance</icon>
<tooltip textres="char_tooltip_itemcarried" />
</genericcontrol>
<label name="weight_label">
<anchored to="rightanchor" width="30">
<top />
<right anchor="left" relation="relative" offset="-10" />
</anchored>
<center />
<static textres="char_label_itemweight" />
<tooltip textres="char_tooltip_itemweight" />
</label>
<label name="location_label">
<anchored to="rightanchor" width="80">
<top />
<right anchor="left" relation="relative" offset="-10" />
</anchored>
<center />
<static textres="char_label_itemlocation" />
</label>
<label name="name_label">
<anchored to="rightanchor">
<top />
<left parent="inventoryframe" offset="55" />
<right anchor="left" relation="relative" offset="-5" />
</anchored>
<static textres="char_label_itemname" />
<center />
</label>

The <rightanchor> control is 10 down from the top of the frame and 20 in from the right (offset = -20), and this control is invisble:

<genericcontrol name="rightanchor">
<anchored to="inventoryframe" width="0" height="0">
<top offset="10" />
<right offset="-20" />
</anchored>
<invisible />
</genericcontrol>

Every control is then anchored from this in the order they are defined in the <windowclass). idelete_header is the first:

<genericcontrol name="idelete_header">
<anchored to="rightanchor" width="20" height="20">
<top />
<right anchor="left" relation="relative" offset="-5" />
</anchored>
<disabled />
</genericcontrol>

This control is anchored to <rightanchor> and has it's right side anchored to the left of <rightanchor> with a relative offset of -5 (5 to the left). As this is the first relative control that is anchored to <rightanchor> then it will take it's position directly from <rightanchor>. However, just to confuse the matter, this control is currently disabled - so it is not counted in the <relative> anchoring at this point - if it was enabled, then it would take it's place first in the anchroing to <rightanchor> and everything would shift to the left.

The next control "shortcut_header" is also disabled.

The next control isn't disabled, so this is the first control active that is using a relative anchor to <rightanchor>:

<genericcontrol name="carried_header">
<anchored to="rightanchor" width="12" height="10">
<top offset="5" />
<right anchor="left" relation="relative" offset="-5" />
</anchored>
<icon>char_encumbrance</icon>
<tooltip textres="char_tooltip_itemcarried" />
</genericcontrol>

The right side of this control will be -5 pixels from <rightanchor> - i.e. 5 pixels to the left.

Then the next control:

<label name="weight_label">
<anchored to="rightanchor" width="30">
<top />
<right anchor="left" relation="relative" offset="-10" />
</anchored>
<center />
<static textres="char_label_itemweight" />
<tooltip textres="char_tooltip_itemweight" />
</label>

This, like the others, has relative anchoring to the <rightanchor> control. As it has relative anchoring it will not be anchored directly to <rightanchor> but to the last control that used relative anchoring to <rightanchor>, in this case "carried_header". So, "weight_label" will have it's right side anchored -10 pixels from the left side of "carried_header".

Then "location_label" will be 10 pixels to the left of "weight_label":

<label name="location_label">
<anchored to="rightanchor" width="80">
<top />
<right anchor="left" relation="relative" offset="-10" />
</anchored>
<center />
<static textres="char_label_itemlocation" />
</label>

etc., etc..

This is what you see - all of the top header controls (except #) all use relative anchoring from <rightanchor> (which is invidible):

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/Inventory%20header%20-%20rightanchor.jpg

This actually makes it quite quick to add a bunch of controls to a line, and come back and add others later - you don't need to worry about the exact location of each control - just it's relative offset from the control to the right (in this example).

Also, which is where it really comes into play, it allows for dynamic control repositioning when disabled controls in the header get enabled - this example shows the iAdd (green + button) that appears when the brown / edit button is pressed. The controls to the left of the iAdd button dynamically reposition to the left based off the relative anchoring:

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/Inventory%20header%20-%20rightanchor%202.jpg

damned
February 4th, 2015, 04:13
Thank you (once again) Trenloe for all your explanations and the effort you put into them.

Here is my example -
The Trail of Cthulhu Ruleset is a CoreRPG based Ruleset.
Someone else is adding some code to add weapons and some combat tracker stuff to it.

I added in a new frame and new column titles.
I want to add a new WeaponsList above Inventory as per below.
https://www.fg-con.com/wp-content/uploads/2015/02/sferguson.jpg

This may not be a good example as this is an extension running on top of a CoreRPG ruleset running on CoreRPG...
The inventory frame actually uses the CoreRPG inventory list - running from CoreRPG - with some extra columns running in TrailOfCthulhu.

I added this frame to the existing windowclass but then when I tried to add a weaponslist it kept adding the inventory list...
I tried to add a new windowclass but then the right anchor wont find the new windowclass...
I looked for where the windowclass is referenced - there is a reference in record_char.xml but then it only references one windowclass on that tab...

<subwindow name="inventory">
<bounds>0,65,-1,-10</bounds>
<class>charsheet_inventory</class>
</subwindow>
and there is already 5 other windowclass definition in the tab.

youre confused?
so am I!

Attached is partial extension - without the windowclass and weaponslist...



https://www.fg-con.com/wp-content/uploads/2015/02/fg-con-6-150-13.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

Trenloe
February 4th, 2015, 04:52
I looked for where the windowclass is referenced - there is a reference in record_char.xml but then it only references one windowclass on that tab...

<subwindow name="inventory">
<bounds>0,65,-1,-10</bounds>
<class>charsheet_inventory</class>
</subwindow>
and there is already 5 other windowclass definition in the tab.

windowclasses can contain other windowclasses - usually via the <windowlist> or <subwindow> element.

When you were adding your weapon windowlist, you had a <class> of list_charweapons - this is a windowclass that defines the rows within the windowlist. I can't see this defined anywhere. You need to define the layout of the rows in a windowlist using a windowclass. See the "list_charinv" template in CoreRPG campaign\template_char.xml for an example of the inventorylist windowlist - this uses the char_invitem windowclass to define the controls in each row in the windowlist. char_invitem is in CoreRPG campaign\record_char_inventory.xml - you'll need to create a similar windowclass for your weapon entry rows.

damned
February 4th, 2015, 05:00
that list_charweapons definition is in the template-char2.xml file including in that extension.
i will go back and look at the coreRPG file.... it might not be for a couple of days...
snowed... under...

thank you again.



https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-11.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

Trenloe
February 4th, 2015, 05:17
that list_charweapons definition is in the template-char2.xml file including in that extension.
Yeah, but this is a template, not a windowclass (and there's lots of other stuff wrong with it, but I won't go into that).

<template name="list_charweapons">
<windowlist>
<datasource>.weaponslist</datasource>
<class>list_charweapons</class>
<allowdelete />
<script file="" />
</windowlist>
</template>
When you get time to look at this again, look at the CoreRPG inventory windowlist and row windowclass I mention above. This is the <windowlist> and row <windowclass> entries that provide good examples of what you are trying to do.

Lundgren
February 8th, 2015, 00:23
I've been a bit down with a cold or something. But I did hack the Numenara sheet down to what I asked for earlier (will probably be good to test ideas on :) ). But the relative anchoring didn't work as I expected. :confused: From a bit of searching, I found some older threads mentioning they could be wonky, so some avoided them. Still some issues with it, or is it I who have missed something?

When using overviewframe, I expected it to look like this (I tried both the full XML and the shorthand notation) with an offset of 0,10. But that put the text at the upper left corner.

<label name="overview_label">
<anchored>
<to>overviewframe</to>
<position>insidetop</position>
<offset>0,10</offset>
<width>40</width>
</anchored>
<static>Attributes</static>
</label>


So I had to us an offset of -200,10

<label name="overview_label">
<anchored>
<to>overviewframe</to>
<position>insidetop</position>
<offset>-200,10</offset>
<width>40</width>
</anchored>
<static>Attributes</static>
</label>

9039

Lundgren
February 8th, 2015, 00:33
By the way, nice to see that the thread got used :)

And...

Yeah, sorry - I was reading that providing you too much info was a problem. Sorry for the misunderstanding and for clearing that up. :)
Glad to have it clear up :) Looking at a ruleset makes a lot more sense now, and thanks to your earlier posts I feel I can figure out how they accomplishes things. Thanks again :)

damned
February 8th, 2015, 02:19
9039

You might have also got there using a <center /> tag somewhere between the <anchored> tags.

Something else to consider is not using <static> tags if you are building something that might get converted to another language.



https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-1.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

damned
February 8th, 2015, 09:17
Ok... progressing (hopefully)... but stuck again.

https://www.fg-con.com/wp-content/uploads/2015/02/wlist-help.jpg

I defined a window class for the weapons details:

<windowclass name="char_weapons">

and it works - I can see new lines adding into the DB but I cant see them on the screen.
The scrollbar is tiny and I cant work out how to set it to be larger etc?

Im looking at other examples of lists and they all appear to be in dedicated frames?
Perhaps I cant actually use the scroll list in this way - I cant find any examples of smaller frames on npc sheets.



https://www.fg-con.com/wp-content/uploads/2015/02/fg-con-6-150-14.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

Lundgren
February 8th, 2015, 11:18
You might have also got there using a <center /> tag somewhere between the <anchored> tags.
Ah... that is what I missed.

Thanks :)

So, for those looking for the same problem...


<label name="overview_label">
<anchored>
<to>overviewframe</to>
<position>insidetop</position>
<offset>0,10</offset>
</anchored>
<static>Attributes</static>
<center />
</label>

Or


<label name="overview_label">
<anchored to="overviewframe" position="insidetop" offset="0,10" />
<static>Attributes</static>
<center />
</label>



Something else to consider is not using <static> tags if you are building something that might get converted to another language.
I'm just using static while experimenting. One of the sheets I'm planing will be translated (if ever completed, that is...), so that was about the first thing I looked into :)

damned
February 9th, 2015, 12:56
so - ive been barking up the wrong tree a little...
many apologies Lundgren for appropriating your thread for my own use!


I dont think I can use the dynamic list and scroll bar on a partial frame - its all or nothing
I was trying to dynamically link NPC stats between NPC record and the CT entry - not the way its done in FG3 rulesets - once you drag an NPC to the CT it is its own entity - this allows you to drag multiple instances of the one NPC


So I still have a few things I need help with


I am now using the following method of adding attacks/weapons to my NPCs - similar to other CoreRPG rulesets.
https://www.fg-con.com/wp-content/uploads/2015/02/npc-weapons.jpg
I need to parse the text and break it down - eg Spear [45] [43] (2d6) Translates to
Weapon: Spear
Attack Roll (under): 45
Defense Roll (under): 43
Damage (2d6)
I have it rolling d100,d10 (%) on clicking the string but I really need help with:

Splitting string into Weapon / Attack / Defense / Damage
Comparing the Attack Roll with the Attack value
Comparing the Defense Roll with the Defense Value
Executing the Damage Roll


Initiative - I need to either make the CT INIT field clickable to roll Initiative or I need Initiative to roll automatically on Round Start.
I know C&C does this - the code looks quite complex and my first effort at stealing code from this wasnt successful.
Pointers welcome - should I go back to C&C and retry or should I make the CT clickable
https://www.fg-con.com/wp-content/uploads/2015/02/npc-ct.jpg

My Wounds were locked but once I changed the DB name they are now editable in the CT directly so that is ok now.



So if any of you kind gurus have some bandwidth available to point me in the right direction on these... Id be much obliged :)



https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-11.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

Lundgren
February 9th, 2015, 15:49
many apologies Lundgren for appropriating your thread for my own use!
Just nice it being used. It also makes it easier to find, when I'm trying to figure out the same things :D


I need to parse the text and break it down - eg Spear [45] [43] (2d6) Translates to
Weapon: Spear
Attack Roll (under): 45
Defense Roll (under): 43
Damage (2d6)
I have it rolling d100,d10 (%) on clicking the string but I really need help with:

Splitting string into Weapon / Attack / Defense / Damage
Comparing the Attack Roll with the Attack value
Comparing the Defense Roll with the Defense Value
Executing the Damage Roll

Any specific reason why you have it as one text field, instead of four separate fields from the start?

I'm still not familiar enough with LUA to whip up some code for it. But for the parsing part, you basically could:

Look for the first left bracket, then store everything before it as the weapon name (dropping any trailing spaces)
From the position of the former left bracket, look for the next right bracket. Store anything between them as the attack value
From the position of the former right bracket, look for the next left bracket (so it doesn't matter if there was a space in between them or not). From there, look for the next right bracket and store anything in between as the defense value.
From the position of the former right bracket, look for the next left parenthesis. From there, look for the next right parenthesis and store anything in between as the damage.

string.find and string.sub should work to find the positions and extract the information, if they are available in FG scripts.
So, from a "basically" point of view, it should be quite straight forward. The tricky part is to handle the input errors. Someone might add brackets in the weapon name, or using the wrong type, etc. It can easily become 10% code to handle a correctly typed string, and 90% of the code to handle all of the other odd cases that could creep up.

damned
February 9th, 2015, 19:11
Any specific reason why you have it as one text field, instead of four separate fields from the start?


This is how its done in most of the CoreRPG rulesets for NPC attacks... this allows the GM to run the NPC combat from the CT and not have to have a NOC sheet open for each NPC in the fight.