Changing yields as a trait? HELP

NotSoLoneWolf

Chieftain
Joined
Oct 28, 2014
Messages
47
Location
Canada
Alright, so I need to get these two things working:

<Trait_ImprovementYieldChanges>
<Update>
<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
<ImprovementType>IMPROVEMENT_GENERATOR</ImprovementType>
<YieldType>YIELD_SCIENCE</YieldType>
<Yield>1</Yield>
</Update>
</Trait_ImprovementYieldChanges>
and
<Trait_UnimprovedYieldChanges>
<Update>
<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
<FeatureType>FEATURE_RIVER</FeatureType>
<YieldType>YIELD_SCIENCE</YieldType>
<Yield>1</Yield>
</Update>
</Trait_UnimprovedYieldChanges>

the first one, making the generator give +1 science, was fine at first, but then it stopped working :cry: And I could never get the +1 science from river tiles to work :( This is the last thing I need for my mod to work, please help! :sad:

EDIT: I also tried this:

<GameData>
<Traits>
<Row>
<Type>TRAIT_CANADA_SCIENCE</Type>
<Description>TXT_KEY_TRAIT_CANADA_SCIENCE</Description>
<ShortDescription>TXT_KEY_TRAIT_CANADA_SCIENCE_SHORT</ShortDescription>
</Row>
</Traits>
<Trait_ImprovementYieldChanges>
<Update>
<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
<ImprovementType>IMPROVEMENT_GENERATOR</ImprovementType>
<YieldType>YIELD_SCIENCE</YieldType>
<Yield>1</Yield>
</Update>
</Trait_ImprovementYieldChanges>
<Feature_RiverYieldChanges>
<Update>
<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
<FeatureType>FEATURE_MARSH</FeatureType>
<YieldType>YIELD_SCIENCE</YieldType>
<Yield>1</Yield>
</Update>
<Update>
<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
<FeatureType>FEATURE_FLOOD_PLAINS</FeatureType>
<YieldType>YIELD_SCIENCE</YieldType>
<Yield>1</Yield>
</Update>
<Update>
<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
<FeatureType>FEATURE_FOREST</FeatureType>
<YieldType>YIELD_SCIENCE</YieldType>
<Yield>1</Yield>
</Update>
</Feature_RiverYieldChanges>
<Feature_YieldChanges>
<Update>
<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
<FeatureType>FEATURE_RIVER</FeatureType>
<YieldType>YIELD_SCIENCE</YieldType>
<Yield>1</Yield>
</Update>
</Feature_YieldChanges>
</GameData>

and it didnt work either. WHYYYYYYYYYYYYYYYYYYYYyyyy
 
You are using <Update> instead of <Row>, you cant update something that doesnt exist yet :), you need to add it first.
 
As a tip when posting code/xml on the forums, I'd recommend you use the code tags. It's much easier for people to read.

Code:
	<Colors>
		<Row>
			<Type>COLOR_PLAYER_ICON_MORGAN</Type>
			<Red>0.900</Red>
			<Green>0.855</Green>
			<Blue>0.050</Blue>
			<Alpha>1</Alpha>
		</Row>
		<Row>
			<Type>COLOR_PLAYER_BACKGROUND_MORGAN</Type>
			<Red>0.260</Red>
			<Green>0.260</Green>
			<Blue>0.260</Blue>
			<Alpha>1</Alpha>
		</Row>
	</Colors>
	<PlayerColors>
		<Row>
			<Type>PLAYERCOLOR_MORGAN</Type>
			<PrimaryColor>COLOR_PLAYER_ICON_MORGAN</PrimaryColor>
			<SecondaryColor>COLOR_PLAYER_BACKGROUND_MORGAN</SecondaryColor>
			<TextColor>COLOR_PLAYER_WHITE_TEXT</TextColor>
		</Row>
	</PlayerColors>

Just copy and paste straight from the file! (unless your xml looks like that in the file, in which case you have bigger problems).
 
Your code should look like this :)

You cannot put "Feature" tables in the Traits Table, you can only put other tables that begin with "Trait_" in with your Traits table to be associated with your Sponsor's Trait...and none of the tags should say "Update", they should say "Row"

Code:
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_CANADA_SCIENCE</Type>
			<Description>TXT_KEY_TRAIT_CANADA_SCIENCE</Description>
			<ShortDescription>TXT_KEY_TRAIT_CANADA_SCIENCE_SHO RT</ShortDescription>
		</Row>
	</Traits>
	<Trait_ImprovementYieldChanges>
		<Row>
			<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
			<ImprovementType>IMPROVEMENT_GENERATOR</ImprovementType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
	</Trait_ImprovementYieldChanges>
	<Trait_UnimprovedFeatureYieldChanges>
		<Row>
			<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
			<FeatureType>FEATURE_MARSH</FeatureType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
			<FeatureType>FEATURE_FLOOD_PLAINS</FeatureType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
			<FeatureType>FEATURE_FOREST</FeatureType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
			<FeatureType>FEATURE_RIVER</FeatureType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
	</Trait_UnimprovedFeatureYieldChanges>
</GameData>
 
Thanks for the help, but I already got the science from Generators working, and put that as my trait. Do you know how to put negative yields on improvements as a trait such as

Code:
<Trait_ImprovementYieldChanges>
	<Row>
		<TraitType>TRAIT_CANADA_SCIENCE</TraitType>
		<ImprovementType>IMPROVEMENT_GENERATOR</ImprovementType>
		<YieldType>YIELD_FOOD</YieldType>
		<Yield>-1</Yield>
	</Row>
</Trait_ImprovementYieldChanges>

? I am trying to balance the Generator.

EDIT: also your code for the riverside science bonus doesnt work, unfortunately.
 
I believe the only 2 things you can change are health and energy, though you may find others if you scan the CivBEImprovements.xml in the Terrain folder. Heres the code for the manufactory...

Code:
<Row>
	<Type>IMPROVEMENT_MANUFACTORY</Type>
	<Description>TXT_KEY_IMPROVEMENT_MANUFACTORY</Description>
	<Help>TXT_KEY_IMPROVEMENT_MANUFACTORY_HELP</Help>
	<Civilopedia>TXT_KEY_IMPROVEMENT_MANUFACTORY_PEDIA</Civilopedia>
	<ArtDefineTag>ART_DEF_IMPROVEMENT_MANUFACTORY</ArtDefineTag>
	<IconAtlas>UNIT_ACTION_ATLAS</IconAtlas>
	<PortraitIndex>36</PortraitIndex>
	<PillageEnergy>60</PillageEnergy>
	[COLOR="SeaGreen"]<EnergyMaintenance>2</EnergyMaintenance>
	<Unhealth>2</Unhealth>[/COLOR]
	<BuildableOnAnyResource>false</BuildableOnAnyResource>
	<RemovesArtifactResource>true</RemovesArtifactResource>
</Row>

So to make a change for the Generator to have negative energy/health that is the same as the manufactory you would want this...

Code:
<GameData>
	<Improvements>
		<Update>
			<Where Type="IMPROVEMENT_GENERATOR"/>
			<Set EnergyMaintenance="2" Unhealth="2"/>
		</Update>
	</Improvements>
</GameData>

or at least i think thats what it should look like :)
 
Though as a warning, this will put an energy and unhealth tax on the improvement even if it isn't being worked. It works much the same way as roads which cost money to maintain even if the tile isn't being worked by a citizen.
 
Back
Top Bottom