C2C - mass XML changes parser

Combining both of our observations then, what either of us have is good as long as either I move the Religion TGA sorting above UnitCombats or you move BonusInfos above UnitCombats. Either way looks like we'd have it about the same and right at that point. Why on earth is the TGA sorting so far below ReligionInfos in the first place? You'd think they'd want to keep it right after ReligionInfos no matter what right?

I really didn't care to investigate CvXMLLoadUtility::LoadPreMenuGlobals() too much given that most of it is dealing with matters beyond my knowledge. I'm quite happy at the moment to trust your judgement on that.
 
Combining both of our observations then, what either of us have is good as long as either I move the Religion TGA sorting above UnitCombats or you move BonusInfos above UnitCombats. Either way looks like we'd have it about the same and right at that point. Why on earth is the TGA sorting so far below ReligionInfos in the first place? You'd think they'd want to keep it right after ReligionInfos no matter what right?

I really didn't care to investigate CvXMLLoadUtility::LoadPreMenuGlobals() too much given that most of it is dealing with matters beyond my knowledge. I'm quite happy at the moment to trust your judgement on that.
I've had not time to studie what ArrangeTGA can really do. For ordinary sorting there is SortAlphabetGlobalClassInfo. So I've done it like -- better safe then sorry. Still, moving ArrangeTGA will very likely work good.

And I've been saying about
Code:
if (!CreateFXml())
;)
I think you can have some feeling, what it can do in the context of
Code:
DestroyFXml();
 
Well... those two functions bracket the loading order process so I'd say it's what opens and closes an xml processing routine. Outside of that commands like:
Code:
try
Code:
GETXML->CreateFXml();
Mostly due to not quite understanding GETXML-> and how GETXML is an object reference...
and
Code:
catch(...)
Are complete mysteries to me what they actually do. Given the message it spits if something isn't right, I would assume it would be used to pick up each individual xml file but that doesn't make much sense that it can then run through the entire loading process calls afteronly picking up one file... I get that
Code:
	if (!CreateFXml())
	{
		return false;
	}
is basically saying, if I can't load this file return false to the load sequence. Then DestroyFXml then clears the ram (or whatever the proper terminology might be.)

Still... it's all rather confusing to me when it gets into this realm.
 
Mostly due to not quite understanding GETXML-> and how GETXML is an object reference...
It is a macro. Macros are just captions which are replaced with some other captions before compilation.

E.g. If you have somewhere the following
Code:
#define GETXML my_xml_variable
All occurrences of GETXML after this will replaced with my_xml_variable. Like
Code:
doc = GETXML->getDocument();
becomes
Code:
doc = my_xml_variable->getDocument();

In our case GETXML is defined as a reference to the build-in Civ4's XML parser, if we build sources as the debug, or it is a reference to CvDLLXMLRapid object in other cases.

This is the code responsible for that
Code:
//DEBUGBUILD
#ifndef _DEBUG
#define USE_RAPID_XML
#endif
#ifdef USE_RAPID_XML
CvDLLXmlIFaceBase* getRapidXML();
#define GETXML getRapidXML()
#else
#define GETXML gDLL->getXMLIFace()
#endif

CreateFXml() and DestroyFXml() - those create and destroy some FXml object that is needed for later parsing. This object just stores some data for the process.
 
IMO macros are overused in C++. Most of the time there are better ways to accomplish a task than with macros.
 
Just added

Full support for property manipulators.
You can now edit or add them inline
 
New update
- add option to edit nested tags manually (<*/> button)

It is not gret user expirence now because I have big headache but it works just refresh page after save changes.

http://hiarte.hostings.pl/civ4
 
Nimek let's say I want to create a building called Space Bandits Hideout with the tag SPACE_BANDIT_HIDEOUT.

Is there a way for the parser to prefill the necessary XMLs with the tag, and all I do us change values and fill the pedia with me only typing in that tag once in?
 
