Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: Distributing defaultstats.xdb
Thread: Distributing defaultstats.xdb
dredknight
dredknight


Promising
Supreme Hero
disrupting the moding industry
posted June 18, 2017 12:44 PM
Edited by dredknight at 12:51, 18 Jun 2017.

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.
____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
frostymuaddib
frostymuaddib


Supreme Hero
By the power of Vivendi!
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dredknight
dredknight


Promising
Supreme Hero
disrupting the moding industry
posted June 19, 2017 06:29 PM
Edited by dredknight at 18:30, 19 Jun 2017.

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.
____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
frostymuaddib
frostymuaddib


Supreme Hero
By the power of Vivendi!
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dredknight
dredknight


Promising
Supreme Hero
disrupting the moding industry
posted June 19, 2017 07:30 PM

No it didn't. Kind of forgot to say the most important thing...
____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
frostymuaddib
frostymuaddib


Supreme Hero
By the power of Vivendi!
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dredknight
dredknight


Promising
Supreme Hero
disrupting the moding industry
posted June 19, 2017 08:10 PM

I hope you are luckier than I am and thank you for your time .
____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
frostymuaddib
frostymuaddib


Supreme Hero
By the power of Vivendi!
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dredknight
dredknight


Promising
Supreme Hero
disrupting the moding industry
posted July 12, 2017 10:27 AM

Frostymuadib, any chance you had some time to look at this?

I did try splitxml app but it kind of do the same I did manually and it still does not work.
____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Fauch
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0311 seconds