Strange TerrainImpassable TERRAIN_HILL did not work

Manifold

ModderProtectionAdvocate
Joined
Aug 27, 2007
Messages
1,580
Did anyone noticed, that this did not work:

<TerrainImpassables>
<TerrainImpassable>
<TerrainType>TERRAIN_HILL</TerrainType>
<bTerrainImpassable>1</bTerrainImpassable>
</TerrainImpassable>
</TerrainImpassables>

Very strange - or is it my mistake?
 
Hills are handled differently (like Peaks) and I don't think you can make them impassable for individual units without at least some Python coding (I'd strongly suggest SDK for this though).
 
Hills aren't a specific terrain type like Mountains so that usage won't work with them. The only thing that command will work for is the base terrains like Grassland, Plains etc. Mountains are a base terrain, that's why they function as they do. Hills aren't.
 
Did anyone noticed, that this did not work:

<TerrainImpassables>
<TerrainImpassable>
<TerrainType>TERRAIN_HILL</TerrainType>
<bTerrainImpassable>1</bTerrainImpassable>
</TerrainImpassable>
</TerrainImpassables>

Very strange - or is it my mistake?

I had to do some sheninagins in the SDK for this normal list to work in the XML. It's because Hills and Peaks and actually PlotTypes, not Terrain Types, and are listed as Terrain Types purely for the civilopedia's sake.
 
I had to do some sheninagins in the SDK for this normal list to work in the XML. It's because Hills and Peaks and actually PlotTypes, not Terrain Types, and are listed as Terrain Types purely for the civilopedia's sake.

Maybe i can take a look. Where do i find your work.
But meentime i solved the problem by creating a new "terrain" and give it to the hills, that seems simple and looks great; just unfortunately is there now a new terrain-entry in the pedia.
 
Maybe i can take a look. Where do i find your work.
But meentime i solved the problem by creating a new "terrain" and give it to the hills, that seems simple and looks great; just unfortunately is there now a new terrain-entry in the pedia.

If you are up to creating a custom dll and editing the SDK (Being able to make SDK changes is very liberating... :mischief:), then I can tell you what to change to make that XML work.

In CvUnit, search for this line:
Code:
if (m_pUnitInfo->getTerrainImpassable(pPlot->getTerrainType()))

Replace it with this new code:
Code:
			bool bPeak = false;
			bool bHill = false;
			if (m_pUnitInfo->getTerrainImpassable(GC.getInfoTypeForString("TERRAIN_HILL")))
				bHill = true;
			if (m_pUnitInfo->getTerrainImpassable(GC.getInfoTypeForString("TERRAIN_PEAK")))
				bPeak = true;
			if (m_pUnitInfo->getTerrainImpassable(pPlot->getTerrainType()) || (pPlot->isPeak() && bPeak) || (pPlot->isHills() && bHill))

After you compile,
putting TERRAIN_PEAK or TERRAIN_HILL will work in the XML, at least for that code. I think there are still other places Terrains will need fixing.
 
Thank you very much, but

After you compile,
putting TERRAIN_PEAK or TERRAIN_HILL will work in the XML, at least for that code. I think there are still other places Terrains will need fixing.

sounds :crazyeye: For now i will use the russian method: Who cares the pedia? The main thing is, it works.:D

However thank you, i will keep this in mind.
 
Admittedly my method is some practical. Usually i just use Aesthetics to get the GREAT_LIBRARY.

Ok, Aesthetics, so i have the choice between

After you compile, putting TERRAIN_PEAK or TERRAIN_HILL will work in the XML, at least for that code. I think there are still other places Terrains will need fixing.
:confused:

and

Hiding the new terrain by hardcoding it in the python should not be so difficult...
:crazyeye:
 
Top Bottom