Now there is no ability to add new building/unit by parser but i plan it

prefill the necessary XMLs with the tag

You mean you only fill type tag and civilopedia, class and otger tags are autofilled with needed prefixes and suffixes?

If yes i plan this also but after mass XML changes functions. I am very close to finish it

EDIT
Added info about files when it was last edited and files edited today are marked on green now so
you will know what files to download after editing when working on multiple files
 
@Nimek
Yes, you will only need to fill the Tag once and it prefills this files with the Tag.

CIV4ArtDefines_Building
CIV4BuildingClassInfos
CIV4BuildingInfos
CIV4GameText
CIV4PropertyInfos
CIV4CivicInfos

We would only have to type the tag once.

We could have an option to add this to existing files, at the bottom.

So in the creation box:

Add Tag for Building :[textbox] X
Add Tag for Building Art Path (.dds) [textbox] X2
Add English Civiliopedia Name [textbox]E1
Add English Civilopedia Strategy [textbox] E2
Add English Civiolopedia Entry [textbox]E3
Add Advisor [textbox]AA
[button]Click for Addition Languages
[other languages]

An example:

Code:
	<Type>ART_DEF_BUILDING_[COLOR="RoyalBlue"]X[/COLOR]</Type>
			<LSystem>LSYSTEM_1x1</LSystem>
			<bAnimated>0</bAnimated>
			<fScale>0</fScale>
			<fInterfaceScale>0</fInterfaceScale>
			<NIF>Art/empty.nif</NIF>
			<KFM/>
			<Button>art/Crime/art/[COLOR="RoyalBlue"]X2[/COLOR].dds</Button>
		</BuildingArtInfo>

would be added to CIV4ArtDefines_Building at the bottom with X being the Tag and X2 being the Art Path.



Gametext
Code:
<TEXT>
		<Tag>TXT_KEY_BUILDING_[COLOR="RoyalBlue"]X[/COLOR]</Tag>
		<English>[COLOR="RoyalBlue"]E1[/COLOR]</English>
		<French>
			<Text>[COLOR="RoyalBlue"]F1[/COLOR]</Text>
			<Gender>[COLOR="RoyalBlue"]F1Gender[/COLOR]</Gender>
			<Plural>[COLOR="RoyalBlue"]F1Plural [/COLOR]</Plural>
		</French>
		<German>[COLOR="Blue"]G1[/COLOR]</German>
		<Italian[COLOR="Blue"]>I1[/COLOR]</Italian>
		<Spanish>[COLOR="Blue"]S1[/COLOR]</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_BUILDING_[COLOR="RoyalBlue"]X[/COLOR]_STRATEGY</Tag>
<English>[COLOR="Blue"]E2[/COLOR]</English>
		<French>[COLOR="RoyalBlue"]F2[/COLOR]</French>
		<German>[COLOR="RoyalBlue"]G2[/COLOR]</German>
		<Italian>[COLOR="RoyalBlue"]I2[/COLOR]</Italian>
		<Spanish>[COLOR="RoyalBlue"]S2[/COLOR]</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_BUILDING_[COLOR="RoyalBlue"]X[/COLOR]_PEDIA</Tag>
		          <English>[COLOR="Blue"]E3[/COLOR]</English>
		<French>[COLOR="RoyalBlue"]F3[/COLOR]</French>
		<German>[COLOR="RoyalBlue"]G3[/COLOR]</German>
		<Italian>[COLOR="RoyalBlue"]I3[/COLOR]</Italian>
		<Spanish>[COLOR="RoyalBlue"]S3[/COLOR]</Spanish>
	</TEXT>


BuildingInfos

