C2C - mass XML changes parser

Sorry for lazy-assing. :p

Still, can you say something about using XSLT here? I never used it for something more then toying, but it looks like a proper tool for changing multiple values at once and could be useful for easy reformatting.

(I think Thunderbrd would have a great occasion to learn C++, also. :D)

Should work fine, I agree. However, do we have anyone skilled in writing XSLT?
 
Changing globally all values of some property with a simple filter is like this. -- More or less.
Code:
<xsl:template match=
    "BuildingInfo[contains(BuildingClass, "RIVER")]/bRiver/text()">
    1
</xsl:template>

Come on. It isn't climbing Mt Everest to learn this. I know they are hurt by USA education system, but have some faith.
 
With my solution we will have UI that will allow any unskilled modder to make mass changes.

I plan to put a lot of effort to make this happen so please tell me is it worth to encourage me to do it.

For maybe tommorow i plan to filter by any xml tag and auto update xml file to most recent svn version.
Note that with this parser we can easily pass xml with buildings techs or any other.
 
With my solution we will have UI that will allow any unskilled modder to make mass changes.

I plan to put a lot of effort to make this happen so please tell me is it worth to encourage me to do it.

For maybe tommorow i plan to filter by any xml tag and auto update xml file to most recent svn version.
Note that with this parser we can easily pass xml with buildings techs or any other.

Very very cool. Can it be used to make an offline Wikipedia? Will there be a feature to create units /buildings/Techs etc by just changing values in a GUI and it saves the necessary XMLs somewhere.?


Love it!
 
This seems rather interesting, I'll have to actually see if I can help out with C2C sometime soon but this particular project interests as I've been working on something possibly similar. It is really just a way of making xml creation easier and less error prone but there is a gui in progress for it, it was for a different game but should be easily expandable to anything that uses xml. I'll be keeping track of this though as it does look rather interesting, maybe it could be used for making modmods? I don't know, just thinking of ideas.
 
Yes, quite cool Nimek.

As you can see... I've been putting in a lot of work to match the unit name as displayed to it's <Type> tag on my document. Takes a hella long time to work through our list of over 1100 units but I think it'll be worth it by the time its all said and done.

One thing I noticed with your parser is the difficulty you're having with working with multi-tags. An interesting quandry you're presented with there indeed... I'm interested to see how you work through that.
 
Some improvements

  • performance boost when filter XML (all search by TYPE and COmbat takes max 0.5s)
  • added -all- option to select lists
  • first attempt to search via nasted multiTags (just some code now)
  • added reading function for UnitClassUpgrades and UnitAIs and TechTypes and all strong nested tags
  • added header index checkboxes so you can simply decide what columns are displayed so comparision of tags is much simpler now

Why generals uniqe names are in two formats once with TXT onece without? I think I found another bug :)
http://seoexperts.pl/civ4/?Type=&Combat=UNITCOMBAT_COMMANDER
 
With my solution we will have UI that will allow any unskilled modder to make mass changes.

I plan to put a lot of effort to make this happen so please tell me is it worth to encourage me to do it.

For maybe tommorow i plan to filter by any xml tag and auto update xml file to most recent svn version.
Note that with this parser we can easily pass xml with buildings techs or any other.
Nimek, TD, please don't be so rush. There is already very powerful tool which allows xml manipulation. You can put lot of work and you won't get even a part of its possibilities.

XSLT is a tool language for transforming XMLs. You can filter very precisely, what you want to change with it. You can transform values with it -- like if you don't want set everywhere the same static value, but for example increment all values that matches the filter. You can do a complex reorganization of XML, if we would like to change globally the format in future. Sort nodes. Probably do everything we could ever need.

Yes, queries in this language need some effort to learn. But for some simple tasks you can make just shortcuts in the GUI, which will translate automatically values put by modders to this language. And still skilled modders will be able do more advanced things.
 
Nimek, TD, please don't be so rush. There is already very powerful tool which allows xml manipulation. You can put lot of work and you won't get even a part of its possibilities.

XSLT is a tool language for transforming XMLs. You can filter very precisely, what you want to change with it. You can transform values with it -- like if you don't want set everywhere the same static value, but for example increment all values that matches the filter. You can do a complex reorganization of XML, if we would like to change globally the format in future. Sort nodes. Probably do everything we could ever need.

