Trying to make my own trait.

erikg88

Warlord
Joined
Nov 15, 2003
Messages
130
Hello - I'm working on my mod right now, and it's come time to start adding in some traits.

The one that's giving me troubles, though, is my "Popular" trait. It's just like expansive, instead of giving you 2 health in each city, it gives you 2 happiness.

So I copy and pasted the Expansive trait, and replaced <iHealth>2</iHealth> with <iHappiness>2</iHappiness>. This gave me an error, since it "wasn't defined in the schema". I found the schema and tried to add it - nothing. So then I tried copy-pasting the relevant line from Notre Dame's building info, but that gave me the same error.

What am I doing wrong?
 
You won't be able to change the schema, until maybe the the SDK comes out, maybe not even then. I don't believe it is currently possible to do what you are trying to do. Sorry.
 
The Schema can be changed. While I was trying to figure out a way to get the python code to tell the difference between a .nif file and a .bik file, I considered using seperate tags for the two different file types. I was able to create a new tag (in this case "<MovieFileAlt>") and define it in the schema. The game would load and recognize it, I just couldn't then get the python to do what I wanted to do with it.

I just copied the tag
Code:
	<ElementType name="MovieFile" content="textOnly"/>
and modified it to
Code:
	<ElementType name="MovieFile" content="textOnly"/>
	<ElementType name="MovieFileAlt" content="textOnly"/>

Then I also copied just below that
Code:
	<ElementType name="ReligionInfo" content="eltOnly">
		<element type="Type"/>
		<element type="Description"/>
		<element type="Civilopedia"/>
		<element type="TechPrereq"/>
		<element type="FreeUnitClass"/>
		<element type="iSpreadFactor"/>
		<element type="GlobalReligionCommerces"/>
		<element type="HolyCityCommerces"/>
		<element type="StateReligionCommerces"/>
		<element type="Button"/>
		<element type="TechButton"/>
		[B]<element type="MovieFile"/>[/B]
		<element type="MovieSound"/>
		<element type="Sound"/>
		<element type="iOrderPriority" minOccurs="0"/>
	</ElementType>

changed that to
Code:
	<ElementType name="ReligionInfo" content="eltOnly">
		<element type="Type"/>
		<element type="Description"/>
		<element type="Civilopedia"/>
		<element type="TechPrereq"/>
		<element type="FreeUnitClass"/>
		<element type="iSpreadFactor"/>
		<element type="GlobalReligionCommerces"/>
		<element type="HolyCityCommerces"/>
		<element type="StateReligionCommerces"/>
		<element type="Button"/>
		<element type="TechButton"/>
[B]		<element type="MovieFile"/>
		<element type="MovieFileAlt"/>[/B]
		<element type="MovieSound"/>
		<element type="Sound"/>
		<element type="iOrderPriority" minOccurs="0"/>
	</ElementType>

I should think that what you want to do is possible with python. I don't have any idea how, but it should be possible.

Don't know if that helps you at all, but that is what I have found.
 
SailorLazarus said:
The Schema can be changed. While I was trying to figure out a way to get the python code to tell the difference between a .nif file and a .bik file, I considered using seperate tags for the two different file types. I was able to create a new tag (in this case "<MovieFileAlt>") and define it in the schema. The game would load and recognize it, I just couldn't then get the python to do what I wanted to do with it.

I just copied the tag
Code:
	<ElementType name="MovieFile" content="textOnly"/>
and modified it to
Code:
	<ElementType name="MovieFile" content="textOnly"/>
	<ElementType name="MovieFileAlt" content="textOnly"/>

Then I also copied just below that
Code:
	<ElementType name="ReligionInfo" content="eltOnly">
		<element type="Type"/>
		<element type="Description"/>
		<element type="Civilopedia"/>
		<element type="TechPrereq"/>
		<element type="FreeUnitClass"/>
		<element type="iSpreadFactor"/>
		<element type="GlobalReligionCommerces"/>
		<element type="HolyCityCommerces"/>
		<element type="StateReligionCommerces"/>
		<element type="Button"/>
		<element type="TechButton"/>
		[B]<element type="MovieFile"/>[/B]
		<element type="MovieSound"/>
		<element type="Sound"/>
		<element type="iOrderPriority" minOccurs="0"/>
	</ElementType>

changed that to
Code:
	<ElementType name="ReligionInfo" content="eltOnly">
		<element type="Type"/>
		<element type="Description"/>
		<element type="Civilopedia"/>
		<element type="TechPrereq"/>
		<element type="FreeUnitClass"/>
		<element type="iSpreadFactor"/>
		<element type="GlobalReligionCommerces"/>
		<element type="HolyCityCommerces"/>
		<element type="StateReligionCommerces"/>
		<element type="Button"/>
		<element type="TechButton"/>
[B]		<element type="MovieFile"/>
		<element type="MovieFileAlt"/>[/B]
		<element type="MovieSound"/>
		<element type="Sound"/>
		<element type="iOrderPriority" minOccurs="0"/>
	</ElementType>

I should think that what you want to do is possible with python. I don't have any idea how, but it should be possible.

Don't know if that helps you at all, but that is what I have found.

You are technically correct and TheLopez is functionally correct. It is possible to change the schema and add a new tag. But the game engine won't know what to do with the new tag so it won't do anything for you until you can get the SDK and add in some calls to have the game engine check for the new tag and perfrom some task if it exists.
 
Back
Top Bottom