(XML) Need help with the terrain schema

Drawmeus

Emperor
Joined
Jul 25, 2007
Messages
1,213
Trying to port
Code:
		<element type="TechYieldChanges"/>

into base terrain.

In the TerrainInfo type:
Code:
		<element type="iDefense"/>
		<element type="TechYieldChanges" minOccurs="0"/>
		<element type="Button"/>

To make it validate, I've moved TechYieldChanges and all of its children up in the schema:

Code:
	<ElementType name="iYield" content="textOnly" dt:type="int"/>
	<ElementType name="Yields" content="eltOnly">
		<element type="iYield" minOccurs="0" maxOccurs="*"/>
	</ElementType>
	<ElementType name="PrereqTech" content="textOnly"/>
	<ElementType name="TechYields" content="eltOnly">
		<element type="iYield" minOccurs="0" maxOccurs="*"/>
	</ElementType>
	<ElementType name="TechYieldChange" content="eltOnly">
		<element type="PrereqTech"/>
		<element type="TechYields"/>
	</ElementType>
	<ElementType name="TechYieldChanges" content="eltOnly">
		<element type="TechYieldChange" minOccurs="0" maxOccurs="*"/>
	</ElementType>

When I launch, it works as long as I haven't put anything inside of PrereqTech. With the following data for the Grass entry in CIV4TerrainInfos.xml:

Code:
			<TechYieldChanges>
				<TechYieldChange>
					<PrereqTech>TECH_MYSTICISM</PrereqTech>
					<TechYields>
						<iYield>5</iYield>
						<iYield>10</iYield>
						<iYield>20</iYield>
					</TechYields>
				</TechYieldChange>
			</TechYieldChanges>

I get an error on startup:
Tag: TECH_MYSTICISM in Info class is incorrect.

It loads, and I can get the civilopedia and play normally.

I get no errors at all with the following changes (but obviously this won't work):
Code:
			<TechYieldChanges>
				<TechYieldChange>
					<PrereqTech/>
					<TechYields>
						<iYield>5</iYield>
						<iYield>10</iYield>
						<iYield>20</iYield>
					</TechYields>
				</TechYieldChange>
			</TechYieldChanges>

Anyone know what's up with this?
 
I have to disappoint you: This will not work.

For porting a tag from one schema to another, there's more necessary than XML.
You have to make the dll recognize, that something was changed -> this needs C++ coding in the SDK.

For the error itself: No idea :dunno:.
 
I'm well aware that I need to make it *function* in the DLL. But to test any code I need some data to read in and play with, so I need to get the XML done first, and I really have no idea what's going on with that error.

EDIT: I think the problem is some DLL work I had done.
 
I'm well aware that I need to make it *function* in the DLL. But to test any code I need some data to read in and play with, so I need to get the XML done first, and I really have no idea what's going on with that error.

EDIT: I think the problem is some DLL work I had done.

The schema should look something like this:

Code:
    <ElementType name="TerrainType" content="textOnly"/>
    <ElementType name="TerrainYields" content="eltOnly">
        <element type="iYield" minOccurs="0" maxOccurs="*"/>
    </ElementType>
    <ElementType name="TerrainYieldChange" content="eltOnly">
        <element type="TerrainType"/>
        <element type="TerrainYields"/>
    </ElementType>
    <ElementType name="TerrainYieldChanges" content="eltOnly">
        <element type="TerrainYieldChange" minOccurs="0" maxOccurs="*"/>
    </ElementType>
 
I was trying something different.

But it's rapidly becoming clear to me, unfortunately, that I'm in way over my head.
 
I was trying something different.

But it's rapidly becoming clear to me, unfortunately, that I'm in way over my head.

Most people don't start trying to add arrays of arrays, they are the rarest and toughest to add.

I'd start with some integer or boolean modifiers, not arrays.
 
I'm able to make integer and boolean modifiers work - I'm having very specific problems with the multidimensional arrays (specifically, with populating and then accessing them) which I may post about later, in detail, and ask for some hand-holding help.

Then again, I may have just recruited a software engineer or two for at least part-time help, so I may not need to clog up the boards with random questions. Here's hoping, anyway ^_^
 
Back
Top Bottom