PDA

View Full Version : how do you get the scroll code to work?



Dragon_of_old
November 9th, 2016, 01:05
I'm making a ruleset for a game that has a total of seventy skills and about twenty are the player full out it I.E. craft: armor, craft: weapon. I want it to share the page with space where the player can write down their abilities, so there would be two spaces, one for skills and the other for abilities. If put all of the skills it will go outside of the frame so how do I give the frame a scroll bar?

Trenloe
November 9th, 2016, 01:09
Have a look at the XML in the CoreRPG ruleset. campaign\record_char_abilities.xml - the "charsheet_abilities" windowclass.

The abilities are stored in a windowlist control called "abilities" and a scrollbar (using the <scrollbar_list> template) is anchored on that windowlist:


<scrollbar_list>
<anchored to="abilities" />
<target>abilities</target>
</scrollbar_list>

Dragon_of_old
November 10th, 2016, 01:25
thank you for this, but I'm running into a problem

here is the code I'm writing, I am not very versed with XML could you give the code a once over point out where I'm dropping the ball because FG is crashing and giving a "Database Error: A XML parse error occurred processing file campaign/record_char_skills.xml - Error on line 61: Error reading end tag." which is referring to the "</sheetdata>"

File: record_char_skills.xml


<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root>
<windowclass name="charsheet_skills">
<margins control="0,0,0,2" />
<sheetdata>
<!--CCCCCCCC(skillSframe)CCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCC-->
<frame_char name="skillSframe">
<bounds>15,0,242,-5</bounds>
</frame_char>
<label_frametop>
<list_text name="skills_text">
<anchored to="skillSframe">
<left offset="15" />
<top offset="35" />
<right offset="-20" />
<bottom offset="-20" />
</anchored>
<columns width="222" filldown="true" />
<newfocus>name</newfocus>
<datasource>.skills_textlist</datasource>
<class>char_skills_text</class>
<acceptdrop>
<class>referencetext</class>
<class>referencetextwide</class>
<field>*</field>
</acceptdrop>
</list_text>
<scrollbar_list>
<anchored to="skills_text" />
<target>skills</target>
</scrollbar_list>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->
<!--CCCCCCCCC( Abilities )CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CC-->
<frame_char name="AbilitiesFrame">
<bounds>260,0,-20,-5</bounds>
</frame_char>
<label_frametop>
<anchored to="AbilitiesFrame" />
<static textres="char_label_bene_abil" />
</label_frametop>
<stringu name="Abilities">
<anchored to="AbilitiesFrame">
<top offset="30" />
<left offset="15" />
<right offset="-20" />
<bottom offset="-15" />
</anchored>
<multilinespacing>20</multilinespacing>
</stringu>
<scrollbar_list>
<anchored to="Abilities" />
<target>Abilities</target>
</scrollbar_list>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->
</sheetdata>
</windowclass>

</root>

Andraax
November 10th, 2016, 01:30
One of your "label_frametop" elements seems to be left open...

Dragon_of_old
November 10th, 2016, 02:24
*facepalm* thank you

ok what am I missing, this is the source fo the skills frame


<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root>
<windowclass name="skills_text">
<frame>referencepage</frame>
<placement>
<size width="400" height="350" />
</placement>
<sizelimits>
<dynamic />
</sizelimits>
<minimize>minimized_reference</minimize>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->