Code:
<BuildingInfos>
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_[COLOR="Blue"]X[/COLOR]</BuildingClass>
			<Type>BUILDING_[COLOR="Blue"]X[/COLOR]</Type>
			<SpecialBuildingType>NONE</SpecialBuildingType>
			<Description>TXT_KEY_BUILDING_[COLOR="Blue"]X[/COLOR]</Description>
			<Civilopedia>TXT_KEY_BUILDING_[COLOR="Blue"]X[/COLOR]_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_[COLOR="Blue"]X[/COLOR]_STRATEGY</Strategy>
			<Advisor>ADVISOR_[COLOR="Blue"]AA[/COLOR]</Advisor>
                     <ArtDefineTag>ART_DEF_BUILDING_[COLOR="Blue"]X[/COLOR]</ArtDefineTag
[rest of buidnginofos code]

ClassBuidingInfos
Code:
<BuildingClassInfo>
			<Type>BUILDINGCLASS_[COLOR="Blue"]X[/COLOR]</Type>
			<Description>TXT_KEY_BUILDING_[COLOR="Blue"]X[/COLOR]</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iExtraPlayerInstances>-1</iExtraPlayerInstances>
			<bNoLimit>0</bNoLimit>
			<bMonument>0</bMonument>
			<DefaultBuilding>BUILDING_[COLOR="Blue"]X[/COLOR]</DefaultBuilding>
			<VictoryThresholds/>
		</BuildingClassInfo>
 
Another good news is that i found fast and effective way to make mass changes in multiple files at once without any concurency issues.

First functions that allows mass xml changes in multiple files should be available during next week.

After that i will update first post of this thread because than i feel parser will be ready for production use.

I love you guys ;) (and girls) All the best
 
Thanks TB. Ypur words are very motivating for work :)

Function for mass changes with multiole files support is ready.
Changes on 35 records from 2 different files takes 1.8s on my local machine so at server it would be 2 times faster. So I am very happy with resoult.

Function and everything needed is prepared.

Next step is UI to allow user for mass changes.

EDIT
I made few tweaks to mass changes function and now result is
1.35s for 761 records in 5 files (one tag value changed in each record) on my local machine

Now Iam immpressed how fast it is :)
 
Cool! By the end of the upcoming weekend it should have its work cut out for it. Have you seen the progress on the Combat Class planning doc over the weekend?
 
@TB

to be honest i didnt see because all time free i spent on parser.

New updates
- added mass changes support for boolean tags
 
New updates

  • aded ability to mass edit numeric tags
  • support for +, -, *, / operators

If ypu want for example add +20% just type *1.2 and press enter
 
New updates

  • aded ability to mass edit numeric tags
  • support for +, -, *, / operators

If you want for example add +20% just type *1.2 and press enter

If I understand right, this means that I can use the parser for the graphics rescaling now?

Where can I download parser? I want to try some things out :)
 
Gametext
Code:
<TEXT>
		<Tag>TXT_KEY_BUILDING_[COLOR="RoyalBlue"]X[/COLOR]</Tag>
		<English>[COLOR="RoyalBlue"]E1[/COLOR]</English>
		<French>
			<Text>[COLOR="RoyalBlue"]F1[/COLOR]</Text>
			<Gender>[COLOR="RoyalBlue"]F1Gender[/COLOR]</Gender>
			<Plural>[COLOR="RoyalBlue"]F1Plural [/COLOR]</Plural>
		</French>
		<German>[COLOR="Blue"]G1[/COLOR]</German>
		<Italian[COLOR="Blue"]>I1[/COLOR]</Italian>
		<Spanish>[COLOR="Blue"]S1[/COLOR]</Spanish>
	</TEXT>

There is... gender for buildings :mischief:
 
There is... gender for buildings :mischief:

Of course there is! In german it's "die Basis", the base. But it's "der Turm", the tower... and speaking of which, whereas "the sun" is female in german and "the moon" is male, in french, it is the other way round!

Same for spanish and italian... Don't ask me why this was abandoned in the english language, which, after all, is a mix of germanic anglo-saxon and latin/french language.
 
Top Bottom