Question about Terrain and Hills

Sureshot

Goddess
Joined
Feb 2, 2006
Messages
3,771
im a little confused about the implementation of hills.

they seem to be terrain, like theres a 'TERRAIN_HILL' option, but how does that work with grassland/hill or plains/hill?

like if i use the function that gets me the terrain type of the land, what does it say for a plains/hill?

and how do i use the set terrain function to make a hill/plains?

im hoping to edit two spells for my own use, Tsunami and Tremor (or Earthquake, whichever is a 3rd level earth spell), to work in stages, i.e.:

Tsunami
Peak>Hill>Flatlands>Water
Tremor
Water>Flatlands>Hill>Peak

but also make it work 100% of the time, though not work if a city is there (will instead do damage and pop reduce if possible until the city is gone)

but atm, im confused about hills, it seems to me that varying levels of land (water/flatlands/hills/peaks) should be separate from terrain the way features (like forests, fallout, ice) are. the world builder seems to think so as well (it separates those four off from terrain), and adding peaks does not even change the terrain underneath it (if you change a peak back into flatlands it retains the terrain type it had before).


anyone know much about this? how to detect hills? how to change the terrain height? (through python, not worldbuilder)
 
Might I suggest making it not work if any unit in the tile succeeds in saving against it? And perhaps a bonus to their saves if they're in a city... just some thoughts I had about it a while ago.
 
nice idea... i was thinking there sould be an effect like this...
 
Chandrasekhar said:
Might I suggest making it not work if any unit in the tile succeeds in saving against it? And perhaps a bonus to their saves if they're in a city... just some thoughts I had about it a while ago.

Why the hell should a uber III rank speel cast by an powerfull Archmage be nullified by a lowbie foot soldier saving against it ? He can take no damage if he saves, but the terrain should still be changed.
 
From the WorldBuilderSave side of things, hills/peaks/flatland/water are independent from terrain and features. A plot will have TerrainType (grass, plain, desert, etc), FeatureType (jungle, forest, fallout, etc), and PlotType (0=peak, 1=hill, 2=flatland, 3=water), as well as possibly having BonusType, ImprovementType, and maybe another one or two I'm not thinking of off the top of my head.

How this all works with the xml, python, sdk, etc, I don't know, but hopefully it helps get you (or whomever) looking in the right places. =)
 
A simple soldier isn't going to be able to save against a spell cast by a level 6+ archmage. The base save could also be difficult to resist, so it's only likely to happen when you're trying to exploit it to wipe out a stack or a city.
 
i mean to make it so if a city is involved that nothing will happen to the tile until the city is worn down and off

about stacks, any that make their save doesnt die, they end up on a nearby tile, so ive never found it to be terrible potent on stacks.. on cities tho, its just mean, i cant handle losing a full gigantic city to 1 spell, thats just wrong heh
 
Sureshot said:
i cant handle losing a full gigantic city to 1 spell, thats just wrong heh

You say that now, but the first time the bastard AI lost a pop 20 city to one of your whims you'd be capering in the streets. :)
 
TheCowSaysMoooo said:
From the WorldBuilderSave side of things, hills/peaks/flatland/water are independent from terrain and features. A plot will have TerrainType (grass, plain, desert, etc), FeatureType (jungle, forest, fallout, etc), and PlotType (0=peak, 1=hill, 2=flatland, 3=water), as well as possibly having BonusType, ImprovementType, and maybe another one or two I'm not thinking of off the top of my head.

How this all works with the xml, python, sdk, etc, I don't know, but hopefully it helps get you (or whomever) looking in the right places. =)

That's the same way it works in Python as far I can see from what I used in my map scripts. There are TerrainType, FeatureType and PlotType, and they can be set independently. Where did you find the string "TERRAIN_HILL", Sureshot?

You can get the types by using:

Code:
plot.getTerrainType()
plot.getPlotType()				
plot.getFeatureType()				
plot.getBonusType(-1)

(the -1 has something to do with teams, I don't know what exactly)

and set them with the appropiate setter functions, which may have specific syntax. Use http://civilization4.net/files/modding/PythonAPI_v160/ as a reference (maybe you knew that one). I think peeking into map scripts is a good way of finding out how all the stuff works.
 
One possible exploit on making terrain modifications (specifically peaks) is that you can cut a city (or an area of land) off entirely by ringing it with peaks. Then only the rangers and a few other units could get in and out. That will be worse for some civs (especially the dwarves with no high level magic to counter this) than others. You may want to limit it so it does not build up to peaks, but stops at hills.
 
then id hafta limit tsunami so it doesnt let you place a city inside a small lake (since boats cant be built in small lakes, only in coastal cities on an ocean; so, only water walking units and a few others could get there)

im not too worried about someone blocking themselves in, it can already be done with pirates coves or use of the tsunami spell, and there are always ways around it, either by using the counter spell as im setting it up, or through water walking, rangers, spells like fireball, or a spell extended earthquake/tsunami to encase their center 'protected city' in the same fate as its 'protecting' tiles, thus destroying it.

that is to say, if a city surrounds itself in a small lake, you could use waves to wash away the city eventually, or you could use earthquakes to spread the land across the water to get to them. of if someone surrounds themself with mountains, you can earthquake their city til its destroyed, or use tsunami to erode down its protections.
 
i got the following error for code that seems correct:
ArgumentError: Python argument types in
CyPlot.setPlotType(CyPlot, int, bool, bool)
did not match C++ signature:
setPlotType(class CyPlot {lvalue}, enum PlotTypes, bool, bool)
and its because of the line:
pPlot.setPlotType(gc.getInfoTypeForString('PLOT_OCEAN'), True, True)
which basically just replaces:
pPlot.setTerrainType(gc.getInfoTypeForString('TERRAIN_OCEAN'), True, True)
theres a little more too it, but that seems to be the isolated error and i cant figure out whats up
 
Ok, first of all I think things like 'TERRAIN_HILL' found in the XML files define things like terrain boni (which makes sense at least for coast and ocean tiles, with are both the same plot type), though it's somewhat confusing to me..

Now, concerning your error, it seems like for some reason the plottypes are handled differently from the rest (terrain, features, etc.) in that you don't use those info strings. Instead, you use

Code:
pPlot.setPlotType(PlotTypes.PLOT_HILLS, True, True)

and you have at your disposal:

Code:
PLOT_PEAK
PLOT_HILLS
PLOT_LAND
PLOT_OCEAN
 
Back
Top Bottom