Random Events Mod V0.1 - Olympics

Status
Not open for further replies.
Wow what a good idea. Maybe in a modded game you could have a tech called sports or something and the first to invent it gets the first olympics and after that its random or voteting or something (national prodject does spring to mind) .. maybe it could be made to be a good and bad-when someone "gets" to have an olympic they have to make a project that will effiently tax one city in someway, may it be that you need to finish a project or tax your commerce or anything..it could when finished give you a relations bonus to everyone for hosting it or some other form of compensation.. Just ideas :)
 
Samuelson said:
If youre going to make disieses try making it like a religion, but with negitive effects. That way it spreads to everyone. Then maybe you could build buildings to prevent it, like hospitals or sewers or something.

I'd say that simply making unhealthy cities more susceptible and healthy cities less susceptible and varying the damage of disease accordingly would be the best way to handle this.
 
I had trouble to install it cause i am a new user of PC computers...

I have unzipped the folder in the right spot. It is named olympics somthing.... inside of it, there is the custom asset folder, what do i have to do with it???

can anyone help me please?

By the way, your mod looks great! I can't wait to get it to work!

Thanks for doing such a thing!
 
Another humble suggestion. Kinda like the Olympics but World Fairs! I'm not sure the possible effects, culture and happiness perhaps? Don't know if this is possible, but I'd like to see it. Great mod by the way.
 
Hi everyone, I'll start off by saying thanks for the ideas about how to extend the olympics, but most of the ideas are beyond the scope of a general random events mod. I'd be spending all my time developing this-and-that feature for the olympics and wont have any time for the other stuff I'd like to do.

Note: I'm fairly fluent in most other programming languages besides python, so if my syntax is a bit off, that's why.

Thanks for the code, I'll put it in. This is the first time I've used python, but once you learn one language its easy to learn others. I mainly program in c++ and work on my own little projects at home. I have a degree in software engineering but dont program in my job; employment in the industry is difficult these days with so many young men doing IT degrees. Anyway, programming business apps isnt exactly exciting work :)

my suggestion would be to have a colosseum / stadium type of building as a prerequiste.

Having a colosseum is the prerequisite, as well as at least 10 population.

Have you looked at the Desert War scenario script? It seems to save some data using setScriptData for the CyPlayer class.

Yep, I've had a quick look at it. When I get time off from work I'll definitely look into it more.

IMHO it might be worth making plagues be a building instead, and using scripts to spread them.

Yeah, plagues as a building might work if I can't get the setScriptData working between save games. Actually now that I think about it, having a building would also be a way of showing a user what cities are affected by the plague, assuming I can't put a symbol on the main map screen somehow. Or I could use an immobile unit near a city. And yes, I was going to use scripts to spread them.

I'd say that simply making unhealthy cities more susceptible and healthy cities less susceptible and varying the damage of disease accordingly would be the best way to handle this.

Indeed. The damage varying part is difficult because I'm pretty sure you cant adjust the the amount of stockpiled food (if anyone knows otherwise please correct me!), so it would have to be a chance of population decrease every turn.

I'll start on the coding tomorrow and should have something done by next Wednesday.
 
I think it is a great idea. It would also be cool if you could make it so the first Olympics is held when someone discovers Calendar - and the first person to do so gets the Olympics in one of his cities. :)
 
I haven't read the whole post but, consider making the World Cup final one of your special events. Australia just made it for the first time since the 70's and that would be a great event since the whole world pretty much participates in it and it happens every 4 years, right?
Either way, you have a great idea and I'm sure others will help you improve it :)
 
I was just having trouble to install this mod, can anyone please help me out on this one?

I read the first message on hoe to install it and i still can't have it right...

thanks in advance!
 
I was going to try to translate a Decimal to Roman Numeral function I had written in C++ to Python. But since I don't really know python, and since my code was a bit long (simple, but repetetive), I figured I'd search the internet quickly. And on the first page of search results, I found two algorithms, both in Python, the first recursive, and the second non-recursive. The second looks like it should be really easy to integrate into your code.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/415384

Victor Yang's recursive version:
Code:
"""
Victor Yang, pythonrocks@yahoo.com

Convert decimals to Roman numerials.
I use a recursive algorithm here since it reflects the thinking clearly in code.
A non-recursive algothrithm can be done as well.

usage: python roman.py 
It will run the test case against toRoman function
"""

