Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > Wonderful Reality
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread   
Pages (4): [ 1   2   3   4   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:21
  Old Post 04-08-2002 00:51 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#31 Report this post to a moderator
Enter the AD-FREE zone

quote:
Originally posted by Immortal Wombat
Would triggering a STOP on the CreateImprovement event also stop the event which is supposed to create the wonder?


Yes without further modifications. But you could use a global variable if it is set to 0 then the tile improvement can't be build, if it is set to 1 it can be build. So in the event that should build the wonder improvement it will be set to 1 and afterwards to 0 again. But actual I think giving and removing the enabling advance is the way to, because the AI will try only to build the wonder improvments instead of the real ones, so in the end it wouldn't build anything.

-Martin

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 04-08-2002 01:00 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#32 Report this post to a moderator
Avatar Enlargement: We've got the solution

If I gave it an insanely high PW cost, would the AI save up for it, or build cheaper ones?

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:21
Post  Old Post 04-08-2002 01:10 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#33 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

quote:
Originally posted by Immortal Wombat
If I gave it an insanely high PW cost, would the AI save up for it, or build cheaper ones?


You could try it but I think the AI will save up for the best tile improvements that are available. I never saw an AI building roads when it was able to build railroads, the same is true for all the other tileimprovements.

-Martin

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 04-08-2002 01:25 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#34 Report this post to a moderator
Remove this text

Yeah, good point. It'll have to be the advances then

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:21
  Old Post 05-08-2002 03:23 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#35 Report this post to a moderator
Increase the size of your Attachments

Uhm, why don't you just give all the TileImps an advance as prerequisite that's impossible to research (i.e. has itself as prerequisite or is disabled with the mod_* SLIC function)?

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 05-08-2002 03:32 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#36 Report this post to a moderator
Lose 30 kilos (of popups)

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

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:21
  Old Post 05-08-2002 03:35 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#37 Report this post to a moderator
Increase Your PM Length

So? What's 20k on a 6MB download?

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 05-08-2002 03:40 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#38 Report this post to a moderator
Increase Your PM Length

6Mb??

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 17-08-2002 01:21
Edit/Delete Message Reply w/Quote
#39 Report this post to a moderator
Got spare money?

quote:
Originally posted by Locutus
Uhm, why don't you just give all the TileImps an advance as prerequisite that's impossible to research (i.e. has itself as prerequisite or is disabled with the mod_* SLIC function)?


what are the variables for the mod_CanPlayerHaveAdvance function?
(int_t, ) ???

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 17-08-2002 01:40 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#40 Report this post to a moderator
Suffering from ads?

int_t [player], int_t [advanceDB index]

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:21
Post  Old Post 17-08-2002 01:40 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#41 Report this post to a moderator
Support Apolyton, buy Civilization 2

quote:
Originally posted by Pedrunn
what are the variables for the mod_CanPlayerHaveAdvance function?
(int_t, ) ???


Just take a look into the WW_mod.slc and you will find this:

code:
// Players can not research any new technologies int_f mod_CanPlayerHaveAdvance (int_t thePlayer, int_t theAdvance) { if (theAdvance == AdvanceDB(ADVANCE_ADV_NAVAL_TACTICS) || theAdvance == AdvanceDB(ADVANCE_VERTICAL_FLIGHT_AIRCRAFT) || theAdvance == AdvanceDB(ADVANCE_SUPERSONIC_FLIGHT) || theAdvance == AdvanceDB(ADVANCE_MASS_TRANSIT) || theAdvance == AdvanceDB(ADVANCE_COMPUTER) || theAdvance == AdvanceDB(ADVANCE_GLOBAL_ECONOMICS) || theAdvance == AdvanceDB(ADVANCE_CORPORATE_REPUBLIC)) { return 0; } else { return 1; } }


So the first argument is the player index in the game in integer form.

And the second argument is the advance represented by an integer the DataBase index of the advance.

-Martin

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 17-08-2002 01:56
Edit/Delete Message Reply w/Quote
#42 Report this post to a moderator
Increase Your PM Length

Thanks

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 17-08-2002 02:58 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#43 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Did I mention, the wonder code should work - provided when you test it, you don't complete two wonders on consecutive turns. Otherwise the TI isn't built properly, and problems occur.

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 17-08-2002 04:11
Edit/Delete Message Reply w/Quote
#44 Report this post to a moderator
Support Apolyton buy from Amazon

This is making the game crash after lauching it. Any suggestion on how to make this code work.

code:
int_t ExpansionPlayer; int_f mod_CanPlayerHaveAdvance(int_t thePlayer, int_t theAdvance) { int_t tmpAdvance; int_t tmpPlayer; tmpAdvance = theAdvance; tmpPlayer = thePlayer; if(tmpPlayer == ExpansionPlayer) { if (tmpAdvance == AdvanceDB(ADVANCE_SUBNEURAL_ADS)) { return 1; } else{ return 0; } } else{ return 0; } } HandleEvent(EndTurn) 'NobodyCanCreateCities' pre { ExpansionPlayer = 0; }


And this is part of the where ExpansionPlayer is defined.
code:
ExpansionPlayer = ownerNum; GrantAdvance(ownerNum, AdvanceDB(ADVANCE_SUBNEURAL_ADS));

Right before the expansion starts. It is in the beginning of the expandCity function of my code for those who have see the code.

PS: Does the RemoveAdvance function work. I have tried to used but not with sucess.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 17-08-2002 04:35 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#45 Report this post to a moderator
Lose 30 kilos (of popups)

Ah. You appear to have prevented any player from having any advance. Put the two if() statements the other way around, replace the second 0 with a 1, and you got it.

But you don't need it really. SubNeural ads can never be researched anyway, and you just need the RemoveAdvance function in a different handler at the end of that turn to make it work.
Set up a player array as a switch, eg:

code:
int_t IsPlayerExpanding[]; // In the expandcity function if(sucess == 1){ IsPlayerExpanding[owner] = 1; } // and then later... HandleEvent(endturn) 'remove_ads' pre{ int_t i; for(i=0; i < preference("NumPlayers"); i = i + 1){ // or whatever if(IsPlayerExpanding[i] == 1){ RemoveAdvance(i, AdvanceDB(ADVANCE_SUBNEURAL_ADS)); IsPlayerExpanding[i] = 0; } } }


or something

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 17-08-2002 07:13
Edit/Delete Message Reply w/Quote
#46 Report this post to a moderator
Support Apolyton or Terrorists Win

quote:
Originally posted by Immortal Wombat
Ah. You appear to have prevented any player from having any advance.

: Now i got how those fuctions work! Thanks

quote:
Originally posted by Immortal Wombat
But you don't need it really. SubNeural ads can never be researched anyway, and you just need the RemoveAdvance function in a different handler at the end of that turn to make it work.

Actually i was hoping the mod fuction would remove the advance and not prevent its research.

I will test the RemoveAdvance function again. But your piece of code needs modification since not only players who had sucess = 1 must get the advance but all those who triggered the expansion.

Last edited by Pedrunn on 17-08-2002 at 07:29

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:21
  Old Post 17-08-2002 17:27 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#47 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Pedrunn
I will test the RemoveAdvance function again. But your piece of code needs modification since not only players who had sucess = 1 must get the advance but all those who triggered the expansion.


Can't you just remove the advance from all the players who have it?

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 17-08-2002 18:20
Edit/Delete Message Reply w/Quote
#48 Report this post to a moderator
Full PM-box? Change here!

quote:
Originally posted by J Bytheway
Can't you just remove the advance from all the players who have it?

Yep the RemoveAdvance function was working nicely with EndTurn and BeginTurn event. But that means the AI would have a whole turn with Subneural Ads. And he could place cities while with this advance. So i tried to add the fuction in the ExpandCity function. Did not work no matter where i write it . So i thought i would have to add the fuction in all event handlers but no need anymore i found the solution. Simple, yet perfect :

code:
HandleEvent(CreateImprovement) 'RemoveSubNeralAds' post { if (HasAdvance(player[0], ID_ADVANCE_SUBNEURAL_ADS)) { RemoveAdvance(player[0], AdvanceDB(ADVANCE_SUBNEURAL_ADS)); } }


This means we are only one known bug to the release of the city expansion v2.0:
Prevent the building of regular improvements over the wonders. I tried this code:
code:
HandleEvent(CreateImprovement) 'DontLetPlaceImpsOverCities' pre { // Does not work if(TileHasWonder(location[0]) == 1 // only works for slic placements || TileHasCity (location[0]) == 1) { return STOP; } }

where the functions TileHasCity and TileHasWonder are known to be working perfecly. I tried several variations and even tested the event in several ways. I got to the conclusion that the CreateImprovement event only works for slic placements .
The best solution i came up to was to dont try to stop the placement but preventing the exclusion of the Imp: All wonders and cities Imps are OceanATM and none of the regular imps can exclude this type of TI. Wich means we have to place the port in another place (suggestion: OceanMine). Bad solution yet a solution.

Last edited by Pedrunn on 17-08-2002 at 18:26

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 17-08-2002 19:39 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#49 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

code:
HandleEvent(CreateImprovement) 'RemoveSubNeralAds' post { if (HasAdvance(player[0], ID_ADVANCE_SUBNEURAL_ADS)) { RemoveAdvance(player[0], AdvanceDB(ADVANCE_SUBNEURAL_ADS)); } }

Make that a 'pre' and stick a return STOP; in, and it should work fine. In the worst case, it could prevent the AI from building one normal tile improvement, but it will always prevent suburbs being built.

code:
HandleEvent(CreateImprovement) 'RemoveSubNeralAds' pre { if (HasAdvance(player[0], ID_ADVANCE_SUBNEURAL_ADS)) { RemoveAdvance(player[0], AdvanceDB(ADVANCE_SUBNEURAL_ADS)); return STOP; } }

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:21
Post  Old Post 19-08-2002 22:23 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#50 Report this post to a moderator
Avatar Enlargement: We've got the solution

quote:
Originally posted by Immortal Wombat
Make that a 'pre' and stick a return STOP; in, and it should work fine. In the worst case, it could prevent the AI from building one normal tile improvement, but it will always prevent suburbs being built.


Yes it will always prevent suburbs being built, even the ones that are placed by slic. And actual you need the advance to build suburbs, so it must be removed afterwards. And this event handler should do it. I am just rewriting the GM1_goods.slc and this one already found its place in it. I hope I can accelerate the script a little bit and found also some stuff that didn't worked as it should be.

-Martin

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 19-08-2002 22:38 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#51 Report this post to a moderator
Increase Your PM Length

Combined with the IsPlayerExpanding[]; code above, altered a bit, so that it does not prevent the SLIC-created improvments.

-DAW4DADF

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 19-08-2002 23:10
Edit/Delete Message Reply w/Quote
#52 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Sorry you guys but i got it working this weekend. I just had no time to post here my attempts and because nothing really was defined until this morning. Everything was working. CreateImproements does stop not sliced replacements i just got confused with the game playing the sound of the placement (from martin's code). But despite the sound the improvement is not created. So there is no bug. [size = 3]This means[/size] the code is ready and working



I already started playing with it. And i have just reached Classical age without any bugs. I guess the read me is the only thing missing to release this mod (IW you dont mind if i use some pieces of your readme, do you?).

PS: Martin you may want to take alook to make it compatible with new capture option. I could not get both to work together.

Here is the final version of the code

Attachment: cityexpansion2.slc
This has been downloaded 5 time(s).

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 19-08-2002 23:55 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#53 Report this post to a moderator
Enter the AD-FREE zone

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

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 20-08-2002 00:20 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#54 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

Here's the readme. I'll email you the other graphics for the tile file.

Oh yeah, one more thing.

I removed the other units from the settlercreate handler. Not all mods have infantry units taking population and I think the advances you use push the game too late. I'd use Arcologies, and Nano Technology instead of the last two.

Attachment: vwreadme.zip
This has been downloaded 3 time(s).

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 20-08-2002 00:46
Edit/Delete Message Reply w/Quote
#55 Report this post to a moderator
Help yourself to an AD-FREE life

quote:
Originally posted by Immortal Wombat
I removed the other units from the settlercreate handler. Not all mods have infantry units taking population and I think the advances you use push the game too late. I'd use Arcologies, and Nano Technology instead of the last two.

The CreateUnit is junk. the event doest work as you confirmed And the advances for each ages alo needs to be change according to the mod. I am assuming those advances are for the original settings. I will check the read me and i am witing the new graphics.
It wont be a problem create the variations:wonder, city and city + wonder expansion.
As for the terrains , i did not wnated to limit the expansion. If a city is surrounded by swamps and creates a wonder i still want it to have the wonder around its tile.

Last edited by Pedrunn on 20-08-2002 at 00:56

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 20-08-2002 00:58 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#56 Report this post to a moderator
Support Apolyton buy from Amazon

Ok, sorry for the chain-post, but...

My Visible wonders mod is in the directory. I'm going to update that with the working code I finished last week. I really really think it would be easier if you took the wonder code completely out of the city expansion code to keep the two separate.

There will not be any SLIC clashes, all my functions have IWW prefixes.
You will need, in your readme to explain how to add a function that checks for wonders if the wonder mod is being used in conjuction with the CityX mod.

You can include:

code:
int_f HasWonder(location_t tmpLoc){ return 0; }

That will have no negative effect if no wonders are being used.
Explain how to add the TileHasImprovement lines. Its not too hard.

Get the Apolyton Standard Tile File up ASAP, and we can run from there.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:21
Post  Old Post 20-08-2002 02:23 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#57 Report this post to a moderator
Avatar Enlargement: We've got the solution

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 is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 20-08-2002 02:37
Edit/Delete Message Reply w/Quote
#58 Report this post to a moderator
Increase the size of your Attachments

quote:
Originally posted by Immortal Wombat
You will need, in your readme to explain how to add a function that checks for wonders if the wonder mod is being used in conjuction with the CityX mod.

That will have no negative effect if no wonders are being used.
Explain how to add the TileHasImprovement lines. Its not too hard.

what i dont like about you code is this:

code:
int_f IWW_WhatType(int_t tileimp) { int_t ans; if(tileimp < IWW_NumNormalTimps){ ans = 1; // normal timp } elseif (tileimp < IWW_NumNormalTimps + IWW_NumGoodTimps){ ans = 2; // Martin's goods } elseif (tileimp < IWW_NumWonders + IWW_NumNormalTimps + IWW_NumGoodTimps){ ans = 3; // WONDERS } elseif (tileimp >= IWW_NumWonders + IWW_NumNormalTimps + IWW_NumGoodTimps){ ans = 4; // City Expansions } return ans; }


Dont you think it will make our code much more compatible to each other and for others mods if you used my TileHasWonder(int_t tmpLoc) function. This way the modder just have to add #include "CityExpansion.slc" at the end of your code and remove the lines since your code would have this function already.

code:
int_f TileHasWonder(location_t tmpLoc){ return 0; }


No need to count how many normal imps, good imps city imps and wonders imps.

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:21
  Old Post 20-08-2002 02:55
Edit/Delete Message Reply w/Quote
#59 Report this post to a moderator
Remove this text

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

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:21
  Old Post 20-08-2002 04:35 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#60 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by Pedrunn
what i dont like about you code is this:
... [snip]

Yeah. I wasn't using it - I've taken it out.

I've updated the directory version. Download it and see what I've done with the code.

 
Pages (4): [ 1   2   3   4   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:21.
Apolyton Time is 00:21.
    top of page
Rate This Thread:
archivepost
Forum Jump:
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
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0735 seconds (93.68% PHP - 6.32% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net