<anchor_column name="columnanchor" />
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="char_label_mecInt" />
<bounds>22,40,135,15</bounds>
</label_column>
<number_columnh name="mecInt_rnk">
<bounds>160,40,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="plus_label">
<static textres="char_label_plus" />
<bounds>181,40,15,15</bounds>
</label_column>
<number_columnh name="Int_stat">
<bounds>195,40,15,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="equl_label">
<static textres="char_label_equl" />
<bounds>215,40,15,15</bounds>
</label_column>
<number_columnh name="mecInt_tot">
<bounds>227,40,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="char_label_mecInt" />
<bounds>22,60,135,15</bounds>
</label_column>
<number_columnh name="mecInt_rnk">
<bounds>160,60,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="plus_label">
<static textres="char_label_plus" />
<bounds>181,60,15,15</bounds>
</label_column>
<number_columnh name="Int_stat">
<bounds>195,60,15,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="equl_label">
<static textres="char_label_equl" />
<bounds>215,60,15,15</bounds>
</label_column>
<number_columnh name="mecInt_tot">
<bounds>227,60,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="char_label_mecInt" />
<bounds>22,80,135,15</bounds>
</label_column>
<number_columnh name="mecInt_rnk">
<bounds>160,80,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="plus_label">
<static textres="char_label_plus" />
<bounds>181,80,15,15</bounds>
</label_column>
<number_columnh name="Int_stat">
<bounds>195,80,15,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="equl_label">
<static textres="char_label_equl" />
<bounds>215,80,15,15</bounds>
</label_column>
<number_columnh name="mecInt_tot">
<bounds>227,80,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="char_label_mecInt" />
<bounds>22,100,135,15</bounds>
</label_column>
<number_columnh name="mecInt_rnk">
<bounds>160,100,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="plus_label">
<static textres="char_label_plus" />
<bounds>181,100,15,15</bounds>
</label_column>
<number_columnh name="Int_stat">
<bounds>195,100,15,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="equl_label">
<static textres="char_label_equl" />
<bounds>215,100,15,15</bounds>
</label_column>
<number_columnh name="mecInt_tot">
<bounds>227,100,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->

</windowclass>
</windowclass>
</root>

Trenloe
November 10th, 2016, 15:40
<sheetdata> is missing.

Info on windows and control here: https://www.fantasygrounds.com/modguide/windowing.xcp

Dragon_of_old
November 16th, 2016, 00:28
thank you for that info, sorry for not replying soon.

sadly I'm still missing something every time I click on the tab it gives me these errors.

Runtime Notice: Host session started
Ruleset Error: windowlist: Could not find windowclass (char_skillsText) for control (skillsText) in windowclass (charsheet_skills)
Ruleset Error: window: Control() anchoring to an undefined control (skillsText) in windowclass (charsheet_skills)
Ruleset Error: window: Control() anchoring to an undefined control (skillsText) in windowclass (charsheet_skills)
Ruleset Error: window: Control() anchoring to an undefined control (skillsText) in windowclass (charsheet_skills)

Moon Wizard
November 16th, 2016, 00:32
There's a control inside the sheetdata tag for the charsheet_skills windowclass, that does not have a name attribute, but uses anchors to "skillsText"; and that control does not exist in the charsheet_skills windowclass.

You should be able to search for "skillsText" in the file containing charsheet_skills windowclass, and then fix up the anchors to point to a named control that exists.

Regards,
JPG

Dragon_of_old
November 16th, 2016, 01:16
thank you

Dragon_of_old
November 17th, 2016, 13:06
There is something very simple I'm missing here, and I can't nail it down.

Here is what I'm trying to achieve, I want to add a tab that has both "skills" and "benefits and abilities" this is what it looks like so far.
16434
in the "Skills" box there is the list of skills (like skill one, skill two, etc.) I have looked over the XML files of the CoreRPG, 4E and other rulesets.

Here is what I have done
1.in the "base.XML"

<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root version="3.0" release="3" logo="logo.png">
<announcement text="Iron Kingdoms RPG by Privateer Press\rRuleset by: Carl Hawkins" font="emotefont" icon="rulesetlogo_CoreRPG" />

<!-- Attributes -->
<description>
<text>Iron Kingdoms</text>
<author>Carl Hawkins</author>
<website>https://www.fantasygrounds.com</website>
</description>

<!-- Layers -->
<importruleset source="CoreRPG" />

<!-- Tabletop settings -->
<includefile source="gameelements.xml" />

<!-- Graphics -->

<!-- Strings -->
<includefile source="strings/strings_ik.xml" />

<!-- Campaign Records -->
<includefile source="campaign/record_char.xml" />
<includefile source="campaign/record_char_main.xml" />
<includefile source="campaign/record_char_skills.xml" />
<includefile source="campaign/record_char_abilities.xml" />
<includefile source="campaign/record_char_inventory2.xml" />
<includefile source="campaign/record_char_notes.xml" />
<includefile source="campaign/record_char_skillsText.xml" />