import sys
import unittest


# these two lists serves as building blocks to construt any number
# just like coin denominations.
# 1000->"M", 900->"CM", 500->"D"...keep on going 
decimalDens=[1000,900,500,400,100,90,50,40,10,9,5,4,1]
romanDens=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]


def toRoman(dec):
	"""
	Perform sanity check on decimal and throws exceptions when necessary
	"""		
        if dec <=0:
	  raise ValueError, "It must be a positive"
         # to avoid MMMM
	elif dec>=4000:  
	  raise ValueError, "It must be lower than MMMM(4000)"
  
	return decToRoman(dec,"",decimalDens,romanDens)

def decToRoman(num,s,decs,romans):
	"""
	  convert a Decimal number to Roman numeral recursively
	  num: the decimal number
	  s: the roman numerial string
	  decs: current list of decimal denomination
	  romans: current list of roman denomination
	"""
	if decs:
	  if (num < decs[0]):
	    # deal with the rest denomination
	    return decToRoman(num,s,decs[1:],romans[1:])		  
	  else:
	    # deduce this denomation till num<desc[0]
	    return decToRoman(num-decs[0],s+romans[0],decs,romans)	  
	else:
	  # we run out of denomination, we are done 
	  return s


class DecToRomanTest(unittest.TestCase):

	def setUp(self):
		print '\nset up'
	def tearDown(self):
		print 'tear down'
	
	def testDens(self):
		
	   for i in range(len(decimalDens)):
		r=toRoman(decimalDens[i])
		self.assertEqual(r,romanDens[i])

	def testSmallest(self):
		self.assertEqual('I',toRoman(1))

	def testBiggest(self):
		self.assertEqual('MMMCMXCIX',toRoman(3999))

	def testZero(self):
		self.assertRaises(ValueError,toRoman,0)

	def testNegative(self):
		
		self.assertRaises(ValueError,toRoman,-100)


	def testMillonDollar(self):
		
		self.assertRaises(ValueError,toRoman,1000000)

		

if __name__ == "__main__":
	
	unittest.main()

Raymond Hettinger's non-recursive version:
Code:
coding = zip(
    [1000,900,500,400,100,90,50,40,10,9,5,4,1],
    ["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]
)

def decToRoman(num):
    if num <= 0 or num >= 4000 or int(num) != num:
        raise ValueError('Input should be an integer between 1 and 3999')
    result = []
    for d, r in coding:
        while num >= d:
            result.append(r)
            num -= d
    return ''.join(result)


for i in xrange(1,4000):
    print i, decToRoman(i)
 
Quoting this post from another thread here because this is a more appropriate place for it:
SlayerofDeitys said:
Expounding on the random natural disasters that are already being added I would like to see some multiple choice events like an older computer game I played called Castles I believe. As the king of the country you would have random events pop up such as whether or not you wanted to allow a person or such through your land. If you did and they turned out to be devil worshipers then god would smite you. :satan: Not really but you get my point.

So, maybe a town&#8217;s person could come to you in the ancient era and say that Antium's people are afraid of a wild beast that has been eating people and live stock in the middle of the night.
Do you:
A. Worship the beast and sacrifice some of the people of Antium regularly (lowers happiness and population, increases wild animals in enemy territory)
B. Take the towns representitive head and have it put on display as a warning to all who dare bother you with such trivial concerns (lowers happiness but decreases random events)
C. Send your units to subdue the creature. ( Uber bear would appear on the map and if you successfully kill it happiness goes up and you gain extra gold in tribute from Antium, if you ignore it then Antiums' population decreases every so often)

These events could partly be based on religion as well. If your country is Christian you may have a Salem witch trial type of event, or a crusade against a Muslim country may travel through your land and you have the option to commit troops. In the modern era you might have an abortion issue brought before you, or alien abductions or things along those lines.

Obviously I haven't sat down and fleshed out these ideas and better events, bonuses and penalties need to be created. Of course if you think it is the worst thing to happen to the game ever you should also have the option to turn it off. Hopefully I explained my thought process well enough to see what everyone thinks. I don't know if this really fits a game like civilization but I for one would like more of a role playing aspect added to the game. I think it would add an element of immersion to it even if it doesn't mean much in the game overall.
 
Thanks Exponent! I'll put it in tonight while I'm on night shift at work :)

The damage varying part is difficult because I'm pretty sure you cant adjust the the amount of stockpiled food (if anyone knows otherwise please correct me!)

Thanks to the new Civ 4 Wiki I've found out about all the functions from the CvPythonExtensions file. There's heaps more functions than I thought - I was basing my ideas only on what was in the Python files, but all the functions in the CvPythonExtensions are usable. Thanks to Etchasketch (whoever that is) for posting the info about the use of pydocs!!

Just as a test I managed to change terrain types, terrain improvements, stockpiled food and the amount of researched tech. Lots more you can change too :)
 
