Total Realism Mod Conversation into WoC

Here is the converted TR xml.

This is by no means a full conversion, but it is what the converter will get you, i.e. a separate file for each definition.

For one, you will still need to extract all texts and place them with the appropriate definitions. For another, you still will need to add all xml definitions which belong together (e.g. a resource and its art, a unit and its unit class) in one subdir (I did create the dirs already, so it is just a matter of putting the appropriate files in each dir).

You probably should also still convert the xml to BtS format, e.g. use CIV4UnitArtStyleTypeInfos instead of having each civ-specific unit as a special unit for that civ. You probably also will miss some new tags introduced by BtS (most tags are optional in WoC, but art needs all its tags).

I hope this is of some help.

Many Thanks for your help. I was actually creating XSLT to convert all the conversion i.e. the missing/additional xml tags etc.

However I see now that your converter works completely differently. It creates each unit in its own file? so that the art files can be put in the same named subfolder? That would make the conversation through XSLT a bit more difficult. Because beforehand I had a bunch of units in one file that I coudl convert in one go through XSLT. hmmm

Unless I convert them first and make them BTS compatible and then use your converter to split tham into separate files. Do you think that would work? In this case all the additional XML tags etc are added. Can the converter handle that? Is there a step for step tutorial for your converter?

Many Thanks,
Houman
 
Many Thanks for your help. I was actually creating XSLT to convert all the conversion i.e. the missing/additional xml tags etc.

However I see now that your converter works completely differently. It creates each unit in its own file? so that the art files can be put in the same named subfolder?

Yes, it takes the existing xml files and creates one file for each entity it finds (which differs from its original definition, if there is one).

It does not add tags (at most it strips tags which are identical to that of the original definition).

That would make the conversation through XSLT a bit more difficult. Because beforehand I had a bunch of units in one file that I coudl convert in one go through XSLT. hmmm

Unless I convert them first and make them BTS compatible and then use your converter to split tham into separate files. Do you think that would work?

Yes, do your XSLT translation first and then split the resulting xml files using the converter (if you do not know how to do that, post the files and I'll do it, it only takes a few minutes).

In this case all the additional XML tags etc are added. Can the converter handle that? Is there a step for step tutorial for your converter?

The tutorial is the readme ;) Read the "Splitting xml files" section, it covers what I have done.

The converter is pretty dumb, it just looks for certain tags (depending on the filename, e.g. <CivilizationInfo> for files ending in CIV4CivilizationInfos.xml) and creates a new file each time it encounters that tag.

Anything before the first occurrence and after the last corresponding closing tag is always prepended / appended to each file. All tags between the opening and closing tag are simply kept (even when they are not defined in the xml schema, so custom tags are kept).

If the entity it found exists in regular CIV, it can strip all tags which have not been changed (if you set the appropriate flag). For all new entities (i.e. ones with no corresponding standard ID), all tags are kept.
 
very interesting. From what I see the Button definition and Art definition is still old style within the Unit definition instead of Art file definition like in Warlords and not like BtS right?

The <AndDependencyTypes> is also WoC creation right? never seen it before...

Hmmm I see there is no way than reading your whole documentation (Damn am I lazy) hehe
 
very interesting. From what I see the Button definition and Art definition is still old style within the Unit definition instead of Art file definition like in Warlords and not like BtS right?

It does not convert Warlords xml to BtS xml, that is up to your XSLT. It just splits what it finds, without changing the xml itself.

The <AndDependencyTypes> is also WoC creation right? never seen it before...

Yes, the converter adds that based on what it encounters within the definition. Personally I think it has gone a bit overboard here, I only keep the most important (to me that is) dependencies around, not all that are possible (and thus added by the converter).

You should definitely keep all dependencies which refer to your own definitions, dependencies which refer to regular entities could be removed (of those I keep the most essential ones, e.g. techs or units but not terrain types).

Hmmm I see there is no way than reading your whole documentation (Damn am I lazy) hehe

It's not that long ;)
 
I have just played some TR to get reacquainted with the mod. It has been a while since I played Warlords. One thing I noticed was the extensive unit art diversity, which has been implemented in BTS as UnitArtStyle.

