Originally posted by
sun_tzu_159
The SLIC completes its checking loop correctly but does not put the good back on the square it came from with the above command - any ideas.
sun_tzu_159
The SLIC completes its checking loop correctly but does not put the good back on the square it came from with the above command - any ideas.
So you want to recreate the entire good. You have to recreate the tile improvement. Note that the first argument must be the owner of the cell or the owner of an unit that has this location in its vision range. If the future owner does not own the location he can only build there tile improvements with fort like characteristics.
Maybe you should rather use the version of the goods restoration code:
PHP Code:
Event:CreateImprovement(CellOwner(location[0]), location[0], 52, 0);
PHP Code:
Event: CreateImprovement(tmpCity.owner, tmpLoc, TerrainImprovementDB(TILEIMP_ROAD), TerrainImprovementDB(TILEIMP_ROAD));
With this funktion you don't need to take so much care on your improvemnt database as you have to do it if you use the numbers.
If the the tile improvment is back on the map than it needs a certain time until it is finished. All good improvments have a contruction time of ten turns. As long as you don't use this function on the given location:
PHP Code:
FinishImprovements(MGUnitLoc);
PHP Code:
PlantGood(MGGoodLoc);
PHP Code:
HandleEvent (CreateImprovement)'MG_ImpOnGoodStop' pre {
int_t MG_tilimpcreate;
MG_tilimpcreate = value[0];
improvement[0] = MG_tilimpcreate;
if (GetCurrentRound () > 1) {
if (HasGood(MGGoodLoc)>-1) {
if ((MG_tilimpcreate == TerrainImprovementDB(TILEIMP_TERRAFORM_GRASSLAND))
||(MG_tilimpcreate == TerrainImprovementDB(TILEIMP_TERRAFORM_PLAINS))
||(MG_tilimpcreate == TerrainImprovementDB(TILEIMP_TERRAFORM_JUNGLE))
||(MG_tilimpcreate == TerrainImprovementDB(TILEIMP_TERRAFORM_FOREST))
||(MG_tilimpcreate == TerrainImprovementDB(TILEIMP_TERRAFORM_SWAMP))) {
return STOP;
}
}
}
}
-Martin
Comment