sgtwhy
January 20th, 2023, 05:44
Hello all,
I'm trying to create a new "kingdom sheet" to track the parties kingdom information.
No issues with creating the window ... but it starts with (no data) in it at all.
<windowlist name="nationSkills">
<bounds>20,380,550,620</bounds>
<class>skilldetail</class>
<datasource>.nationSkills</datasource>
<allowcreate />
<allowdelete />
</script>
</windowlist>
Now, I created each skill manually (add) and then checked the db.xml file ... finding it saved in there.
and later, re-opening my campaign its pulling the data from the db.xml.
But, when I load a fresh campaign ... its just an EMPTY LIST again. :(
How do I "create" this on a fresh campaign ? (besides hacking the db.xml directly)
I tried the super obvious ones, like copying into an xml file and importing on startup ...
or using the "DB.import" command ... but no luck on either attempts.
Do I create an onInit() function for the windowlist ?
and somehow loop thru a local array of skill names ?
Or would this happen elsewhere, during loading ??
Would it use the DB.setValue or the DB.createChild functions ?
(if so, how exactly??)
I'm fairly new to LUA as well (only 1 week so far) ...
so, would appreciate any examples of how to code any relevant loop or such.
This is what it looks like in the db.xml file, if it helps.
<nationSheet>
<nationSkills>
<id-00001>
<circMod type="number">0</circMod>
<itemMod type="number">0</itemMod>
<skillName type="string">Agriculture</skillName>
<skillProf type="number">0</skillProf>
<skillStat type="string">STA</skillStat>
<skillTotal type="number">1</skillTotal>
<statBonus type="number">0</statBonus>
<statusMod type="number">1</statusMod>
<training type="number">0</training>
<tRanks type="number">5</tRanks>
</id-00001>
...
I'm trying to create a new "kingdom sheet" to track the parties kingdom information.
No issues with creating the window ... but it starts with (no data) in it at all.
<windowlist name="nationSkills">
<bounds>20,380,550,620</bounds>
<class>skilldetail</class>
<datasource>.nationSkills</datasource>
<allowcreate />
<allowdelete />
</script>
</windowlist>
Now, I created each skill manually (add) and then checked the db.xml file ... finding it saved in there.
and later, re-opening my campaign its pulling the data from the db.xml.
But, when I load a fresh campaign ... its just an EMPTY LIST again. :(
How do I "create" this on a fresh campaign ? (besides hacking the db.xml directly)
I tried the super obvious ones, like copying into an xml file and importing on startup ...
or using the "DB.import" command ... but no luck on either attempts.
Do I create an onInit() function for the windowlist ?
and somehow loop thru a local array of skill names ?
Or would this happen elsewhere, during loading ??
Would it use the DB.setValue or the DB.createChild functions ?
(if so, how exactly??)
I'm fairly new to LUA as well (only 1 week so far) ...
so, would appreciate any examples of how to code any relevant loop or such.
This is what it looks like in the db.xml file, if it helps.
<nationSheet>
<nationSkills>
<id-00001>
<circMod type="number">0</circMod>
<itemMod type="number">0</itemMod>
<skillName type="string">Agriculture</skillName>
<skillProf type="number">0</skillProf>
<skillStat type="string">STA</skillStat>
<skillTotal type="number">1</skillTotal>
<statBonus type="number">0</statBonus>
<statusMod type="number">1</statusMod>
<training type="number">0</training>
<tRanks type="number">5</tRanks>
</id-00001>
...