</root>
2. in the "record_char_skills.xml"

<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root>
<windowclass name="charsheet_skills">
<margins control="0,0,0,2" />
<sheetdata>
<!--CCCCCCCC(skillSframe)CCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCC-->
<frame_char name="skillSframe">
<bounds>15,0,242,-5</bounds>
</frame_char>
<label_frametop>
<anchored to="skillSframe" />
<static textres="SkillsTitle" />
</label_frametop>
<list_text name="skillsText">
<anchored to="skillSframe">
<left offset="15" />
<top offset="35" />
<right offset="-20" />
<bottom offset="-20" />
</anchored>
<columns width="222" filldown="true" />
<newfocus>name</newfocus>
<datasource>.skillsTextlist</datasource>
<class>char_skillsText</class>
<acceptdrop>
<class>referencetext</class>
<class>referencetextwide</class>
<field>*</field>
</acceptdrop>
</list_text>
<scrollbar_list>
<anchored to="skillSframe" />
<target>skillsText</target>
</scrollbar_list>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->
<!--CCCCCCCCC( Abilities )CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CC-->
<frame_char name="AbilitiesFrame">
<bounds>260,0,-20,-5</bounds>
</frame_char>
<label_frametop>
<anchored to="AbilitiesFrame" />
<static textres="baaTitle" />
</label_frametop>
<stringu name="Abilities">
<anchored to="AbilitiesFrame">
<top offset="30" />
<left offset="15" />
<right offset="-20" />
<bottom offset="-15" />
</anchored>
<multilinespacing>20</multilinespacing>
</stringu>
<scrollbar_list>
<anchored to="Abilities" />
<target>Abilities</target>
</scrollbar_list>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->
</sheetdata>
</windowclass>

</root>
3. in the "record_char_skillsText.xml"

<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root>
<windowclass name="skillsText">
<frame>referencepage</frame>
<placement>
<size width="400" height="350" />
</placement>
<sizelimits>
<dynamic />
</sizelimits>
<minimize>minimized_reference</minimize>
<tooltip field="value"/>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->
<sheetdata>
<sub_record_header name="header">
<class>char_skillsText_header</class>
</sub_record_header>

<frame_record_content name="contentframe" />

<anchor_column name="columnanchor" />
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="char_label_mecInt" />
<bounds>22,40,135,15</bounds>
</label_column>
<number_columnh name="mecInt_rnk">
<bounds>160,40,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="plus_label">
<static textres="char_label_plus" />
<bounds>181,40,15,15</bounds>
</label_column>
<number_columnh name="Int_stat">
<bounds>195,40,15,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="equl_label">
<static textres="char_label_equl" />
<bounds>215,40,15,15</bounds>
</label_column>
<number_columnh name="mecInt_tot">
<bounds>227,40,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="char_label_mecInt" />
<bounds>22,60,135,15</bounds>
</label_column>
<number_columnh name="mecInt_rnk">
<bounds>160,60,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="plus_label">
<static textres="char_label_plus" />
<bounds>181,60,15,15</bounds>
</label_column>
<number_columnh name="Int_stat">
<bounds>195,60,15,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="equl_label">
<static textres="char_label_equl" />
<bounds>215,60,15,15</bounds>
</label_column>
<number_columnh name="mecInt_tot">
<bounds>227,60,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="char_label_mecInt" />
<bounds>22,80,135,15</bounds>
</label_column>
<number_columnh name="mecInt_rnk">
<bounds>160,80,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="plus_label">
<static textres="char_label_plus" />
<bounds>181,80,15,15</bounds>
</label_column>
<number_columnh name="Int_stat">
<bounds>195,80,15,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="equl_label">
<static textres="char_label_equl" />
<bounds>215,80,15,15</bounds>
</label_column>
<number_columnh name="mecInt_tot">
<bounds>227,80,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="char_label_mecInt" />
<bounds>22,100,135,15</bounds>
</label_column>
<number_columnh name="mecInt_rnk">
<bounds>160,100,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="plus_label">
<static textres="char_label_plus" />
<bounds>181,100,15,15</bounds>
</label_column>
<number_columnh name="Int_stat">
<bounds>195,100,15,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="equl_label">
<static textres="char_label_equl" />
<bounds>215,100,15,15</bounds>
</label_column>
<number_columnh name="mecInt_tot">
<bounds>227,100,15,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<resize_referencepage />
<close_referencepage />
</sheetdata>
</windowclass>

