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 > Cradle plagues
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
The Raptor is offline The Raptor
Settler
Lincoln, NE
Jan 2002
time: 23:17
Question  Old Post 10-01-2002 03:15
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Cradle plagues Suffering from ads?

Where do I go to either end plagues, or at least slow them down? I suffered through 4 plagues in 200 years. How's a civ supposed to grow with that looming over their heads????

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:17
  Old Post 10-01-2002 03:22 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Enter the AD-FREE zone

I agree, random events are cool but Cradle's plagues are a little over the edge... it's plain frustrating. I haven't gotten around to looking at the code yet, so I don't know how easily it can be changed. BTW does this code only work for human players of something? I never noticed the AI getting struck by a plague (plenty of earthquakes though)...

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

Whether or not the AI is afflicted is a matter of choice.

To reduce the risks of plagues with normal settings, build aqueducts, drug stores, hospitals and aqua filters. Bit of a bugger in the ancient age I admit, but still, Sh!t happens. If you find this particular brand of fecal waste happens too often, open the code:
(locutus ) This is not Cradle code, this is mine own, but Cradle's in very similar.

code:
void_f Plague (int_t thePlayer){ int_t tmpPlayer; tmpPlayer = thePlayer; if(IsHumanPlayer(tmpPlayer)){ // take this line out in if you do want to affect the AI //message(1, 'startdata'); int_t CityCount; player[0] = tmpPlayer; CityCount = player[0].cities - 1; PlaguedCityCounter = 0; int_t i; for(i = 0; i < CityCount; i = i + 1){ //message(1, 'testdata'); int_t PPChance; PPChance = random(100); city_t PlaguedCity; GetCityByIndex(tmpPlayer, i, PlaguedCity); if(PlaguedCity.population >= 3){ // // Building that reduce plague chance are: // aqueduct, drug store, aqua-filter, hospital // // Start = 50/50 chance of plague in PlaguedCity // + aqueduct --> 40/60 chance // + drug store --> 30/70 chance // + hospital --> 20/80 chance // + aqua filter --> 10/90 chance // if(CityHasBuilding(PlaguedCity, "IMPROVE_AQUEDUCT")){ PPChance = PPChance - 10; } if(CityHasBuilding(PlaguedCity, "IMPROVE_DRUG_STORE")){ PPChance = PPChance - 10; } if(CityHasBuilding(PlaguedCity, "IMPROVE_HOSPITAL")){ PPChance = PPChance - 10; } if(CityHasBuilding(PlaguedCity, "IMPROVE_AQUA_FILTER")){ PPChance = PPChance - 10; } if(PPChance >= -40){ // replace to 50 again for a base 50/50 chance of strike city[0] = PlaguedCity; int_t tmpDead; tmpDead = city[0].population/3; int_t j; for(j = 0; j < tmpDead; j = j + 1){ Event:KillPop(PlaguedCity); } Event:AddHappyTimer(PlaguedCity, 3, -2, 14); // 3 turns of -2 happiness PlaguedCityCounter = PlaguedCityCounter + 1; } } } player[0] = tmpPlayer; if(PlaguedCityCounter >= 1){ if(HasAdvance(tmpPlayer, ID_ADVANCE_MEDICINE)){ message(tmpPlayer, 'EpidemicYou'); if(tmpPlayer != ND_human){ message(ND_human, 'EpidemicOther'); } } else{ message(tmpPlayer, 'PlagueHitYou'); if(tmpPlayer != ND_human){ message(ND_human, 'PlagueHitOther'); } } } else{ message(tmpPlayer, 'PlagueDidntHitYou'); if(tmpPlayer != ND_human){ message(ND_human, 'PlagueDidntHitOther'); } } } // closing the IsHuman brackets }


find this line:
code:
if(PPChance >= x){

and reduce the number x by 10 or 20. This will cut down the chance.
Then /reloadslic in the chat window.

If you want to reduce the effects of the plague, find this line:
code:
tmpDead = city[0].population/3;

and make the 3 to a 4 or 5. (so 1/4 or 1/5 die instead of 1/3 the population)

Hope this helps
Ben

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:17
  Old Post 10-01-2002 05:08 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Suffering from ads?

Okay, this explains a few things. First: why is CityCount (player[0].cities - 1)? This way the 'youngest' city of the empire never gets hit by a plague. This looks very odd: at one point, all my cities had shrunken to size 8 or thereabouts while 1 city was still size 45

More importantly: you have set the PPChance condition to -40! Surely, this should be 40 (or 50, judging from the comment behind it). As it is, all cities always get struck by a plague as it is impossible to get a PPChance lower than -40. Without this bug the effects of a plague would be far less severe (esp later on in the game) and thus make this feature much less frustrating, possibly even fun

Boney is offline Boney
Warlord
Thailand
Jan 2001
time: 05:17
  Old Post 10-01-2002 07:15
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Enter the AD-FREE zone

Yeah, these cradle plagues have been bugging me too. But I have a couple of questions.

quote:
why is CityCount (player[0].cities - 1)?


Firstly if I changed cities - 1 to cities - 5, would this mean that 5 cities would be unaffected by plagues every time they occur?

Secondly, if I was to make these changes would they apply to the game I am currently playing? I have been hit hard by these plagues, but if just a few more cities were unaffected it would be okay.

I think that even in cradle the AI needs all the help it can get, so I don't think I need to give the plague to them too. But I might yet change my mind.

Would it be possible to give the AI plagues to but to a lesser extent than to my self, maybe half as many occurences?


Still loving cradle, but I found that the mega huge map created too much management towards the end of the game. Normal size with ten civs seems good for me right now.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:17
  Old Post 10-01-2002 12:39 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

quote:
Originally posted by Boney
Firstly if I changed cities - 1 to cities - 5, would this mean that 5 cities would be unaffected by plagues every time they occur?


Yes, but it would always be the 5 youngest cities in your empire: the 5 cities you last founded/conquered. If you don't get new cities for a while it would be the same cities that would be protected all the time, I can't think of a reason why anyone would want this (there are more sophisticated ways of protecting certain cities, IW's idea of recuded risk for cities with certain tile improvements is just one of them).

quote:
Secondly, if I was to make these changes would they apply to the game I am currently playing? I have been hit hard by these plagues, but if just a few more cities were unaffected it would be okay.


You would have to open the chatbox (with the '-key) and type /reloadslic, but yes, that should work.

quote:
I think that even in cradle the AI needs all the help it can get, so I don't think I need to give the plague to them too. But I might yet change my mind.


I agree, I originally wanted to give plagues to the AI to as he was having 40+ cities while I was kept down to somewhere between 8 and 25 (with such a gap you can impossibly compete at Deity level), but with the bug fixed I think I'll keep it the way it is for now.

quote:
Would it be possible to give the AI plagues to but to a lesser extent than to my self, maybe half as many occurences?


That would be entirely possible, simply add a check for 'IsHumanPlayer(tmpPlayer)' before executing the line 'tmpDead = city[0].population/3;' and make an else-clause where you do 'tmpDead = city[0].population/6;' instead (this would result in the city becoming 1/6 of the original size, instead of the 1/3 that is used for humans).

Edit: BTW, Ben, if you want to kill pop you can also use AddPop with a negative number, that way you don't need the entire for-loop thingie. Just use 'AddPop(tmpCity, -2*city[0].population/3)', that would reduce the city to 2/3 of it's original size.

Last edited by Locutus on 10-01-2002 at 12:47

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:17
  Old Post 10-01-2002 18:06 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Civilization 2

quote:

why is CityCount (player[0].cities - 1)?

Dunno, It made sense at the time

quote:

Edit: BTW, Ben, if you want to kill pop you can also use AddPop with a negative number, that way you don't need the entire for-loop thingie. Just use 'AddPop(tmpCity, -2*city[0].population/3)', that would reduce the city to 2/3 of it's original size.

I know. I just found it easier to do everything on different lines rather than have long calculations. No doubt the game thinks otherwise...

quote:

More importantly: you have set the PPChance condition to -40! Surely, this should be 40 (or 50, judging from the comment behind it). As it is, all cities always get struck by a plague as it is impossible to get a PPChance lower than -40.

Hence the rider at the top - this is my test code. I thought I had changed it in the version I posted, and was subsequently put into Cradle. Maybe that one slipped past me.

quote:
Would it be possible to give the AI plagues to but to a lesser extent than to my self, maybe half as many occurences?

You could reduce the effects as Locutus suggests, or you could cut out this bit:

code:
if(PPChance >= -40){ city[0] = PlaguedCity; int_t tmpDead; tmpDead = city[0].population/3; int_t j; for(j = 0; j < tmpDead; j = j + 1){ Event:KillPop(PlaguedCity); } Event:AddHappyTimer(PlaguedCity, 3, -2, 14); // 3 turns of -2 happiness PlaguedCityCounter = PlaguedCityCounter + 1; }

and replace it with:
code:
if(PPChance >= 80){ // replace to 50 again for a base 50/50 chance of strike city[0] = PlaguedCity; int_t tmpDead; tmpDead = city[0].population/3; int_t j; for(j = 0; j < tmpDead; j = j + 1){ Event:KillPop(PlaguedCity); } Event:AddHappyTimer(PlaguedCity, 3, -2, 14); // 3 turns of -2 happiness PlaguedCityCounter = PlaguedCityCounter + 1; } elseif(PPChance >= 50 && IsHumanPlayer(tmpPlayer)){ //bug fix city[0] = PlaguedCity; int_t tmpDead; tmpDead = city[0].population/3; int_t j; for(j = 0; j < tmpDead; j = j + 1){ Event:KillPop(PlaguedCity); } Event:AddHappyTimer(PlaguedCity, 3, -2, 14); // 3 turns of -2 happiness PlaguedCityCounter = PlaguedCityCounter + 1; }


Tht way humans get 50% hit, AI gets 20% hit without any building modifications to the probabilities.

Sorry about all the bugs

multiple edits: code

Last edited by Immortal Wombat on 10-01-2002 at 18:13

hexagonian is offline hexagonian
King
Gnawing on your mind...
Jun 1999
time: 23:17
  Old Post 10-01-2002 21:44 Visit hexagonian's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Browse Apolyton AD-FREE

The percentages of plagues in Cradle are reduced by building the medical tree buildings (Apothecaries, Physician, Bathhouse and so forth).

I agree that the effects at this point in time are a little over the edge, especially since the effect is so powerful. I had tried to take out the line that would allow them to occur to the AI, so at least the same effect would be across the board, but I got a lot of SLIC errors, so I just reverted back to the original.

Send me a revised SLIC file and I'll post it.

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

It shouldn't affect the AI anyway...

Here is an updated file. 50/50 chance in each city. 20% population killed off rather than 33%. Only for human, and should hit your youngest city now too.

Attachment: nd_main.slc
This has been downloaded 24 time(s).

Boney is offline Boney
Warlord
Thailand
Jan 2001
time: 05:17
  Old Post 12-01-2002 19:21
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Tired of ads?

I tried to reduce effects of plague cut and pasting as suggested by Immortal Com. Now every time I play cradle it comes up with problems in both lines 178 and 180 in the slic how can this be remedied.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:17
  Old Post 12-01-2002 19:27 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Put an end to popups!

What did the errors say?
I can't find any bugs in the attachment above, did you try that?
Probably you cut out a { or } where it shouldn't, or left it in. Could be that my cut-paste suggestion was wrong.

Boney is offline Boney
Warlord
Thailand
Jan 2001
time: 05:17
  Old Post 12-01-2002 19:51
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton buy from Amazon

The error says:

...disasters,slc.178:symbol'tmpdead' already has a type

and

...disasters,slc.180: symbol 'j' already has a type

I must say your reply was pretty quick

hexagonian is offline hexagonian
King
Gnawing on your mind...
Jun 1999
time: 23:17
  Old Post 14-01-2002 19:27 Visit hexagonian's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

I tried downloading the revised SLIC file and got a file with a lot of gibberish in it.

Ben, email me your revised file. Thanks

Dave

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:17
  Old Post 14-01-2002 21:05 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Help yourself to an AD-FREE life

quote:
Originally posted by Boney
The error says:

...disasters,slc.178:symbol'tmpdead' already has a type

and

...disasters,slc.180: symbol 'j' already has a type

I must say your reply was pretty quick

Well, I was just leaving when I saw your reply, so I came back

I'll upload the fixed file to the Modders Depot this evening (GMT) and email it to Dave too. Sorry

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:17.
Apolyton Time is 00:17.
    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.0464 seconds (89.08% PHP - 10.92% 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