Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 XML Customization » XML Editor Update: Let me deal with this! (The XML Editor is awfully old. I would like update it.)
XML Editor Update: Let me deal with this![message #357645] Sun, 14 July 2019 23:33 Go to next message
XeMessiah

 
Messages:6
Registered:July 2019
Dear forum,

I guess almost everybody, who ever tried to create their own weapons, explosives or anything represented in typical .xml files provided within v1.13 GameDirs, has already been struggling with the complexity that comes with modifying .xml files without a sufficient xml editor. Probably, we don't have to argue that it would be awesome to have an up-to-date version of the existing XML Editor (XE) solution.

Today, I inspected the latest code revision of XE, created call & type/class graphs, dependency overviews and other useful stuff in order to comprehend how XE works.
Furthermore, I tried to compile XE with the latest Data-1.13 directory and it worked (after some adjustments had to be made ;) ).

I definitely feel able to update XE and I'd like to assume this task. I'm not sure, how long this will take since I don't have that much time but anyway, I will take what time it needs for the sake of the JA2 community.

However, to efficiently update XE, I need some insight in how exactly the xml file structure differs.
Of course, it would be possible to compare svn states, but I hope that there might be some information regarding the evolution of the xml structure already.

I'm looking forward to receive any useful responses ;)

[Updated on: Mon, 15 July 2019 02:09]