<windowclass name="char_skillsText_header">
<margins control="0,0,0,7" />
<script>
function onInit()
update();
end
function update()
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
name.setReadOnly(bReadOnly);
end
</script>
<sheetdata>
<link_record_header>
<class>skillsText</class>
<description field="name" />
</link_record_header>

<string_record_name name="name">
<anchored>
<top offset="5"/>
<left offset="40" />
<right offset="-40" />
</anchored>
</string_record_name>

<anchor_record_header_right name="rightanchor" />
<icon_record_locked />
<button_record_locked />
</sheetdata>
</windowclass>
</root>


and I'm still getting an error
"Runtime Notice: Host session started
Ruleset Error: windowlist: Could not find windowclass (char_skillsText) for control (skillsText) in windowclass (charsheet_skills)"

I thank you for your patience in helping me with this problm.

damned
November 17th, 2016, 13:38
Hi Dragon_of_old,

It looks to me like you are not actually adding a new tab - you just want to modify the contents of the Abilities Tab and have two columns, one being the current Abilities and the second being a Notes column?

If that is the case....

Start again. Start a new extension.

In your new extension copy the /campaign/record_char_abilities.xml and change this:


<frame_char name="abilityframe">
<bounds>15,0,-29,-5</bounds>
</frame_char>

to something like this:

<frame_char name="abilityframe">
<bounds>15,0,235,-5</bounds>
</frame_char>

Then grab the code from /campaign/record_char_notes.xml for Appearance and paste it in the record_char_abilities.xml file:


<frame_char name="appearanceframe">
<bounds>15,45,320,190</bounds>
</frame_char>
<label_frametop>
<anchored to="appearanceframe" />
<static textres="char_label_appearance" />
</label_frametop>
<stringu name="appearance">
<anchored to="appearanceframe">
<top offset="30" />
<left offset="15" />
<right offset="-20" />
<bottom offset="-15" />
</anchored>
<multilinespacing>20</multilinespacing>
</stringu>
<scrollbar_list>
<anchored to="appearance" />
<target>appearance</target>
</scrollbar_list>

and change it to something like this:


<frame_char name="benefitsframe">
<bounds>265,0,-29,-5</bounds>
</frame_char>
<label_frametop>
<anchored to="benefitsframe" />
<static textres="char_label_benefits" />
</label_frametop>
<stringu name="benefits">
<anchored to="benefitsframe">
<top offset="30" />
<left offset="15" />
<right offset="-20" />
<bottom offset="-15" />
</anchored>
<multilinespacing>20</multilinespacing>
</stringu>
<scrollbar_list>
<anchored to="benefits" />
<target>benefits</target>
</scrollbar_list>

and I reckon you will be nearly done...
of course I may have completely misunderstood what you were trying to do...

Trenloe
November 17th, 2016, 17:25
"Runtime Notice: Host session started
Ruleset Error: windowlist: Could not find windowclass (char_skillsText) for control (skillsText) in windowclass (charsheet_skills)"
Have a look at what damned mentioned.

Also, you're going to need to take some time to look at the errors that are raised and work out what they are referring to - they usually point to you what the issue is. For this one, work from the back to the front: go to the "charsheet_skills" <windowclass> entry <windowclass name="charsheet_skills"> and then go to the control "skillsText" <list_text name="skillsText"> and check for where a windowclass of "char_skillsText" is being used: <class>char_skillsText</class>. This is the entry that is causing the error.

Referring back to the error message: the error message is saying that the "windowlist" contol "skillsText" can't find a windowclass called "char_skillsText".