I was wondering, is the TR-team considering to convert their own unitartstyle or using one of the already available unitartstyles in WoC?

One thing in TR that doesn't have to be converted, is Blue Marble. You can plug in that WoC module straightaway.
 
Thank you all for your replies. Indeed the Conversion on XML part would now be tougher to be in compliant with WoC than i thought initially. But I still like to give it a try. And still i count on your help with the SDK part. So that part is at least covered. hehe

1) Sorry for my ignorance, I have downloaded the Core 1.00 and yet I see no Converter nor a Readme. Am I missing another module? I had a look on Wiki, I think its great for someone who knows WoC already, but for a beginner it still brings some challenge. Maybe things will be easier once I found your Readme. ;)

2) Thanks for the explanation regarding dependencies. I need to see how this goes. regarding the extensive Unit art diversity in TR. Thats true we have almost for every unit a civ specific one, with slightly different values. As you can see, we can not really use the UnitArtStyle in BtS, because its not just the graphics that is different but also the actual values. :) Which makes the job a bit harder. Only in very few cases we might be able to use that feature.

From all I have analyzed so far are these following steps for me to take:
1) Find your Readme and study it. hehe
2) Adjust my XSLTs to convert TR to BtS. (It is done for normal units, but not their Arts yet)
3) Create XSLTs to convert the Art files BtS Complient.
4) Find your Converter and convert all the BtS complient XMLs into WoC Format.
5) Create a SVN branch for TR_Bts_Woc and upload the first playable version, which runs only as BtS with TR Units without anything else.

This is a small and yet big step. At least our remaining team members can so keep updating the units (Textures, values, adjusting) as they usually do and have something to do. ;)

Once this is finished, I come up with a new plan for technologies and Buildings. So that step for step we are gonna finish it. :)

Cheers
Houman
 
Thank you all for your replies. Indeed the Conversion on XML part would now be tougher to be in compliant with WoC than i thought initially.

work on the conversion to BtS first, do not worry about WoC, that conversion actually will imo be relatively easy.

1) Sorry for my ignorance, I have downloaded the Core 1.00 and yet I see no Converter nor a Readme. Am I missing another module?

It is not part of the core or any module, you can get it on the SVN at

http://worldofciv.svn.sourceforge.net/svnroot/wocmodules/Tools/WoC Convertor

From all I have analyzed so far are these following steps for me to take:
1) Find your Readme and study it. hehe
2) Adjust my XSLTs to convert TR to BtS. (It is done for normal units, but not their Arts yet)
3) Create XSLTs to convert the Art files BtS Complient.
4) Find your Converter and convert all the BtS complient XMLs into WoC Format.
5) Create a SVN branch for TR_Bts_Woc and upload the first playable version, which runs only as BtS with TR Units without anything else.

