Results 1 to 14 of 14

Thread: Cradle plagues

  1. #1
    The Raptor
    Settler
    Join Date
    09 Jan 2002
    Location
    Lincoln, NE
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    10:15

    Question Cradle plagues

    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????

  2. #2
    Locutus
    Deity Locutus's Avatar
    Join Date
    23 Nov 1999
    Location
    De Hel van Enschede
    Posts
    11,706
    Country
    This is Locutus's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    18:15
    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)...
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

  3. #3
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,965
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    16:15
    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

  4. #4
    Locutus
    Deity Locutus's Avatar
    Join Date
    23 Nov 1999
    Location
    De Hel van Enschede
    Posts
    11,706
    Country
    This is Locutus's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    18:15
    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
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

  5. #5
    Boney
    Warlord
    Join Date
    02 Jan 2001
    Location
    Thailand
    Posts
    277
    Country
    This is Boney's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    17:15
    Yeah, these cradle plagues have been bugging me too. But I have a couple of questions.

    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.

  6. #6
    Locutus
    Deity Locutus's Avatar
    Join Date
    23 Nov 1999
    Location
    De Hel van Enschede
    Posts
    11,706
    Country
    This is Locutus's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    18:15
    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).

    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.

    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.

    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; January 10, 2002 at 02:47.
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

  7. #7
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,965
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    16:15
    why is CityCount (player[0].cities - 1)?
    Dunno, It made sense at the time

    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...

    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.

    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; January 10, 2002 at 08: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

  8. #8
    hexagonian
    Emperor hexagonian's Avatar
    Join Date
    25 Jun 1999
    Location
    Smemperor
    Posts
    3,456
    Country
    This is hexagonian's Country Flag
    Thanks
    0
    Thanked 1 Time in 1 Post
    Local Date
    May 25, 2013
    Local Time
    11:15
    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...

  9. #9
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,965
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    16:15
    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 Files Attached Files

  10. #10
    Boney
    Warlord
    Join Date
    02 Jan 2001
    Location
    Thailand
    Posts
    277
    Country
    This is Boney's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    17:15
    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.

  11. #11
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,965
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    16:15
    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.

  12. #12
    Boney
    Warlord
    Join Date
    02 Jan 2001
    Location
    Thailand
    Posts
    277
    Country
    This is Boney's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    17:15
    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

  13. #13
    hexagonian
    Emperor hexagonian's Avatar
    Join Date
    25 Jun 1999
    Location
    Smemperor
    Posts
    3,456
    Country
    This is hexagonian's Country Flag
    Thanks
    0
    Thanked 1 Time in 1 Post
    Local Date
    May 25, 2013
    Local Time
    11:15
    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
    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...

  14. #14
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,965
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 25, 2013
    Local Time
    16:15
    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

Similar Threads

  1. Rhye's and plagues
    By Kuciwalker in forum Civilization IV General
    Replies: 1
    Last Post: August 17, 2007, 08:43
  2. Plagues in history
    By Bugs ****ing Bunny in forum Off Topic
    Replies: 1
    Last Post: July 4, 2007, 17:07
  3. Plagues
    By d_bertelli in forum Civilization IV General
    Replies: 7
    Last Post: February 2, 2004, 08:47
  4. Cradle 1.31
    By hexagonian in forum CtP2-Creation/AI/Mods/Scenarios-Archive
    Replies: 105
    Last Post: August 28, 2003, 17:21
  5. cradle barbs and plagues
    By Boney in forum CtP2-General/Help/Strategy/Multiplaying-Archive
    Replies: 5
    Last Post: April 14, 2003, 16:53

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!

Bookmarks

Posting Permissions