|
Thread: Distributing defaultstats.xdb | |
|
dredknight
Honorable
Supreme Hero
disrupting the moding industry
|
posted June 18, 2017 12:44 PM |
|
|
Distributing defaultstats.xdb
Hello everyone,
While working the NCF necromancy addon I bumped into an issue.
All links for alive-to-undead creatures are located in defaultstats which hardcodes it for the NCF utility. Basically I have to overwrite the file which will clean any changes made by mods.
One way to solve the problem is to divide the file in 2:
- defaultstats.xdb - evething in xdb.
- TransformTable.xdb - which will include alive-to-undead links.
What I failed to do so far is to link TransformTable to defaultstats.
Here is a snippet of what the defaultstats looks like originally.
Quote:
... some code...
<TransformTable>
<Item>
<Dead>CREATURE_ACIDIC_HYDRA</Dead>
<Rise>CREATURE_LICH_MASTER</Rise>
</Item>
<Item>
<Dead>CREATURE_ANGEL</Dead>
<Rise>CREATURE_BONE_DRAGON</Rise>
</Item>
... many more entries like this....
</TransformTable>
...other code...
After the change defaultstats.xdb will look like this:
Quote:
<TransformTable>
....some code to include TransformTable.xdb....
</TransformTable>
TransformTable.xdb will have just the item entries inside.
I dig around what XML can offer:
- Xinclude - which unfortunately is an addon. Doesnt break the parser but it does not work.
- Entity command - which for some reason is not accepted by the parser and crashes the game when a map is started.
-
xs:include - it does not break the parser but it does not work.
- Href reference like this:
<TransformTable href="TransformTable.xdb#xpointer(/TransformTable)"/>
where TransformTable.xdb is
Quote: <TransformTable>
...Items code...
</TransformTable>
Correct me if I am wrong but this is not working as it changes the scheme structure by adding an additional link.
If anyone has any idea or has experience with XML I would be thankful for any advise.
____________
Join our official discord channel | NCF Utility Beta
|
|
frostymuaddib
Promising
Supreme Hero
育碧是白痴
|
posted June 19, 2017 09:37 AM |
|
|
Nival wrote it's own XML parser for H5, that expects specific types of XML documents. My bet is that they did not implement XInclude functionality, as they probably didn't need it. (They did something similar with their lua interpreter: it is a simplified one in H5 with far less functionalities that standard one).
Did you add this xmlns:xi="http://www.w3.org/2001/XInclude" to the first tag in defaultstats:
something like this <RPGStats xmlns:xi="http://www.w3.org/2001/XInclude" ObjectRecordID="1">
If you haven't try it, maybe it will make Xinclude work.
As for <TransformTable href="TransformTable.xdb#xpointer(/TransformTable)"/>
you should also try it, but it depends if they expect href attribute in TransformTable tag. Worst case scenario, it will be just ignored, and nothing will happen.
____________
"Occam's shuriken: when the answer is elusive, never rule out ninjas." -- Dr. Gordon Freeman (Freeman's Mind)
"lol" -- VERRIKER VON ERWINSSEN
|
|
dredknight
Honorable
Supreme Hero
disrupting the moding industry
|
posted June 19, 2017 06:29 PM |
|
|
Many thanks for the help frostymuaddib .
frostymuaddib said:
Did you add this xmlns:xi="http://www.w3.org/2001/XInclude" to the first tag in defaultstats:
something like this <RPGStats xmlns:xi="http://www.w3.org/2001/XInclude" ObjectRecordID="1">
I set it and used this down in the xdb:Quote:
<TransformTable>
<xi:include href="TransformTable.xdb"/>
</TransformTable>
Where transformtable.xdb consists of ITEMS for live and dead links.
frostymuaddib said:
As for <TransformTable href="TransformTable.xdb#xpointer(/TransformTable)"/>
you should also try it, but it depends if they expect href attribute in TransformTable tag. Worst case scenario, it will be just ignored, and nothing will happen.
I tried many iterations but nothing happened. I suspect it adds another branch to the tree which is not what the parser wants.
____________
Join our official discord channel | NCF Utility Beta
|
|
frostymuaddib
Promising
Supreme Hero
育碧是白痴
|
posted June 19, 2017 07:28 PM |
|
|
Did the first thing worked?
____________
"Occam's shuriken: when the answer is elusive, never rule out ninjas." -- Dr. Gordon Freeman (Freeman's Mind)
"lol" -- VERRIKER VON ERWINSSEN
|
|
dredknight
Honorable
Supreme Hero
disrupting the moding industry
|
posted June 19, 2017 07:30 PM |
|
|
|
frostymuaddib
Promising
Supreme Hero
育碧是白痴
|
posted June 19, 2017 07:31 PM |
|
|
As I feared
Well, I'll play with that these days, when I have some time. Maybe we can make something work.
____________
"Occam's shuriken: when the answer is elusive, never rule out ninjas." -- Dr. Gordon Freeman (Freeman's Mind)
"lol" -- VERRIKER VON ERWINSSEN
|
|
dredknight
Honorable
Supreme Hero
disrupting the moding industry
|
posted June 19, 2017 08:10 PM |
|
|
|
frostymuaddib
Promising
Supreme Hero
育碧是白痴
|
posted June 19, 2017 10:42 PM |
|
|
NP man I love modding H5, I just don't have enough time.
____________
"Occam's shuriken: when the answer is elusive, never rule out ninjas." -- Dr. Gordon Freeman (Freeman's Mind)
"lol" -- VERRIKER VON ERWINSSEN
|
|
dredknight
Honorable
Supreme Hero
disrupting the moding industry
|
posted July 12, 2017 10:27 AM |
|
|
|
Fauch
Responsible
Undefeatable Hero
|
posted August 07, 2017 05:50 PM |
|
|
I remember this file was troublesome sometimes, like when making new factions, I think many values for creatures and heroes abilities were there, and when you replaced a faction, you would modify some. now the problem, when you had several modded towns, is they each came with their own defaultstats file and were thus not compatible with each other unless you made a new file for each combination of modded towns you wanted in your game.
|
|
|