XML Newbie; impassable terrain

Pilotis

Prince
Joined
Jan 18, 2005
Messages
500
Wet newbie: fascinated, reasonably intelligent but guessing my way round. The tutorials are great but limited - maybe I missed some.

General question: is there anywhere to get into the terms and logic within civ4 xml

Specific question (for example): I can't work out WHY peaks are impassable within the xml terrain_infos <bImpassable>0</bImpassable>. I know the answer must be simple....... I did search the forum but didn't see anything to help me.

If there's anywhere esle I should post this kind of Q please direct me.

Thanks
 
In Civ4UnitInfos.xml you can set some flags:

i.e.
helicopter can fly over peaks:
<bCanMoveAllTerrain>1</bCanMoveAllTerrain>

submarine can move under ice:
<bCanMoveImpassable>1</bCanMoveImpassable>
in Civ4FeatureInfo.xml see ICE:
<bImpassable>1</bImpassable>

galley cannot enter ocean:
<TerrainImpassables>
<TerrainImpassable>
<TerrainType>TERRAIN_OCEAN</TerrainType>
<bTerrainImpassable>1</bTerrainImpassable> </TerrainImpassable>
</TerrainImpassables>

I'm sure you'll figure it out ;)
 
O.K. I'll go away soon but.....

In Civ4UnitInfos.xml you can set some flags:

i.e.
helicopter can fly over peaks:
<bCanMoveAllTerrain>1</bCanMoveAllTerrain>

yep. that's clear "canmoveALL terrain"

submarine can move under ice:
<bCanMoveImpassable>1</bCanMoveImpassable>
in Civ4FeatureInfo.xml see ICE:
<bImpassable>1</bImpassable>

yep. ice is 'impassable'

galley cannot enter ocean:
<TerrainImpassables>
<TerrainImpassable>
<TerrainType>TERRAIN_OCEAN</TerrainType>
<bTerrainImpassable>1</bTerrainImpassable> </TerrainImpassable>
</TerrainImpassables>

yep. you define ocean as specifically impassable for that sea unit.

I'm sure you'll figure it out ;)

Nope. In terraininfos peaks are <bImpassable>0</bImpassable> !!! So why are they impassable?
Could you beat me up some more please - I REALLY would like to understand what I'm missing !!
 
Is it possible to move control of 'peak' passable/ impassable from dll to xml ?
 
Yep, that's something I want to know as well!
Please, can anyone help?
 
In CvPlot.cpp, line 3690:

Code:
bool CvPlot::isImpassable() const
{
	if (isPeak())
	{
		return true;
	}

Just comment out that first if statement in the function (there is one more, I didn't copy to here), and recompile.
 
Well thanks Ninja2 !!

I just need to get the hang of building a project/ coding/ recompiling stuff.

Drrrrivin' me nnnnuts !

Tried codeblocks/ Kael approach - now switching to MS C++.

thanks again !
 
Did you try it with codeblocks 8.02? Because I couldn't get that to work either... there was an older version of codeblocks which always works for me (the version which Kael wrote the tutorial for). It's called "release candidate 1.02" or something... I have it at home, and can post it later if you haven't got it?

Or try downloading from here.
 
Ninja.

I've gone with MS C++ Express 2008 and found it works a treat for me.

Thanks
 
Back
Top Bottom