Is there anyway to disable certain worker functions?

maggotman

And Then Bender Ran.
Joined
May 23, 2003
Messages
34
Location
Penticton, BC Canada
Hello all

I'm designing a map, and would like part of the scenario to feature no forest/jungle clearing. How difficult is it going to be (I am very familiar with the XML files, but may be missing something...).

Any help would certainly be appreciated!
 
here ?

file: CIV4UnitInfos.xml

<Build>
<BuildType>BUILD_ROAD</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_RAILROAD</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_FARM</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_MINE</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_WORKSHOP</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_LUMBERMILL</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_WINDMILL</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_WATERMILL</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_PLANTATION</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_QUARRY</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_PASTURE</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_CAMP</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_WELL</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_WINERY</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_COTTAGE</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_FORT</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_REMOVE_JUNGLE</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_REMOVE_FOREST</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_SCRUB_FALLOUT</BuildType>
<bBuild>1</bBuild>
 
I think all you would need to do is remove these lines from the Worker unit section in CIV4UnitInfos.xml:

- <Build>
<BuildType>BUILD_REMOVE_JUNGLE</BuildType>
<bBuild>1</bBuild>
</Build>
- <Build>
<BuildType>BUILD_REMOVE_FOREST</BuildType>
<bBuild>1</bBuild>
</Build>
 
Colonel Kraken said:
I think all you would need to do is remove these lines from the Worker unit section in CIV4UnitInfos.xml:

- <Build>
<BuildType>BUILD_REMOVE_JUNGLE</BuildType>
<bBuild>1</bBuild>
</Build>
- <Build>
<BuildType>BUILD_REMOVE_FOREST</BuildType>
<bBuild>1</bBuild>
</Build>


maybe a simple 0 instead of a 1 is enough ;)
 
How did I miss it?? Thanks so much guys. I'll try the "0" first, then go right to removing the text if that doesn't do the trick.

Thanks again for the quick replies!
 
maggotman said:
How did I miss it?? Thanks so much guys. I'll try the "0" first, then go right to removing the text if that doesn't do the trick.

Thanks again for the quick replies!


you can also comment the lines ;)

use the code:

Code:
<!-- text to comment -->
 
I dont think you should remove the lines because they will still be referenced from the unit abilities.

Intead change numbers to 0 will be better i tihnk.
 
I don't know much on editing the XML but even if you don't allow them to clear forest and jungles, wouldn't they do that automatically when placing improvements (i.e.: farm, town, mine) over the forest/jungle? I am not sure but when my workers work they just place the improvements and the forest disappears. Maybe they do both and disabling it will not allow them to place improvements on to forests/jungles.
 
Infinit1 said:
I don't know much on editing the XML but even if you don't allow them to clear forest and jungles, wouldn't they do that automatically when placing improvements (i.e.: farm, town, mine) over the forest/jungle? I am not sure but when my workers work they just place the improvements and the forest disappears. Maybe they do both and disabling it will not allow them to place improvements on to forests/jungles.

Good point! That's where testing comes in I guess.
 
I think they actually clear the tile first... I remember I wanted to build a mine on jungle once and it wouldn't let me because I hadn't discovered Iron Working, and it said something to the effect of having to clear the tile first.
 
They do require the appropiate tech to clear the tile before you can build over it.

So yes it does automatically cut the trees down for you which will be probelm for your mod.

But the thing is if you follow the unit animation the trees are cut as soon as the improvement is built. So its like one move as it were rather than two - so i guess cutting trees will be possible even if you disable the button but im not to sure.
 
Just finished testing.

I set the unit value to "0", and it removed the button to chop down the trees.

However - if another structure is built, then the forest is cleared anyhow.

Any ideas around that one? Maybe change the terrain specs..
 
Ok - so every structure that's built on a forest tile removes the forest - except the Lumbermill structure.

So there must be a way to make the other structures unavailable if a forest tile is selected, or the XML changed so that the forest isn't removed.
 
You could just make it so that "Bronze Working" didn't allow trees to be cut down anymore ...
 
Yes, indeed it can be done. The file, of course is Civ4BuildInfos. The same editing applies ...

<BuildInfo>
<Type>BUILD_PLANTATION</Type>
<Description>TXT_KEY_BUILD_PLANTATION</Description>
<Help/>
<PrereqTech>TECH_CALENDAR</PrereqTech>
<iTime>500</iTime>
<bKill>0</bKill>
<ImprovementType>IMPROVEMENT_PLANTATION</ImprovementType>
<RouteType>NONE</RouteType>
<EntityEvent>ENTEVENT_BUILD</EntityEvent>
<FeatureStructs>
<FeatureStruct>
<FeatureType>FEATURE_JUNGLE</FeatureType>
<PrereqTech>TECH_IRON_WORKING</PrereqTech>
<iTime>400</iTime>
<iProduction>0</iProduction>
<bRemove>1</bRemove>
</FeatureStruct>
<FeatureStruct>
<FeatureType>FEATURE_FOREST</FeatureType>
<PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
<iTime>250</iTime>
<iProduction>30</iProduction>
<bRemove>0</bRemove>
</FeatureStruct>
</FeatureStructs>
<HotKey>KB_P</HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>1</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>1</iHotKeyPriority>
<Button>,Art/Interface/Buttons/Builds/BuildPlantation.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,1,9</Button>
</BuildInfo>

The FEATURE_FOREST and FEATURE_JUNGLE are what remove the graphics. When changed to "0", the improvement can be built/pillage without the forest/jungle being removed.

Nice. ;)
 
Back
Top Bottom