The windowlist control is detailed here: https://www.fantasygrounds.com/refdoc/windowlist.xcp Look at the "Definition" section for details of the XML format of the control. We see that <class> (the entry causing the error) is: "The name of the windowclass that is used by default to generate the list entries". So, the control is expecting a valid <windowclass> definition it can use to build the lines in the list.

That's all the background info. Basically, the error has told us that when building the windowlist control, FG looked for a windowclass called "char_skillsText" and it couldn't find it. You will need to search for where this windowclass is defined - but I'm guessing you won't find it, as FG can't find it. Remember that FG code is case sensitive.

So - when you get an error, you need to spend time understanding the error - it's not mumbo-jumbo if you take the time to refer the error message to the XML/LUA code that is raising it. Then you will need to look at the XML/LUA and trace through the error to try to identify what is causing it.

Sorry, but there's no avoiding this - if you want to do Fantasy Grounds development you need to take the time to understand this.

Dragon_of_old
November 18th, 2016, 09:30
Here is an image Photoshopped to show what I'm trying to do.
16449

Dragon_of_old
November 18th, 2016, 09:48
Here is an image Photoshopped to show what I'm trying to do.
16449

Dragon_of_old
November 18th, 2016, 09:50
how it doing this when I click in the frame
16450

and it giving this error
Script Error: [string "common/scripts/list_text.lua"]:46: attempt to index field '?' (a nil value)

Dragon_of_old
November 18th, 2016, 10:14
so this is the address for the file right?

folder /folder /folder /file
ruleset folder/common/scripts/list_text.lua

I should be looking for "list_text.lua" file, but there is now scripts folder in common?

Dragon_of_old
November 18th, 2016, 15:31
I got working some what.

if I create a new character the skills list don't appear in the skills frame until I click in the space, then the skills list appears and give me "Script Error: [string "common/scripts/list_text.lua"]:46: attempt to index field '?' (a nil value)" I have looked at the CoreRPG and there is no scripts folder in the "common folder".
16457 16458

Trenloe
November 18th, 2016, 17:37
I have looked at the CoreRPG and there is no scripts folder in the "common folder".
There is in mine. I'd check again - common\scripts\list_text.lua is obviously running as it is raising an error on a specific line within that file.

Have you extracted CoreRPG to a directory in \rulesets or are you just using the base CoreRPG.pak.

Dragon_of_old
November 19th, 2016, 04:04
so I got the list to shows when creating a new character a command called "filldown=" and it was set to true not false.

now all is left is the command that tells the right-click that there is no delete or creates an option in the right-click menu.

Trenloe
November 19th, 2016, 05:55
now all is left is the command that tells the right-click that there is no delete or creates an option in the right-click menu.
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#registerMenuItem and https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#onMenuSelection

Lots of examples in the rulesets. Do a search in CoreRPG for registerMenuItem (sets up the menu) and onMenuSelection processes the menu.

Dragon_of_old
November 19th, 2016, 16:20
now I have a new problem, any info I put into the test character's skills will show up in a new character, and all of the changes is mirrored.
16483

Trenloe
November 19th, 2016, 17:51
now I have a new problem, any info I put into the test character's skills will show up in a new character, and all of the changes is mirrored.
Sounds like the database entries aren't being stored in the right place. Time to learn about FG's database!

Open up the campaign db.xml file in Notepad++ (or whatever you use to view XML) and look for where the data is being stored. Each should be in an individual <charsheet><id-XXXXX> section (XXXXX is the unique internal number FG uses to identify child records). So, PC one would be in <charsheet><id-00001>, PC 2 two in <charsheet><id-00002>, etc..

If it isn't then look at the <datsource> tag for the control - make sure it starts with a period, e.g. .skills - the period means that the database entry will be referenced from the main underlying database record the FG control is anchored to (usually the window data source). Without the period, the data will be stored in a single location at the root of the FG database - which might be what is happening here.

Info on the FG database here: https://www.fantasygrounds.com/modguide/database.xcp

Dragon_of_old
November 20th, 2016, 06:29
Thank you, when I was reading your reply I remember, back when I was trying to get the list to show up on character creation delete the "dot" part from <datasource>.skillsTextlist</datasource>. But I'm back to the list not showing up on a new character without clicking in the frame.

