Make mountains workable?

megabearsfan

Prince
Joined
Jan 17, 2006
Messages
552
Location
Las Vegas, NV
Hi, is there a way to make mountains workable?

I wanted to create a building that adds yield to mountain tiles. But when I build the building in a city with mountains, no yield appears on the mountain(s) and they are not workable. Is there an IsWorkable boolean in the mountain feature that I can toggle? If so, I didn't see it in the wiki, but the wiki is not always up-to-date.

I also posted this question on the 2k forums: http://forums.2k.com/showthread.php?407786-Making-mountains-workable&p=5547681#post5547681
 
Mountains are neither terrain types nor feature types, but like hills are plot types. There are no yield tables that deal with plots, which is why there is the "HillsMakesValid" (or whatever it's called) column. Unfortunately there is no corresponding "MountainsMakesValid" column. So unless you're willing to mod the DLL or write lots of lua to add/remove fake buildings your out of luck.
 
Well, LastSword did something like this in his Nepal Kingdom mod, to quote the UA description:
Unique Ability: Roof of the World: Mountains provide +1 Food, Production, Gold, Culture, Faith and Science.
Upon looking through his code it appears he's added a whole new feature - a "Tibet mountain", which uses all the same art and text as the normal mountain plot. Then a dummy building gives a yield for the new feature.

You should try looking through it, or perhaps LastSword himself can share some of his coding intellect? :D
 
LUA:
Code:
Events.SequenceGameInitComplete.Add(function()
	for i = 0, Map:GetNumPlots() - 1, 1 do
		local fPlot = Map.GetPlotByIndex( i );
		if fPlot:IsMountain() then
			if fPlot:GetFeatureType() == -1  then
				fPlot:SetFeatureType(GameInfoTypes.FEATURE_TIBET_MOUNTAIN,-1);
			end
		end
	end
end)

XML:
Code:
	<Features>
		<Row>
			<Type>FEATURE_TIBET_MOUNTAIN</Type>
			<Description>Mountain</Description>
			<Civilopedia>Mountain</Civilopedia>
			<Help>Mountain</Help>
			<ArtDefineTag></ArtDefineTag>
			<Movement>1</Movement>
			<PortraitIndex>8</PortraitIndex>
			<IconAtlas>NW_ATLAS</IconAtlas>
		</Row>
	</Features>
	<Building_FeatureYieldChanges>
		<Row>
			<BuildingType>BUILDING_YOUR_NAME</BuildingType>
			<FeatureType>FEATURE_TIBET_MOUNTAIN</FeatureType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
	</Building_FeatureYieldChanges>
This is an example. I have now a bit different method of adding feature to mountain, but this one works.
Nepal > Tibet!
 
Back
Top Bottom