These are the right steps, order should be 2, 3, 1, 4, 5 however ;) (maybe even 2, 3, 5, 1, 4 in which case 5 would be a playable version for BtS, not WoC, I'd do the latter, that way you can immediately verify that your transformation worked correctly)
 
Hello, Houman!

And still i count on your help with the SDK part. So that part is at least covered.

Well, I'd like to begin moving your SDK, but this is hardly possible without testing material; units alone are not useful for that ;).
For example, the plague feature: Either extract from TR what's necessary for buildings/whatever, and let me adapt it for WoC, or ask rockinroger to convert it (for both cases, just extract from the TR files what is relevant there). Given this, I'll be able to start working with it.
 
Hello Everyone,

I am doing some XSLT to get this little piece of work done. I am kind of stuck and was hoping you could help me out.


Input XML:

Code:
<Civ4ArtDefines xmlns="x-schema:CIV4ArtDefinesSchema.xml">
	<UnitArtInfos>
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_LION</Type>
			<fScale>0.61</fScale>
		</UnitArtInfo>
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_ZEPPELIN</Type>
			<fScale>0.70</fScale>		
		</UnitArtInfo>
	</UnitArtInfos>
</Civ4ArtDefines>


Only Certain units (e.g. Zeppelin) should be extracted and rest (e.g. Lion) should be ignored. The actual information for the "Button" for Zeppelin is stored inside my XSLT.

Expected Output XML:

Code:
<Civ4ArtDefines xmlns="x-schema:CIV4ArtDefinesSchema.xml">
	<UnitArtInfos>
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_ZEPPELIN</Type>
			<Button>Art/Interface/Buttons/Units/Zeppelin.dds</Button>
			<fScale>0.70</fScale>		
		</UnitArtInfo>
	</UnitArtInfos>
</Civ4ArtDefines>

With the XSLT below I only see an empty Button XML element in the correct position. My condition somehow doesn't pick up. Would be great if you could help me out with this one. Many thanks

XSLT:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="x-schema:CIV4ArtDefinesSchema.xml" exclude-result-prefixes="a" version="1.0">
	<xsl:output method="xml" indent="yes"/>
	<xsl:strip-space elements="*"/>	
	
	<UnitInfos xmlns="x-schema:CIV4ArtDefinesSchema.xml">
		<Unit>
			<Type>ART_DEF_UNIT_ZEPPELIN</Type>
			<Button>Art/Interface/Buttons/Units/Zeppelin.dds</Button>
		</Unit>		
	</UnitInfos>

	
	<xsl:template match="@* | node()">
		<xsl:copy>
			<xsl:apply-templates select="@* | node()"/>
		</xsl:copy>
	</xsl:template>
	
	<xsl:template match="a:fScale">
		<xsl:element name="Button" namespace="x-schema:CIV4ArtDefinesSchema.xml">
			<xsl:value-of select="document('')/xsl:stylesheet/a:UnitInfos/a:Unit/a:Button[ancestor::a:Type = document('')/xsl:stylesheet/a:UnitInfos/a:Unit/a:Type]"/>
		</xsl:element>
		<xsl:copy>
			<xsl:apply-templates select="@*|node()"/>
		</xsl:copy>		
	</xsl:template>
	
</xsl:stylesheet>
 
Sorry Im not familiar with XSLT, I use Winmerge or Araxismerge to compare 2 XML files and make changes, like adding in the new BTS tags to Warlords. I have some extra time this weekend if I could be of assistance.
 
Thanks rockinroger,

I figured out a way. Now the script works almost 100%. But still needs some finetuning.
I will be off for 2 weeks to see my parents and family. Sorry guys. :)

Cya soon again,
Houman

Code:
<xsl:stylesheet
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns="x-schema:CIV4ArtDefinesSchema.xml"
   xmlns:a="x-schema:CIV4ArtDefinesSchema.xml"
   exclude-result-prefixes="a"
   version="1.0">

	<xsl:output method="xml" indent="yes"/>
	<xsl:strip-space elements="*"/>	

         <xsl:variable name="unitInfo" 
select="document('')/xsl:stylesheet/a:UnitInfos/a:Unit"/>
	
	<UnitInfos xmlns="x-schema:CIV4ArtDefinesSchema.xml">
		<Unit>
			<Type>ART_DEF_UNIT_ZEPPELIN</Type>
	
<Button>Art/Interface/Buttons/Units/Zeppelin.dds</Button>
		</Unit>		
	</UnitInfos>

	
	<xsl:template match="@* | node()">
		<xsl:copy>
			<xsl:apply-templates select="@* | node()"/>
		</xsl:copy>
	</xsl:template>
	
         <xsl:template match="a:UnitArtInfo[a:Type = document('')/xsl:stylesheet/a:UnitInfos/a:Unit/a:Type]">
           <xsl:copy>
             <xsl:apply-templates select="@* | a:Type"/>
             <xsl:element name="Button">
               <xsl:value-of select="$unitInfo[a:Type = current()/a:Type]/a:Button"/>
             </xsl:element>
             <xsl:apply-templates select="a:fScale"/>
           </xsl:copy>
         </xsl:template>

         <xsl:template match="a:UnitArtInfo[not(a:Type = document('')/xsl:stylesheet/a:UnitInfos/a:Unit/a:Type)]"/>

	
</xsl:stylesheet>
 
Top Bottom