Trying to make an improvement, can't build it

Drazule

Chieftain
Joined
Jan 3, 2016
Messages
12
Hey everybody,

So I know I'm supposed to attach my mod for all questions like this, but its pretty late and I think this is more of a general answer than specific to me.


How do I get my improvement to be build-able by a worker?Also, how do I create a prerequisite technology for my improvement?

My improvement works in-game (by spawning it with IGE), but I can't figure out how to get somebody to build one of them for me.

I'm just not sure where to start looking.
 
All improvements need an entry in the <Improvements> table and the <Builds> table. Assuming you've got both of those, you're asking us to guess what you may or may not have done wrong with your mod, so ...
 
It's quite possible you missed the <Builds> table, though. You may also need to ensure that valid terrains are assigned that the improvement can be built on...
 
I believe it was the builds table, I will get back to y'all once I confirm this!

What does a build table look like? haha :)
 
[...] What does a build table look like? haha :)

This is how such a table looks like :) (including some other, pretty important code). Taken from CIV5Units.xml and CIV5Builds.xml respectively
Code:
<Unit_Builds><!--this allows workers to build the improvement-->
	<Row>
		<UnitType>UNIT_WORKER</UnitType>
		<BuildType>BUILD_MYBUILD</BuildType>
	</Row>
</Unit_Builds>

<Builds>
     <Row>
	<Type>BUILD_MYBUILD</Type>
	<PrereqTech>TECH_WHATEVER</PrereqTech>
	<Time>700</Time>
	<ImprovementType>IMPROVEMENT_MYIMPROVEMENT</ImprovementType>
	<Description>TXT_KEY_BUILD_MYIMPROVEMENT</Description>
	<EntityEvent>ENTITY_EVENT_MINE</EntityEvent>     <!--I'm not sure, but I think this is what the worker animation looks like. So here, it animates when it would build a mine, I think. Another possibility could for example be ENTITY_EVENT_CHOP, which is used for clearing marshes, and chopping down forests and jungle (check CIV5_Builds.xml for more ENTITY_EVENT's)-->
	<HotKey>KB_N</HotKey>     <!-- I don't know how to define a new hotkey, or what KB_N actually stands for. Someone else (with more experience) will probably know :p)
	<OrderPriority>96</OrderPriority>     <!--No idea what this does-->
	<IconIndex>22</IconIndex>     <!--this is how the Build_MyImprovement-action in your worker's interface will look like)
	<IconAtlas>UNIT_ACTION_ATLAS</IconAtlas>     <!--This is the atlas where that icon is taken from-->
     </Row>
</Builds>

You might also want to use this, if you want to remove jungle, forest or marsh before you construct your improvement. (Taken from CIV5Builds.xml)
Code:
<BuildFeatures>
		<Row>
			<BuildType>BUILD_MYBUILD</BuildType>
			<FeatureType>FEATURE_JUNGLE</FeatureType>
			<PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
			<Time>700</Time>
			<Remove>true</Remove>
		</Row>
		<Row>
			<BuildType>BUILD_MYBUILD</BuildType>
			<FeatureType>FEATURE_FOREST</FeatureType>
			<PrereqTech>TECH_MINING</PrereqTech>
			<Time>400</Time>
			<Production>20</Production>
			<Remove>true</Remove>
		</Row>
		<Row>
			<BuildType>BUILD_MYBUILD</BuildType>
			<FeatureType>FEATURE_MARSH</FeatureType>
			<PrereqTech>TECH_MASONRY</PrereqTech>
			<Time>600</Time>
			<Remove>true</Remove>
		</Row>
<BuildFeatures>

NOTE: <GameData>-tags are missing here, don't forget to add those
 
Back
Top Bottom