 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
For some reason the picture did not appeared in my last post.
No problem, though. Here it is:
Attachment: citycópia.png
This has been downloaded 159 time(s).
Last edited by Pedrunn on 31-07-2002 at 06:39
|
|
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:21
|
|
quote: Originally posted by HuangShang
i never heard of the City Expansion Mod... what is it...
|
The City Expansion mod was originally part of BlueO's Alto-SciFi mod.
What it did was to make suburbs of cities appear in the surrounding terrain as the city grew. So for every 3 population points (starting at 6), an "expansion" was placed as a good, just outside the city.
The way BlueO did it was to create new terrains, each of which had these city expansion graphics as goods on that terrain.
The idea was great, but the way BlueO did it had some drawbacks, namely that the goods could be traded, and so you got little cities flying across the map.
Pedrunn and myself have been working to convert this mod into a more up-to-date one, using Martin the Dane's TileEdit program, we can add tile improvements, and use them as the suburb graphics.
There are merits to both approaches, but I think tile improvements are slightly better, and more adaptable to the circumstances.
The tile improvements can give a slight commerce bonus, have the movement cost of a road (or railroad, or maglev, depending on era), and be pillagable etc. etc.
Pedrunn: that is nice! Do you mind if I use it to replace your previous ancient age suburb?
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
I wrot this in the wonder possibilities thread. you must have missed.
quote:
As for the BlueO expansion, we can just forget it.
It has a major bug! Since the city goods arent in the beggining of the game their gold value isnt calculated.
This causes the good to have a astronomic value of thousands of gold (I guess the maximum) probably because of their rarity.
The only solution is to save and load the game.
Because the games re-calculates the goods during loading. Yet having to load the game several times during the play is a game ruiner |
I hope my english is clear.
Martin, the city good would still appear in the trade screen. Using them was going to cause caravan losts. We would have to control the AI not to use the goods. I thnk it will just lead us to new bugs. So, the best is to work on the TI expansion.
Last edited by Pedrunn on 31-07-2002 at 22:35
|
|
|  |
 |
