Forest as a feature

Chiyochan

King
Joined
Jul 28, 2007
Messages
710
Location
Chiyochan's Country
Code:
	<Features>
		<Update>
			<Where Type="FEATURE_FOREST"/>
			<Set YieldNotAdditive="false" />
		</Update>
	</Features>
Since people are ignoring the thread now I'll bring it here
does anyone know whats wrong with this bit of code?
should it be using a ROW command isntead you think?
 
you do have it contained in <GameData> </GameData> tags no? like this

Code:
<GameData>	
         <Features>
		<Update>
			<Where Type="FEATURE_FOREST"/>
			<Set YieldNotAdditive="false" />
		</Update>
	</Features>
</GameData>

I don't think I see anything wrong with it if you did indeed already have your gamedata tags.
 
you do have it contained in <GameData> </GameData> tags no? like this

Code:
<GameData>	
         <Features>
		<Update>
			<Where Type="FEATURE_FOREST"/>
			<Set YieldNotAdditive="false" />
		</Update>
	</Features>
</GameData>

I don't think I see anything wrong with it if you did indeed already have your gamedata tags.

I have them, I suppose maybe this isnt as easy as some people thought it would be, otherwise we are both missing something
 
hold on a minute, I'll test it out in my mini mod... brb
 
does a forest/hill normally give 3 food and 1 hammer? I don't think so...

the code works.
 
does a forest/hill normally give 3 food and 1 hammer? I don't think so...

the code works.
did you do anything other than add the code and build?
 
i just copied and pasted it into my existing xml, re-build and had to re-enable my mod, then start a game. Look at how long it took me to post... 5 minutes with a screen shot (even had to convert it to jpg), yes thats all i did.
 
i just copied and pasted it into my existing xml, re-build and had to re-enable my mod, then start a game. Look at how long it took me to post... 5 minutes with a screen shot (even had to convert it to jpg), yes thats all i did.

Hmm, I got it to work but it crashed, sometimes that happens though
I dug around in the folders and found there for some reason was more than one copy of my yield mod. Now if i could just get flood plains to yield 3 food.
 
I've been fiddling around with this mod and every time I modify the forest tile on a hill it gives it a wopping 2 food, even when I add in penalties it doesn't affect it.

does anyone know where to modify this?
 
lol, you think I lied to you? Its staring you in the face, the exact code to make it work is on this page.
 
lol, you think I lied to you? Its staring you in the face, the exact code to make it work is on this page.
your a funny guy. try changing the yields of forest and see what you get. features on flat lands and on hills are totally different.
 
well have fun figuring it out on your own then ;)
aren't we friendly today.
first we blatantly inform someone the answer is staring them in the face but when they clarify I guess your on your own.

Bye.
 
The posted XML modification works as described. If it still isn't giving you the desired result it is because you are doing something wrong elsewhere.
 
The posted XML modification works as described. If it still isn't giving you the desired result it is because you are doing something wrong elsewhere.

Code:
<GameData>
		<Features>
			<Update>
				<Where Type="FEATURE_FOREST"/>
				<Set YieldNotAdditive="false" />
			</Update>
		</Features>
		<Feature_YieldChanges>
			<Update>
				<Where FeatureType="FEATURE_FOREST" YieldType="YIELD_PRODUCTION"/>
				<Set>
					<Yield>1</Yield>
				</Set>
			</Update>
			<Update>
				<Where FeatureType="FEATURE_FOREST" YieldType="YIELD_FOOD"/>
				<Set>
					<Yield>0</Yield>
				</Set>
			</Update>
		</Feature_YieldChanges>
</GameData>

after reading this, creating a brand new mod with only this code and still getting the same results I'd expect, maybe this attached picture will help demonstrate what I'm talking about, the code above is the only mod I had on besides the clock.

I'll point out that the tree on top of the hill should be a 3 hammer tile and the one below it with the warrior is as it should be.
 

Attachments

  • foresthillflatlandcompared.jpg
    foresthillflatlandcompared.jpg
    124.9 KB · Views: 57
Try changing the way you use set in your yield changes to <Set Yield="1"/>. Also, does it work to use multiple conditions in the where tag in xml? I haven't tried it myself, anytime I've done that I used an SQL statement because I know exactly how those work but not exactly how they parse the xml updates to SQL.
 
Try changing the way you use set in your yield changes to <Set Yield="1"/>. Also, does it work to use multiple conditions in the where tag in xml? I haven't tried it myself, anytime I've done that I used an SQL statement because I know exactly how those work but not exactly how they parse the xml updates to SQL.

Well, I found an unused schema that sets yields for features on forest tiles correctly (it adds the extra hammer) but when I use it, it sets the yields for food to 2, even when I am subtracting 2 from the total.

Code:
	<Feature_HillsYieldChanges>
		<Row>
			<FeatureType>FEATURE_FOREST</FeatureType>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<FeatureType>FEATURE_FOREST</FeatureType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>-2</Yield>
		</Row>
		<Row>
			<FeatureType>FEATURE_JUNGLE</FeatureType>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>0</Yield>
		</Row>
		<Row>
			<FeatureType>FEATURE_JUNGLE</FeatureType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>1</Yield>
		</Row>
	</Feature_HillsYieldChanges>

because I could not get this to work I was asking if there was a better way.
 
That may be leftover from Civ 4, I've seen quite a bit of that in the XML Schemas- tags that Civ 4 used but have no use in Civ 5. It's possible that a lot of those don't actually do anything since the game never reads those tables.
 
That may be leftover from Civ 4, I've seen quite a bit of that in the XML Schemas- tags that Civ 4 used but have no use in Civ 5. It's possible that a lot of those don't actually do anything since the game never reads those tables.

It seems half that way, but i cant figure out why increasing production works but decreasing food does not. it at least reads the production part

there isnt a back door way around this problem? I guess I was right after all, this is shaping up to be an impossible request :confused:
 
As I already replied to someone alse in another thread that were having similar problems with other parts of the XML then:
You can only <Update><Where><Set> something if an entry already exists (modifying the existing entry).
But if you are trying to implement something that has no existing match for the <Where> parameters then you need to use the <Row> method (adding an entirely new entry).

In other words, if you try to <Update> something that does not already exist in the default XML - or if you try to add a new entry using <Row> method that already does exist in the default XML - then your attempted modification will be rejected and fail.
 
Back
Top Bottom