Hi,
Im now bungling my way through creating my first mod (primarily using XML), which is nothing more and nothing less than an additional worker action to 'Plant Forest'. I've got the action working nicely - the worker gets an additional button (looks same as 'Chop Forest' icon for now). When the action is performed a temporary Improvement with appropriate production values is created. Then with a bit of LUA script, the Improvement is replaced with a Forest Feature.
The only problem I'm having is being able to stop my new 'IMPROVEMENT_PLANT_FOREST' Improvement being built on existing Forest Feature tiles. Im not sure if I need to accomplish this via XML or LUA.
Attached is my single XML file; notice I've attempted to specifically define <Improvement_ValidFeatures> for the new Improvement, but alas, Civ 5 still gives me the equivalent of two fingers by refusing to stop me planting a forest thats already there.
Any ideas?
Thanks much
Dave
Im now bungling my way through creating my first mod (primarily using XML), which is nothing more and nothing less than an additional worker action to 'Plant Forest'. I've got the action working nicely - the worker gets an additional button (looks same as 'Chop Forest' icon for now). When the action is performed a temporary Improvement with appropriate production values is created. Then with a bit of LUA script, the Improvement is replaced with a Forest Feature.
The only problem I'm having is being able to stop my new 'IMPROVEMENT_PLANT_FOREST' Improvement being built on existing Forest Feature tiles. Im not sure if I need to accomplish this via XML or LUA.
Attached is my single XML file; notice I've attempted to specifically define <Improvement_ValidFeatures> for the new Improvement, but alas, Civ 5 still gives me the equivalent of two fingers by refusing to stop me planting a forest thats already there.
Any ideas?
Thanks much
Dave
Spoiler :
Code:
<GameData>
<Builds>
<Row>
<Type>BUILD_PLANT_FOREST</Type>
<PrereqTech>TECH_MINING</PrereqTech>
<Time>600</Time>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<Description>Plant a Forest</Description>
<Help>Re-Forestation Baby</Help>
<EntityEvent>ENTITY_EVENT_BUILD</EntityEvent>
<OrderPriority>50</OrderPriority>
<IconIndex>31</IconIndex>
<IconAtlas>UNIT_ACTION_ATLAS</IconAtlas>
</Row>
</Builds>
<Unit_Builds>
<Row>
<UnitType>UNIT_WORKER</UnitType>
<BuildType>BUILD_PLANT_FOREST</BuildType>
</Row>
</Unit_Builds>
<Improvements>
<Row>
<Type>IMPROVEMENT_PLANT_FOREST</Type>
<Description>Forest</Description>
<Civilopedia>Re-Forestation Baby</Civilopedia>
<ArtDefineTag>ART_DEF_RESOURCE_COTTON</ArtDefineTag>
<BuildableOnResources>true</BuildableOnResources>
<OutsideBorders>true</OutsideBorders>
<PortraitIndex>31</PortraitIndex>
<IconAtlas>MISC_ATLAS_TERRAIN</IconAtlas>
</Row>
</Improvements>
<Improvement_Flavors>
<Row>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<FlavorType>FLAVOR_PRODUCTION</FlavorType>
<Flavor>10</Flavor>
</Row>
</Improvement_Flavors>
<Improvement_Yields>
<Row>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<YieldType>YIELD_PRODUCTION</YieldType>
<Yield>1</Yield>
</Row>
</Improvement_Yields>
<Improvement_ValidTerrains>
<Row>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<TerrainType>TERRAIN_GRASS</TerrainType>
</Row>
<Row>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<TerrainType>TERRAIN_PLAINS</TerrainType>
</Row>
<Row>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<TerrainType>TERRAIN_TUNDRA</TerrainType>
</Row>
<Row>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<TerrainType>TERRAIN_HILL</TerrainType>
</Row>
</Improvement_ValidTerrains>
<Improvement_ValidFeatures>
<Row>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<FeatureType>FEATURE_MARSH</FeatureType>
</Row>
<Row>
<ImprovementType>IMPROVEMENT_PLANT_FOREST</ImprovementType>
<FeatureType>FEATURE_FLOOD_PLAINS</FeatureType>
</Row>
</Improvement_ValidFeatures>
</GameData>