Shadowlord said:
Quoting this post from another thread here because this is a more appropriate place for it:
SlayerofDeitys said:
Expounding on the random natural disasters that are already being added I would like to see some multiple choice events like an older computer game I played called Castles I believe. As the king of the country you would have random events pop up such as whether or not you wanted to allow a person or such through your land. If you did and they turned out to be devil worshipers then god would smite you. Not really but you get my point.

So, maybe a town’s person could come to you in the ancient era and say that Antium's people are afraid of a wild beast that has been eating people and live stock in the middle of the night.
Do you:
A. Worship the beast and sacrifice some of the people of Antium regularly (lowers happiness and population, increases wild animals in enemy territory)
B. Take the towns representitive head and have it put on display as a warning to all who dare bother you with such trivial concerns (lowers happiness but decreases random events)
C. Send your units to subdue the creature. ( Uber bear would appear on the map and if you successfully kill it happiness goes up and you gain extra gold in tribute from Antium, if you ignore it then Antiums' population decreases every so often)

These events could partly be based on religion as well. If your country is Christian you may have a Salem witch trial type of event, or a crusade against a Muslim country may travel through your land and you have the option to commit troops. In the modern era you might have an abortion issue brought before you, or alien abductions or things along those lines.

Obviously I haven't sat down and fleshed out these ideas and better events, bonuses and penalties need to be created. Of course if you think it is the worst thing to happen to the game ever you should also have the option to turn it off. Hopefully I explained my thought process well enough to see what everyone thinks. I don't know if this really fits a game like civilization but I for one would like more of a role playing aspect added to the game. I think it would add an element of immersion to it even if it doesn't mean much in the game overall.

Some great stuff there man, thanks for quoting that Shadowlord.

I think those features woule be great, especially the random things from townsfolk.
 
just a comment on the mod as it is now, something needs to be done to make it more random, i was playing as the Canadians and the first five olymipcs were held in Vancouver, i didnt mind too much cause it was my city but for realism it should be made more random, but other then that mad props for this i dea, i still loves this concepy
 
i think its ok like it is, the first olympics in manjkind where held in greece, too...

So, i would suggest the following:

make it depending on a wonder which gives the builder the location of the following olympics... these olympics should be made random between 15 - 30 turns... after quiet some time and a special technology, maybe industrilisation, its going to be random in different cities over the world, but in a 16 turns cycle... would make it more realistic...
 
I would make it keep a list of the last 5 cities where it was held so it doesn't repeat unless necessary. I also had an idea for a negative effect that makes sense - every civ should get a peek at the city where they are being held (like when the city has your religion) so they can see the military units there, etc. Also an attack on the city where they are being held should have diplomatic consequences.
 
One thing you could add to your mod is the noble prize, (as someone stated previously). How about the one that gets the prize get a free Great scientist or engineer?
 
Update on this mod:

Currently I'm converting it so it goes in the civilization 4\mods folder instead, so if you're having problems installing it please wait for the new version.
 
Random events are a great idea!

Maybe your relations with an AI civ could be randomly altered ("Your citizens burn an effigy of Mao! -2 relations with China"; "One of your artists paints a portrait of Mao! +2 relations with China").

Or maybe the value of a random resource could increase ("Demand for silks skyrockets! Silks now produce +2 commerce and +2 happiness").

I don't know anything about computer programing so I'm not sure if these ideas can really be implemented. They just came to me as I was reading this post.
 
Status
Not open for further replies.
Top Bottom