 |
|
ahenobarb
|
|
Can anybody explain why those terrains that can be terraformed have an EnableAdvance field and a RemoveAdvance field, even though both advances are exactly the same?
Consider ...
TERRAIN_BROWN_HILL {
TilesetIndex 18
Icon ICON_TERRAIN_BHILLS
InternalType: BrownHill
CanDie
AddAdvance ADVANCE_EXPLOSIVES
TransformAdd {
Time 2
Materials 1600
}
RemoveAdvance ADVANCE_EXPLOSIVES
TransformRemove {
Time 3
Materials 600
}
|
|
|  |
 |
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:25
|
|
Actually, terraform.slc is based on an earlier program that I wrote. player1 improved and expanded it, but, although I haven't checked it looks like he was using a different version of tileimp.txt.
Where it says, for example,
code:
Event:CreateImprovement(city[0].owner,theLoc, 24,0);
//change to grassland
the "24" is supposed to be the tileimp.txt data base index (it's position in the file, "0" is first) of TILEIMP_TERRAFORM_GRASSLAND. But 24 gives TILEIMP_TERRAFORM_BROWN_HILL, it should be "28" for grassland and "32" for plains.
And, as Martin G later pointed out, a better way of doing it (this makes it independent of whatever version of the tileimp.txt and terrain.txt files are being used) is to use the TerrainImprovementDB(...) and TerrainDB(...) functions. So where you want to change swamp at theLoc (the location) to grassland you'd have:
code:
if ((TerrainType(theLoc)==TerrainDB(TERRAIN_SWAMP))
&& HasAdvance(player[0], ID_ADVANCE_INDUSTRIAL_REVOLUTION)) {
// 6=swamp
pw_level = pw_level + 1200;
SetPW(player[0], pw_level); //add pw
Event:CreateImprovement(city[0]. owner,theLoc,TerrainImprovementDB(TILEIMP_TERRAFOR
M_GRASSLAND),0);
//change to grassland
}
or, where you want to change tundra or desert into plains,
code:
if ((TerrainType(theLoc)==TerrainDB(TERRAIN_TUNDRA) || TerrainType(theLoc)==TerrainDB(TERRAIN_DESERT))
&& HasAdvance(player[0], ID_ADVANCE_CONSERVATION)) {//this restriction is probably unnecessary
// 2=tundra, 5=desert
pw_level = pw_level + 1000;
SetPW(player[0], pw_level); //add pw
Event:CreateImprovement(city[0].owner,theLoc, TerrainImprovementDB(TILEIMP_TERRAFORM_PLAINS),0);
//change to plains
}
Or, you can do whatever you want. I'll leave you the fun of doing the editing, but if you have any problems either post here or e-mail me.
|
|
|  |
 |
|
MrBaggins
|
|
I'm currently working on a system which completely replaces the AI's terraforming and terrain improvements (excluding non-misc/transportation improvements.)
In the initialization, you manually enter data into arrays, to define how you want the system to work:
You define personalities. E.G. Agressive Settler
Personalities have (multiple) Strategies E.G. Smallest Cities, LeastProductive Cities, Highest growth cities, in that order.
Strategies have (multiple) Virtual Improvements - just numeric indexes
Virtual Improvements are defined- they have requirements (like the terrain, the technologies, whether there can be existing improvements, whether the improvement is intended to upgrade another improvement, which improvement to upgrade, its cost) and effects (what improvement or terraforming to actually do.
The system will take into account the tiles that a city is actually working, rather than assuming all tiles around it are available.
Its taking a while, because I've been refining the data structures used to define the data... and creating a system to guarantee tile ownership by a particular city, is not easy.
It is however, intended to be completely flexible, allowing human like priority definition and allow SLIC to encourage specific TI behavior from AI players... based on the personality set for that AI.
MrBaggins
Last edited by MrBaggins on 15-02-2003 at 05:50
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:25. Apolyton Time is 00:25. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|