Re: XML Editor Update: Let me deal with this![message #357646 is a reply to message #357645] Mon, 15 July 2019 02:19 Go to previous messageGo to next message
sevenfm

 
Messages:1935
Registered:December 2012
Location: Soviet Russia
@XeMessiah looking through gamedir svn commits from stable 7609 to actual version will show all differences, you probably only need to check for Items folder and Lookup folder.
https://ja2svn.mooo.com/source/ja2_v1.13_data/GameDir
I doubt there's a XML diff table ready somewhere.



7609+fix | 7609+AI (r1180) | Unofficial modpack | Win8+ fix | Experimental project | Youtube

"It's already "dog-eat-dog", friend. Not sure what worse a bunch of zombies could do."


Re: XML Editor Update: Let me deal with this![message #357666 is a reply to message #357645] Fri, 19 July 2019 03:17 Go to previous messageGo to next message
XeMessiah

 
Messages:6
Registered:July 2019
@sevenfm Thank you! I really appreciate every helpful information.

Could anybody please elaborate why the xml editor adds these nothing items?
Re: XML Editor Update: Let me deal with this![message #357670 is a reply to message #357666] Fri, 19 July 2019 11:28 Go to previous messageGo to next message
silversurfer

 
Messages:2601
Registered:May 2009
The editor will show all defined items even if they are just dummy entries named "nothing".



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: XML Editor Update: Let me deal with this![message #357674 is a reply to message #357670] Sun, 21 July 2019 16:54 Go to previous messageGo to next message
XeMessiah

 
Messages:6
Registered:July 2019
@silversurfer: I agree that the editor shows dummy items. However, by "adding", I ment why adding/copying items infers the creation of dummy items. Do we really need dummy items in order for JA2 to correctly parse all items? Or do we only need certain dummy items and not all of them? I recall the editor's working set growing fast when adding or---for the sake of convenience---copying items due to these dummy items. I really like to keep the overall number of items close to the number of items that are not dummy items.

Another point I'd like to mention:
I will be using git instead of svn, since I am used to it.
Anyway, I could imagine to push certain release candidates to svn as well, but before I decide to do this, I really like to encourage the maintainer of the ja2svn server to use letsencrypt instead of self-signed TLS certificates. Would be great for this forum to employ crypto via TLS as well. I mean, this is 2019 ;)

[Updated on: Sun, 21 July 2019 17:06]

Re: XML Editor Update: Let me deal with this![message #357675 is a reply to message #357674] Sun, 21 July 2019 17:37 Go to previous messageGo to next message
silversurfer

 
Messages:2601
Registered:May 2009
At least some of the dummy items are leftovers from items that have been used in the past. They probably need to remain so maps that still refer to them don't crash the game or something.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: XML Editor Update: Let me deal with this![message #357698 is a reply to message #357675] Fri, 26 July 2019 22:32 Go to previous messageGo to next message
Fallaxia

Messages:2
Registered:July 2019
Location: Germany
@XeMessiah,

I just would like to ask: Did you already make progress on getting the XML Editor useable again?
Re: XML Editor Update: Let me deal with this![message #357721 is a reply to message #357645] Sun, 28 July 2019 16:06 Go to previous messageGo to next message
XeMessiah

 
Messages:6
Registered:July 2019
@Fallaxia: Yes, I did. As a first step, I re-enabled the editor to load the most actual files. Therefore, I needed to change some 32bit ints to 64bit ints. Furthermore, I added information regarding new xml entries in order for them to not be deleted. But its still not in a state that is releasable and its an ongoing progress. Unfortunately, I only have time on sundays and even then only little time. But regarding years we all have been waiting to get an update on the editor, I guess its worth waiting to get a sufficient update and not something coded badly. So bear with me big grin

[Updated on: Sun, 28 July 2019 18:39]

Re: XML Editor Update: Let me deal with this![message #357996 is a reply to message #357645] Tue, 03 September 2019 13:23 Go to previous messageGo to next message
XeMessiah

 
Messages:6
Registered:July 2019
Hey everybody,

here's some news and a little request for help/information.

The editor is now able to:
- correctly load most of the xml files that it "knew" about in 2014
- save the data in the required form

There is still some stuff missing, so that I won't upload it already. However, I'm happy with the progress so far.

Here's my question:
To automatically test, whether files saved by the editor differ significantly from the files given by the latest GameDir, I need to change the given files a litte bit.

E.g., lets regard the Items.xml file STANDING_MODIFIERS section.
The editor always includes empty sections in the form of <STANDING_MODIFIERS />, if no according data is given. An equivalent way to mark such sections empty is two write subsequent xml tags in the form of:
<STANDING_MODIFIERS>
</STANDING_MODIFIERS>
Of course, there must be no data between these two xml tags.

Another point is that the GameDir xml files often do not carry xml entries with default values, but the xml editor will always include default values.

Obviously, in order to compare xml files, it would be easier two ensure input and output files to have the same form.
Fortunately, its easy to adjust the original xml files regarding such simple deviations.

Anyway, I have some trouble with the Drugs.xml file. For instance, the "Energy Booster" does not carry the "chance" entry in its DRUG_EFFECT sections.
I assume, it does not have to since its effect will always be applied. Since the xml editor will add the "change" entry, I need to adjust the GameDir Drugs.xml file such that it carries default chance values.

What would default values of all entries in Drugs.xml be? Could I simply include a chance value of 100, where an effect is to be always applied?

Moreover, because there is now "empty" DRUG_EFFECT ID, could I simply add a DRUG_EFFECT section with ID=0 and chance=0 to be a non-applied default section?

I'm looking forward to any help ;)


Re: XML Editor Update: Let me deal with this![message #357997 is a reply to message #357996] Tue, 03 September 2019 16:18 Go to previous messageGo to next message
silversurfer

 
Messages:2601
Registered:May 2009
You can look at the game source code. In Tactical\XML_Drugs.cpp you will find definitions like this:

		else if ( pData->curElement == ELEMENT &&
				  (strcmp( name, "DRUG_EFFECT" ) == 0) )
		{
			pData->curElement = ELEMENT_DRUG_EFFECT;

			// start of a new element: set default values
			pData->drug_effects.effect = 0;
			pData->drug_effects.duration = 0;
			pData->drug_effects.size = 0;
			pData->drug_effects.chance = 100;
				
			pData->maxReadDepth++;
		}

These are the defaults which are overwritten by the values from the xml.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: XML Editor Update: Let me deal with this![message #357998 is a reply to message #357645] Tue, 03 September 2019 20:44 Go to previous message
XeMessiah

 
Messages:6
Registered:July 2019
@silversurfer: Thank you!
Previous Topic: AmmoTypes.xml
Next Topic: XML Editor Changelog
Goto Forum:
  


Current Time: Sun Sep 22 09:09:48 EEST 2019

Total time taken to generate the page: 0.01288 seconds