but I have "list_text.lua" file and the line of code I am going to make my "common folder" copy the list_text file and in line 46 charge "w[sFocus].setFoucus(record_skillsText.xml);" or will this break other things that use this code?

43 function addEntry(bFocus)
44 local w = createWindow();
45 if bFocus then
46 w[sFocus].setFocus();
47 end
48 return w;
49 end

Trenloe
November 20th, 2016, 07:42
But I'm back to the list not showing up on a new character without clicking in the frame.
Where/how are you populating the skills list data? Sounds like you're populating the data within the onInit() function within the skills list control? If so, you might need to move that to the window that contains the control rather than within the control itself - so when the parent window is created the data is populated, not having to wait until it is clicked (or trying to force it with the setFocus command).

Dragon_of_old
November 20th, 2016, 16:12
I'm not doing anything with the "list_text.lua" file as of yet. I took the codes from the "record_char_abilities.xml" and use it to make my "record_char_skills.xml" and "record_ability.xml" to make "record_skillsText.xml" as you suggested on 11/08/16. I have not touch any of the LUA scripts that are not in XML files not under the <script> tag.

Trenloe
November 20th, 2016, 18:00
I'm not doing anything with the "list_text.lua" file as of yet. I took the codes from the "record_char_abilities.xml" and use it to make my "record_char_skills.xml" and "record_ability.xml" to make "record_skillsText.xml" as you suggested on 11/08/16. I have not touch any of the LUA scripts that are not in XML files not under the <script> tag.
I think you're doing what I was referring too - populating the data from lower down in the GUI, which doesn't happen until you use (gain focus) to the controls.

You didn't answer my main question - where and how are you populating the data for the records shown in the windowlist control? If the data doesn't show until you click in the frame, then that means that the data isn't being populated until that point.

I think it might be best for you to post the whole code you're using, and provide steps to recreate the problem - so we can see the big picture and not just try to talk in theory about what you need to do, as I think there is a misunderstanding/disconnect somewhere here.

Dragon_of_old
November 21st, 2016, 04:04
Ok here is what I have.

base.xml file

<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root version="3.0" release="3" logo="logo.png">
<announcement text="Iron Kingdoms RPG by Privateer Press\rRuleset by: Carl Hawkins" font="emotefont" icon="rulesetlogo_CoreRPG" />

<!-- Attributes -->
<description>
<text>Iron Kingdoms</text>
<author>Carl Hawkins</author>
<website>https://www.fantasygrounds.com</website>
</description>

<!-- Layers -->
<importruleset source="CoreRPG" />

<!-- Tabletop settings -->
<includefile source="gameelements.xml" />

<!-- Graphics -->

<!-- Strings -->
<includefile source="strings/strings_ik.xml" />
<includefile source="strings/strings_ik-skills.xml" />

<!-- Campaign Records -->
<includefile source="campaign/record_char.xml" />
<includefile source="campaign/record_char_main.xml" />
<includefile source="campaign/record_char_skills.xml" />
<includefile source="campaign/record_char_abilities.xml" />
<includefile source="campaign/record_char_inventory2.xml" />
<includefile source="campaign/record_char_notes.xml" />
<includefile source="campaign/record_skillsText.xml" />

</root>

record_char_skills.xml

<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root>
<windowclass name="charsheet_skills">
<margins control="0,0,0,2" />
<sheetdata>
<!--CCCCCCCC(skillSframe)CCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCC-->
<frame_char name="skillSframe">
<bounds>13,0,242,476</bounds>
</frame_char>
<label_frametop>
<anchored to="skillSframe" />
<static textres="SkillsTitle" />
</label_frametop>
<list_text name="skillsText">
<anchored to="skillSframe">
<left offset="10" />
<top offset="25" />
<right offset="-20" />
<bottom offset="-15" />
</anchored>
<columns width="222" filldown="false" />
<datasource>.skillsTextlist</datasource>
<class>skillsText</class>
</list_text>
<scrollbar_list>
<anchored to="skillsText" />
<target>skillsText</target>
</scrollbar_list>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->
<!--CCCCCCCCC( Abilities )CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CC-->
<frame_char name="AbilitiesFrame">
<bounds>260,0,-20,-5</bounds>
</frame_char>
<label_frametop>
<anchored to="AbilitiesFrame" />
<static textres="baaTitle" />
</label_frametop>
<stringu name="Abilities">
<anchored to="AbilitiesFrame">
<top offset="30" />
<left offset="15" />
<right offset="-20" />
<bottom offset="-15" />
</anchored>
<multilinespacing>20</multilinespacing>
</stringu>
<scrollbar_list>
<anchored to="Abilities" />
<target>Abilities</target>
</scrollbar_list>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->
</sheetdata>
</windowclass>