|  |
 |
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
DP
Last edited by Pedrunn on 02-08-2002 at 23:01
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
quote: Originally posted by Immortal Wombat
I've done it for the wonders. The cities don't work, because it has to create the razed ones over the top. |
What!?! I had tried the way you did it in your mod and it didnt worked! I alway get wonders being pillaged 
quote: Originally posted by Immortal Wombat
I think you are right. The Replace**tiles function is returning sucess=0, and it so it goes to the next age back, but I don't know why. |
I have got a fix.
I re-arranged the code in a way that it only has one ReplaceTile Fuction now. But it wanst it that was causing the problem. Yet i liked the way it looked. And i think i will keep it like that.
Anyway, The problem is in the FAI_PlayerAge[] variable. I dont know why but to solve this bug i just changed it for the HasAdvance fuction.
Now i am aiming in fixing the reduce city. You also had this problem, didnt you? Any lucky?
PS: I have added the Medieval age city in the function.
PS2: I did some important changes in the tileimp.txt. once i finish with it i will attach here.
PS3: You will note that i made wonders possible to be created in any land tile (you will need to change your tileimp.txt.
Here is the new code:
Attachment: as_blueo.slc
This has been downloaded 6 time(s).
Last edited by Pedrunn on 02-08-2002 at 23:53
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
I am pretty sure you are having the same old crazy bug. Try this ExpandCity function:
code:
int_f ExpandCity(int_t owner, location_t cityLoc, int_t cityRadius, int_t tileType, int_t addDelete) {
location_t tmpLoc;
location_t tmp2Loc;
int_t i;
int_t j;
int_t k;
int_t sucess;
int_t newType;
int_t searchRadius;
int_t addDeleteYN;
int_t ownerNum;
if (FAI_INIT == 1000)
{
searchRadius = 1;
sucess = 0;
newType = tileType;
addDeleteYN = addDelete;
ownerNum = owner;
j = random(6);
if (j == 0 || j == 5 || j == 2 || j == 7) {
j = 6;
}
while (searchRadius <= cityRadius && sucess == 0) {
tmpLoc = cityLoc;
for (k = 0; k < searchRadius; k = k + 1) {
GetNeighbor(tmpLoc, j, tmp2Loc);
tmpLoc = tmp2Loc;
}
if (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& !HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& !HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& !HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplacePCTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& !HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& !HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceACTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& !HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceMCTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& !HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& !HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceACTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceGCTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceALTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
i = j + 1;
while (i != j && sucess == 0) {
tmpLoc = cityLoc;
for (k = 0; k < searchRadius; k = k + 1) {
GetNeighbor(tmpLoc, i, tmp2Loc);
tmpLoc = tmp2Loc;
}
if (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& !HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& !HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& !HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplacePCTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& !HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& !HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceACTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& !HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceMCTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& !HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& !HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceACTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& !HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceGCTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
elseif (HasAdvance(owner, ID_ADVANCE_TOOLMAKING)
&& HasAdvance(owner, ID_ADVANCE_CONCRETE)
&& HasAdvance(owner, ID_ADVANCE_GLOBAL_ECONOMICS)
&& HasAdvance(owner, ID_ADVANCE_EUGENICS)
&& HasAdvance(owner, ID_ADVANCE_ARCOLOGIES)) {
sucess = ReplaceALTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
sucess = ReplaceALTile(ownerNum, tmpLoc, searchRadius, j, newType, addDeleteYN);
}
i = i + 1;
if (i == 8) {
i = 0;
}
}
searchRadius = searchRadius + 1;
}
return sucess;
} else {
return 0;
}
}
Note: I got game crashs when when i added the medieval age function.
Last edited by Pedrunn on 03-08-2002 at 02:50
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
Here it is.
I took the create wonders fuction off the code but i kept the fuction to prevent the creation of cities over them (The very first one: "TileHasWonder").
If you want it out too just tell me.
EDIT: One funny thing, the CaptureCity Event is known to work nicely. As we can see in the partisan code, the new capture option code and many others. But it does not seems to work with the ReduceCity function . What you think?
Attachment: as_blueo.slc
This has been downloaded 4 time(s).
Last edited by Pedrunn on 06-08-2002 at 22:12
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
I feel so stupid. Indeead i cant get the PillageOrder and PillageUnit to work. But the CutImprovements do work. my trouble was that i used a local variable to call the location variable of the event. when i used the built in variable location[0] all worked nicely.
Last edited by Pedrunn on 12-08-2002 at 07:33
|
|
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:21
|
|
Excellent. I just came by to find that picture you posted, again. I lost it last time. So I take it the pillaging does now work?
Oh, about that bug in the CaptureCity event, I think it is because the city owner is changing across the course of that handler. Set the handler to post, rather than pre, and the owner will be the conqueror, and when the expand city code fires, the tile improvement will be able to be built by the new owner, in the new owner's territory.
I think. 
I figured out the bug in the wonder code, so I'll get this lot wrapped up, and release it again.
Pedrunn, unless you want me to continue administering to the tile files, and the overall conception of this, its your mod: most of the graphics are yours, its your code.
I'm happy to write the readme and collect it all together, but its your decision.

|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
quote: Originally posted by Immortal Wombat
Excellent. I just came by to find that picture you posted, again. I lost it last time. So I take it the pillaging does now work?. |
Yep it work fine except for a small bug. The CutImprovents event only prevents the TI to be cutted. yet pillage still happen (the effect and the unit looses movements). This makes the AI try to pillage over and over and over every turn although Imps remains untouched. So i am making a function to make the units move out of this TI.
quote: Originally posted by Immortal Wombat
Oh, about that bug in the CaptureCity event, I think it is because the city owner is changing across the course of that handler. Set the handler to post, rather than pre, and the owner will be the conqueror, and when the expand city code fires, the tile improvement will be able to be built by the new owner, in the new owner's territory. |
I will try this. But i am feeling this will work out. since the city owner has to be also the owner of the terrain where the city imp is going to be added. And that is where the problem lies.
quote: Originally posted by Immortal Wombat
I figured out the bug in the wonder code, so I'll get this lot wrapped up, and release it again. |
I did not got what you meant by this. Are you going to give up of your code and use mine? Or will you fix it?
quote: Originally posted by Immortal Wombat
Pedrunn, unless you want me to continue administering to the tile files, and the overall conception of this, its your mod: most of the graphics are yours, its your code.
I'm happy to write the readme and collect it all together, but its your decision. |
To tell you the truth i have already made some changes in the til file so i do want to take care of the til nad control whoever wants to add new things to it.
I can do the read me but i prefer that you make it. you have a better english and i am starting to get busy here with real life, the religion code, City expansion and the GL of my mod that never finishs). So do you want to take the read me work?
PS: There seems to be a imcompatibility with the Martin's new capture options code. No matter what i change in both codes I cant get the surrouding suburbs to reduce if the city is bloodbath, enslaved or evacueted. I will attach the new code soon so that you can give it a shot too.
|
|
|  |
 |
|  |
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
|
|
|
|
|
|