Thread Tools
Old February 9, 2003, 23:34   #1
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 16:05
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
Terrain fields
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
}
ahenobarb is offline  
Old February 10, 2003, 01:07   #2
Dale
Emperor
 
Dale's Avatar
 
Local Time: 02:05
Local Date: November 2, 2010
Join Date: Dec 2000
Posts: 3,944
Quite simple it indicates when you can transform terrain to brown hill (AddAdvance) or from brown hill (Remove Advance).
Dale is offline  
Old February 10, 2003, 10:14   #3
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 16:05
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
Quote:
Originally posted by Dale
Quite simple it indicates when you can transform terrain to brown hill (AddAdvance) or from brown hill (Remove Advance).
Oh, I feel so stupid.

I was focusing on the word "Advance" thinking you had the "added" ability when you got the advance. And the ability was "removed" when you lost it. But obviously that didn't make any sense.

Thanks Dale!
ahenobarb is offline  
Old February 13, 2003, 16:19   #4
itsamic
Settler
 
Local Time: 17:05
Local Date: November 1, 2010
Join Date: Feb 2003
Posts: 19
I have a problem with terraform.slc from mymod ( OK, I use it in a normal game) . The AI terraforms swamp and dessert to plains or grass land (should be OK), but it also changes wood to plains and (and this makes no sense w/o a mine) plain to brown hill. Would it help to increase materials for such changes? I tried to understand the slc but without any success...
itsamic is offline  
Old February 13, 2003, 19:51   #5
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 16:05
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
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_TERRAFORM_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.
Peter Triggs is offline  
Old February 14, 2003, 19:05   #6
itsamic
Settler
 
Local Time: 17:05
Local Date: November 1, 2010
Join Date: Feb 2003
Posts: 19
I have removed "if TerrainType(theLoc)==0" for terraforming wood and replaced the terrain number with the TerrainImprovementDB(TILEIMP_TERRAFORM... statement and it produces no error message. A good start . Now I want to test it. Have I to start a new game or can I use a saved game started with the unmodified terraform.slc? And a second problem: I think it would be a good idea to terraform wood and hills if there are to much tiles of it. I want to include a counter like : if (TerrainType(theLoc)==0 then w = w+1 and then if ((TerrainType(theLoc)==0) && HasAdvance(player[0], ID_ADVANCE_AGRICULTURAL_REVOLUTION) && w>2)) then terraform (with higher values for w if city size > 6 and a second parameter for the second terrain. Is something like this already available?
itsamic is offline  
Old February 14, 2003, 19:29   #7
MrBaggins
CTP2 Source Code Project
King
 
MrBaggins's Avatar
 
Local Time: 16:05
Local Date: November 1, 2010
Join Date: May 1999
Posts: 1,528
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; February 14, 2003 at 20:50.
MrBaggins is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:05.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team