</root>

Dragon_of_old
November 21st, 2016, 04:08
record_skillsText.xml (had to shortin to post)

<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root>
<windowclass name="skillsText">
<placement>
<size width="240" height="1760" />
</placement>
<!--CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCC-->
<sheetdata name="skillsTextlist">
<anchor_column name="columnanchor" />
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<label_column name="Skill_label">
<static textres="Alchemy" />
<bounds>0,5,153,15</bounds>
</label_column>
<number_columnh name="Int-stat">
<bounds>159,5,6,15</bounds>
<hideonvalue >0</hideonvalue>
<nokeyedit />
</number_columnh>
<label_column name="plus_label">
<static textres="plus" />
<bounds>169,5,15,15</bounds>
</label_column>
<number_columnh name="Alchemy-rnk">
<bounds>181,5,6,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<label_column name="equl_label">
<static textres="equl" />
<bounds>191,5,15,15</bounds>
</label_column>
<number_columnh name="Alchemy-tot">
<bounds>202,5,6,15</bounds>
<hideonvalue >0</hideonvalue>
</number_columnh>
<!--Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/Skills/-->
<!-- had to short this one to post -->
</sheetdata>
</windowclass>
</root>

Trenloe
November 21st, 2016, 04:10
Can you provide the whole ruleset and steps to reproduce the issue? Thanks.

Dragon_of_old
November 21st, 2016, 14:03
ok here is the pak file.
16537

Dragon_of_old
November 21st, 2016, 14:26
now for the step create the issues.
1. go to characters to create new PC.
2. when the PC is built, there will be four tabs main, skills, inventory, and notes.
3. go to skills, the window should look something like this 16538.
4. then click any in the skill frame 16539.
5. this error message will show up. Script Error: [string "common/scripts/list_text.lua"]:46: attempt to index field '?' (a nil value)
6. the the window should look like this 16540.

hope this helps.

Trenloe
November 21st, 2016, 17:38
ok here is the pak file.
16537
Thanks.

I've asked twice (three times now) for the steps to reproduce the issue you're having. Please provide these so I'm not just randomly poking around. Thanks.

Dragon_of_old
November 21st, 2016, 18:33
the step creates the issues.
1. go to characters to create new PC.
2. when the PC is built, there will be four tabs main, skills, inventory, and notes.
3. go to skills, the window should look something like this 16538.
4. then click any in the skill frame 16539.
5. this error message will show up. Script Error: [string "common/scripts/list_text.lua"]:46: attempt to index field '?' (a nil value)
6. the the window should look like this 16540.

hope this helps.

this is what I did to get the issue. is the issue not show up for you or when a new pc make the skill list up you?

Trenloe
November 21st, 2016, 19:02
Thanks, that helps a lot. :)


this is what I did to get the issue. is the issue not show up for you or when a new pc make the skill list up you?
Yep, I can recreate. Let me look into it for you...

Trenloe
November 22nd, 2016, 02:22
OK, the issue was that you were loading up a single <windowclass> into a <windowlist> with all of the skill controls hard coded into that one <windowclass>.

The best way is to build the skill list like the 5E ruleset ruleset does. It references a LUA table called "skilldata" in the scripts\data_common.lua file and builds the skills from here. It's very flexible (allows you to easily add/remove skills) and also allows the user to add/remove skills within the character sheet via the right-click menus.

