How to tie Yields to multiple conditions

Hutoth

Chieftain
Joined
Oct 8, 2010
Messages
2
First Post, from a Newbie/ Settler-level Wannabe Modder

I wanted to try to learn the basics of modding, so I made a little plan for something "small" I thought might be interesting, namely:

1. trading posts positioned on a trade route = +1 Gold
2. trading posts not adjacent to any other trading posts or a city = +1 Gold
3. trading posts adjacent to an improved resource = +1 Gold per improved resource.
4. trading posts in general -1 Gold.
(let's forget the "why" of the above, which is irrelevant until I get past the "how")

I believe I know how to make #4 work (so put that at the end, as it seems the easiest to do using a simple <update>

Anyway: I'm evidently doing something totally wrong, and just making up multiple-conditions without defining them or something, but I really have no idea - no background in Dev beyond basic html and hello world :D

I started out on #1. First, I tried:

<GameData>
<Improvement_Yields>
<Row>
<ImprovementType>IMPROVEMENT_TRADING_POST</ImprovementType>
<RouteType>ROUTE_ROAD</RouteType>
<YieldType>YIELD_GOLD</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<ImprovementType>IMPROVEMENT_TRADING_POST</ImprovementType>
<RouteType>ROUTE_RAILROAD</RouteType>
<YieldType>YIELD_GOLD</YieldType>
<Yield>1</Yield>
</Row>
</Improvement_Yields>
</GameData>


Then I tried:

<GameData>
<Improvement_Yields>
<Update>
<Set Yield="3"/>
<Where ImprovementType="IMPROVEMENT_TRADINGPOST" RouteType="ROUTE_ROAD" YieldType="YIELD_GOLD"/>
</Update>
</Improvement_Yields>
</GameData>

I assume anyone who knows what they are doing with mods will instantly see what's going wrong here. I... do not.

I am thinking that the route "condition" is not properly linked up and I probably have to set up something elsewhere to make this work.

So anyway.. Faced with this initial barbarian horde, I decided to come here rather than wade into obviously violent waters like addressing proximity of other improvements in #2 and #3.

Advice?
 
To make trading posts +1 gold with a road, the code should look like this:

Code:
	<Improvement_RouteYieldChanges>
		<Row>
			<ImprovementType>IMPROVEMENT_TRADING_POST</ImprovementType>
			<RouteType>ROUTE_ROAD</RouteType>
			<YieldType>YIELD_GOLD</YieldType>
			<Yield>1</Yield>
		</Row>
	</Improvement_RouteYieldChanges>

This being within your <GameData> and such.

Cheers.
 
roads don't change the tile yield, they're always in effect. this would only help if the tile gets worked.
 
To make trading posts +1 gold with a road, the code should look like this:

Code:
	<Improvement_RouteYieldChanges>
		<Row>
			<ImprovementType>IMPROVEMENT_TRADING_POST</ImprovementType>
			<RouteType>ROUTE_ROAD</RouteType>
			<YieldType>YIELD_GOLD</YieldType>
			<Yield>1</Yield>
		</Row>
	</Improvement_RouteYieldChanges>

This being within your <GameData> and such.

Cheers.

Thank you so much for that - I went exploring on the database after seeing this, and have got it working and a range of other stuff for my 1st mod now in progress. More of an update soon, but wanted to say Thanks!!! first.:)
 
Back
Top Bottom