 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:21
|
|
Extra text file. Not a major problem, but annoying.
Unless I use Subneural Ads as that advance. Which is basically what I was going to do anyway.
Last edited by Immortal Wombat on 05-08-2002 at 03:39
|
|
|  |
 |
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:21
|
|
Because (I hope) the wonder code will be used on many different setups, not necessarily with the city expansion code, I think it would be best use the whole readme. I'll update it.
Which prefix are you using?
You can write a separate readme for the CityX code.
I altered the wonder code slightly so that it is easier to mod.
I still don't think you'd get the pyramids in a swamp, or the Empire State Building on a desert mountain, and I would like to remove those terrains from the options.
Opinions?
But otherwise, Well Done!!
Attachment: cityexpansion2.slc
This has been downloaded 4 time(s).
Last edited by Immortal Wombat on 20-08-2002 at 00:14
|
|
|  |
 |
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:21
|
|
quote: Originally posted by Pedrunn
PS: Martin you may want to take alook to make it compatible with new capture option. I could not get both to work together. |
So far no success. But I found some other problems:
code:
HandleEvent(CreateUnit) 'settler built' post { // Doesnt Work
city_t tmpCity;
unit_t tmpUnit;
city[0] = tmpCity;
unit[0] = tmpUnit;
if(CityIsValid(city[0])) {
if ((unit[0].type == UnitDB(UNIT_SETTLER)) // if a unit is one of those listed here
||(unit[0].type == UnitDB(UNIT_URBAN_PLANNER)) // ...
||(unit[0].type == UnitDB(UNIT_SEA_ENGINEER))) { //...
ReduceCity(city[0], city[0].owner);
}
}
}
Doesn't work, because you assign an empty city variable to the build in city variable the result is that the build in variable is an empty city variable, too. The same is true for the unit variable. Use this code instead and it should work:
code:
HandleEvent(CreateUnit) 'settler built' post { // Doesnt Work
city_t tmpCity;
unit_t tmpUnit;
tmpCity = city[0];
tmpUnit = unit[0];
if(CityIsValid(tmpCity)) {
if ((tmpUnit.type == UnitDB(UNIT_SETTLER)) // if a unit is one of those listed here
||(tmpUnit.type == UnitDB(UNIT_URBAN_PLANNER)) // ...
||(tmpUnit.type == UnitDB(UNIT_SEA_ENGINEER))) { //...
ReduceCity(tmpCity, tmpCity.owner);
}
}
}
This should work now. Here is another problem I found:
code:
...
|| TType == TerrainDB(TERRAIN_JUNGLE)
|| TType == TerrainDB(TERRAIN_MOUNTAIN)
|| TType == TerrainDB(TERRAIN_BROWN_MOUNTAIN)
|| TType == TerrainDB(TERRAIN_WHITE_MOUNTAIN)
|| TType == TerrainDB(TERRAIN_SWAMP)){
Event:CreateImprovement(owner, tmpLoc, newType, 0);
FinishImprovements(tmpLoc);
return 1;
}
}
...
FinishImprovement doesn't work directly afterwards a CreateImprovement event. From the testing with my rewritten GM1_Goods.slc it seems that CreateImprovement and FinishImprovements cost a lot of time therefore it is better to remove the not working ones. And put the FinishImprovements function in an post event handler triggered by the CreateImprovement event. Of course use some if's to make shure that only the right tile imps are finished.
Here is something else:
code:
elseif(TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_ANCIENT_CITY_ONE))
|| TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_MEDIEVAL_CITY_ONE))) {
GrantAdvance(owner, AdvanceDB(ADVANCE_SUBNEURAL_ADS));
Event:CreateImprovement(owner,tmpLoc, TerrainImprovementDB(TILEIMP_ANCIENT_CITY_DEAD),0)
;
RemoveAdvance(owner, AdvanceDB(ADVANCE_SUBNEURAL_ADS));
}
Again RemoveAdvance doesn't work here, therefore remove it, it will only cost processor time. Yeah I was really optimizing my GM1_Goods.slc  
code:
HandleEvent(CreateImprovement) 'DontLetPlaceImpsOverCities' pre { // Does not work
if(ExpansionPlacement == 0) { // Looks like CreateImprovement function
if(TileHasWonder(location[0]) == 1 // only works for slic placements
|| TileHasCity (location[0]) == 1) {
return STOP;
}
}
else{
ExpansionPlacement = 0;
}
}
I have no real idea about this one. Probably the problem lies in the ExpansionPlacement variable, but unfortunatly I have no idea what it should do.
-Martin
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
quote: Originally posted by Martin Gühmann
HandleEvent(CreateUnit) 'settler built' post { // Doesnt Work
city_t tmpCity;
unit_t tmpUnit;
tmpCity = city[0];
tmpUnit = unit[0];
if(CityIsValid(tmpCity)) {
if ((tmpUnit.type == UnitDB(UNIT_SETTLER)) // if a unit is one of those listed here
||(tmpUnit.type == UnitDB(UNIT_URBAN_PLANNER)) // ...
||(tmpUnit.type == UnitDB(UNIT_SEA_ENGINEER))) { //...
ReduceCity(tmpCity, tmpCity.owner);
}
}
}
[/CODE] |
The code is wrong now because of desperate attempt of getting it working. It does not work in both ways. The event is bugged for sure (IW confirmed). you can try.
quote: Originally posted by Martin Gühmann
FinishImprovement doesn't work directly afterwards a CreateImprovement event. From the testing with my rewritten GM1_Goods.slc it seems that CreateImprovement and FinishImprovements cost a lot of time therefore it is better to remove the not working ones. And put the FinishImprovements function in an post event handler triggered by the CreateImprovement event. Of course use some if's to make shure that only the right tile imps are finished. |
That part was caracterized as junk. I was going to remove it since i thought the problem was the function. Can you tell me for sure the it will work if i use it far from the CreateImprovement? I thought i would have to wait next tun to the improvement finish up. If you tell me it works this will be a major improvement to the code.
quote: Originally posted by Martin Gühmann
code:
elseif(TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_ANCIENT_CITY_ONE))
|| TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_MEDIEVAL_CITY_ONE))) {
GrantAdvance(owner, AdvanceDB(ADVANCE_SUBNEURAL_ADS));
Event:CreateImprovement(owner,tmpLoc, TerrainImprovementDB(TILEIMP_ANCIENT_CITY_DEAD),0)
;
RemoveAdvance(owner, AdvanceDB(ADVANCE_SUBNEURAL_ADS));
}
Again RemoveAdvance doesn't work here, therefore remove it, it will only cost processor time. Yeah I was really optimizing my GM1_Goods.slc  [quote]
Actually it did work. The player does not get subneural ads when their cities are pillaged anymore.
[QUOTE] Originally posted by Martin Gühmann
code:
HandleEvent(CreateImprovement) 'DontLetPlaceImpsOverCities' pre { // Does not work
if(ExpansionPlacement == 0) { // Looks like CreateImprovement function
if(TileHasWonder(location[0]) == 1 // only works for slic placements
|| TileHasCity (location[0]) == 1) {
return STOP;
}
}
else{
ExpansionPlacement = 0;
}
}
I have no real idea about this one. Probably the problem lies in the ExpansionPlacement variable, but unfortunatly I have no idea what it should do.
|
ExpansionPlacement is set to 1 if it is the CreateImprovement event is triggered by the ExpandCity function and 0 when are place by every othe way.
Last edited by Pedrunn on 20-08-2002 at 03:42
|
|
|  |
All times are GMT. The time now is 05:21. Apolyton Time is 00:21. |
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
|
|
|
|
|
|