Attached is the ruleset with most of this 5E code added and modified to allow the skilldata to be added dynamically. The result is this:

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=16548

Dragon_of_old
November 22nd, 2016, 13:22
Thank you, for write this LUA code I'm still trying learn LUA code. So I've been staying on the XML side of FG.

Quick question: I want the first number field to be filled in by the player's stat so if they have "3 in INT" where on the skill tab if any skill uses "INT" it will have "3" in that skill's number field.

it would look this: Alchemy-Int [3] + [ ] = [ ]

so if I put the player's stat number field in "stat =" making look like this,

[Interface.getString("Alchemy")] = { lookup = "alchemy", stat = 'Int_stat' },

would I need a reference it in the "base.xml" or point it to the "main.xml" and if so ruleset would if the code?

Dragon_of_old
November 22nd, 2016, 15:11
...

Trenloe
November 22nd, 2016, 16:42
Thank you, for write this LUA code I'm still trying learn LUA code. So I've been staying on the XML side of FG.

Quick question: I want the first number field to be filled in by the player's stat so if they have "3 in INT" where on the skill tab if any skill uses "INT" it will have "3" in that skill's number field.

it would look this: Alchemy-Int [3] + [ ] = [ ]

so if I put the player's stat number field in "stat =" making look like this,

[Interface.getString("Alchemy")] = { lookup = "alchemy", stat = 'Int_stat' },

would I need a reference it in the "base.xml" or point it to the "main.xml" and if so ruleset would if the code?
Again, I would look at the 5E ruleset as a reference - it does this for skills. 5E has a stat assigned to the skill and that stat's bonus is added to the skill, you'd just need to change it to add the actual stat value rather than a bonus based off the value (which is what 5E does).

Most of this has already been done in the 5E ruleset (or the 3.5E ruleset as well), so there is no need to invent code, use what has gone before. In 5E the scripts\data_common.lua file contains the skill information in "skilldata" (a LUA table), which includes the stat used for the skill.

I left this in the code, but blank, in the code I created above (because I thought something like this might be your next step). I've filled in a little of this in the attached updated ruleset. Look at the "skilldata" LUA table in scripts\data_common.lua, I've added a few stat entries there. I've also added a ability cycler control to the skills row that will be populated based off this "stat" value in the skillsdata table. I have not done any code to extract the value of the stat and place it in the "stat" field - that one's for you to do!

Comment: Please don't take this the wrong way... I love your ambition to take on this ruleset. But, taking a quick look through the Iron Kingdoms rulebook, I think you're being very, very ambitious by trying to do this ruleset with all of the bells and whistles. As an example: the mechanics around "social" skills will be a very difficult thing to do in the ruleset. To be perfectly honest, I'd recommend running your Iron Kingdoms games using the MoreCore ruleset, available here: https://www.fantasygrounds.com/forums/showthread.php?34860-MoreCore-Ruleset. This will allow you to get a lot of the character sheet setup without writing XML/LUA - sure it won't have Iron Kingdoms specific automation, but I honestly think that doing anything like that in code is beyond your current abilities (no offence intended - I'm just being honest from what I see in this thread). The last thing I want you to do is spend hours and hours and hours on this and then get frustrated and drop it. Developing a ruleset is 100's of hours of work (even for those of us who are experienced in FG coding). You're much better using something like the MoreCore framework to get the basics in a character sheet and allow you to play (which is the important part), and handle the complex stuff manually (just like you would if you were playing around a real table).

Dragon_of_old
November 22nd, 2016, 17:40
I think a bit off more than I can chew with the character sheet in this ruleset. The last ruleset that I made was just a place to keep details & maps in, I think it will be best to go back the drawing board for this ruleset.

Thank you for all of your help and being patient with me, I have learned a great deal from this exchange I look forward to future exchanges.

Trenloe
November 22nd, 2016, 17:46
I'd look at MoreCore: https://www.fantasygrounds.com/forums/showthread.php?34860-MoreCore-Ruleset

Damned has done an amazing job with adding a lot of extra functionality into this release. You can now do lots more with custom dice rolling, triggering tables, etc. from within the character sheet.