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????
Announcement
Collapse
No announcement yet.
Cradle plagues
Collapse
X
-
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)...
-
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 }
Code:if(PPChance >= x){
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;
Hope this helps
BenConcrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
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
Comment
-
Yeah, these cradle plagues have been bugging me too. But I have a couple of questions.
why is CityCount (player[0].cities - 1)?
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.
Comment
-
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?
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?
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; January 10, 2002, 03:47.
Comment
-
why is CityCount (player[0].cities - 1)?
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.
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.
Would it be possible to give the AI plagues to but to a lesser extent than to my self, maybe half as many occurences?
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; }
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; }
Sorry about all the bugs
multiple edits: codeLast edited by Immortal Wombat; January 10, 2002, 09:13.Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
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.Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
Comment
-
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.Attached FilesConcrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
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.Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
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
DaveYes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
Comment
-
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
I'll upload the fixed file to the Modders Depot this evening (GMT) and email it to Dave too. SorryConcrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
Comment