Yes, queries in this language need some effort to learn. But for some simple tasks you can make just shortcuts in the GUI, which will translate automatically values put by modders to this language. And still skilled modders will be able do more advanced things.

XSLT is fine for the underpinnings, but we still need a GUI on top - no way most asset modders are going to become XSLT experts, so most of what Nimek is doing is needed anyway, and I suspect the actual XML manipulation part (that potentially could be done with XSLT) is actually a rather small part of the whole. As such it's rather an academic question whether XSLT gets used at all in my opinion, and if Nimek (as the person putting in their effort) wants to do it another way, that's ok.
 
XSLT is fine for the underpinnings, but we still need a GUI on top - no way most asset modders are going to become XSLT experts, so most of what Nimek is doing is needed anyway, and I suspect the actual XML manipulation part (that potentially could be done with XSLT) is actually a rather small part of the whole. As such it's rather an academic question whether XSLT gets used at all in my opinion, and if Nimek (as the person putting in their effort) wants to do it another way, that's ok.
I do not know, how looks the engine, but output is done with php. If the whole rest is also, there can be a problem as I've read PHP XSLT dies when run on big files.

Besides, I have an impression, you would allow people to do a life-long meaningless work, if they only would want to and do not even mention them, it is pointless. It is rather evil, I believe, as it shows no respect for their work. -- But I guess, I can have a wrong impression.

And yes, it is rather meaningless as raw-gui xslt processor is one day of work and adding some user-friendly shortcuts is another, or maybe two. (If libraries will cooperate.)
 
I do not know, how looks the engine, but output is done with php. If the whole rest is also, there can be a problem as I've read PHP XSLT dies when run on big files.

Besides, I have an impression, you would allow people to do a life-long meaningless work, if they only would want to and do not even mention them, it is pointless. It is rather evil, I believe, as it shows no respect for their work. -- But I guess, I can have a wrong impression.

And yes, it is rather meaningless as raw-gui xslt processor is one day of work and adding some user-friendly shortcuts is another, or maybe two. (If libraries will cooperate.)

I suggest you PM with Nimek if you feel strongly and offer to write the XSLT part for him if you have the necessary skill-base.
 
Why generals uniqe names are in two formats once with TXT onece without?

1) The Great People mod provides a picture of the great person when they are born. This relies on the name being the name of the picture file. Thus it does not work properly if the names are translated. I wil show the actual picture in some languages and the dummy or default picture in others.

2) Originally all names were added in the TXT_ format so they could be translated but that causes problems in 1)

Bottom line - people adding names don't check that the names are already there but in the other form.
 
I suggest you PM with Nimek if you feel strongly and offer to write the XSLT part for him if you have the necessary skill-base.
If there is a need, I will surely help. But I am currently far from usable state. -- High fever and awful throat pain. -- And still must work at some damn hard theory (infinite tree automata :cry:) for some foundation for new type systems. So it will need to wait.

Or at least I can help, by giving some instructions, how to write it. But it will require resignation from php. -- Thunderbrd said, he wants to learn c++. I believe, it is really nice occasion for him. Except generation XSLT and some library fighting, it's a piece of cake.

@Nimek, how does it look like from your side? Can you deal with c++ or eventually java? -- With Qt or Windows Forms making GUI in c++ isn't hard.
 
:rockon: I did it :) inline editing works :) (now only for first level tags)
Just double click on tag you want to edit.

All tags inline editing will be ready tommorow.

I am going to break. I will answear fgor everything later. Sorry
 
Now all tags are supported by inline editing :)
@n47

Core is already done and php is my native programming language :p so sorry I dont want to change it now.
Entire script is written by me from the beginning with only some jQuery code so it is fast.

Inline editing is only addition. Real purpose is to add mass changes from csv file and to be able to filter xml tags to find bugs.

Everything is simple when you dont do it. In reality it becomes complicated when you doing it first time. Also i decided to php because this parser will be useful in my job.
 
Is your link updated with the new stuff in it?

JosEPh
 
Xml file is only for testing but it is almost up to date.
File uploading is another step after UI formating and some usefully code tweaks.

Code is always up to date.
 
So you're not ready to put it out for general use yet.

Thought I'd ask though.

JosEPh
 
Top Bottom