View Full Version : Random Events Mod


DireAussie
Nov 20, 2005, 01:49 AM
Latest release - Version 1.31

This is a non-fully tested version of Random Events mod. It will work with the latest version of Civ 4, but the new label code hasnt been fully tested (though it should work under most circumstances). Unfortunately I dont have the time at the moment to develop this mod to its full potential.

DireAussie
Nov 20, 2005, 01:50 AM
It is now a mod in its own right, which is where most of my work went into. Having it in the customassets folder causes a host of issues, such as what happens if Firaxis update their core files. Its also annoying for a user who wants to play a mod and then has to get rid of the files from customassets.

I encountered a bit of frustration with this version. As you know, the olympics screen was a type of CyGInterfaceScreen. I made another for the locust swarm but when they both popped up, the second one made the first one disappear straight away, and also made other stuff disappear like the tech discovery popup. I think this is a bug. So I have had to use Firaxis's PyPopup class. Not as versatile but it does the job, and instead of 600 lines of code across 5 files it uses about 20 with no extra files

I tried everything to try and write a 2D image on the map, but had no success. There must be some way of doing it because Civ 4 can write the 2D food, coins and hammers on the map. Landmarks do it well enough, even though they're ugly.

suggest to make it so that a civ that's at war can't host the olympiad.

I was thinking of doing this. Maybe in a later version.

Plankhead
Nov 20, 2005, 07:04 PM
I think the Olympics should only be hosted by Civs with high culture. I often find rivals in last place hosting the Olympics before I get to, and even though I agree they should eventually do it (i.e. after a civ hosts them once, it won't again for a while), I think the most cultured civs should get priority.

And perhaps the most advanced civs could get the World's Fair.

NickSD
Nov 21, 2005, 04:13 AM
This is an awesome bit of coding! Bravo!

I wish I could add non-random events to my scenario, that mostly add historical flavor text. Any guides out there?

Jecrell
Nov 21, 2005, 04:30 AM
I know how you feel DireAussie... Carthage still looks like 1.0, but it's 1.2

DireAussie
Nov 21, 2005, 04:46 AM
I encountered a bit of frustration with this version. As you know, the olympics screen was a type of CyGInterfaceScreen. I made another for the locust swarm but when they both popped up, the second one made the first one disappear straight away, and also made other stuff disappear like the tech discovery popup. I think this is a bug. So I have had to use Firaxis's PyPopup class. Not as versatile but it does the job, and instead of 600 lines of code across 5 files it uses about 20 with no extra files

quoting from myself - I think I've fixed the screens problem, but not without more restructuring, which again took most of my time :) Now instead of creating several screens for the different popups I just have one big screen where I create and destroy the widgets for the different events. I've now gotten rid of the crappy PyPopups and brought back my own screens with nice, centred text.

Another added advantage - the popups dont all come at once, they come one after the other, so the sounds dont overlap. And even more importantly, you can hit the return or the numberpad enter key to close the popup, essential for annoying popups that you just want to get rid of while you have the romans on the brink of defeat :)

EDIT: Still in testing. Wont be until the start of next week because I have a full time job - release of version 1.1 and earthquakes! :crazyeye:

Your existing saved games (when started with the random events mod active) will be compatible with the new version :king: and will continue to be for all future releases

Plankhead
Nov 21, 2005, 01:52 PM
My game givesme an error when it tries to load CvEventInterface.py, and when I play a game there is, in fact, no interface. What's going on?

DeathCyclops
Nov 21, 2005, 05:08 PM
which files do I remove from custom assests?(that are your previous mod's files)

HeroFromHyrule
Nov 21, 2005, 11:48 PM
So, now that this is a full-blown mod, what file do we edit to make Civ4 launch the mod by default when the game is started? Somebody mentioned a file that can be edited to do this in a previous thread, but I don't know which file it is or which line it is. Perhaps you should edit this into the OP so people can find it straight away.

Other than that, looks great!

lobosan
Nov 22, 2005, 12:34 AM
Tomorrow - release of version 1.1 and earthquakes! :crazyeye:



Great!
I was looking for any hints on the forum about how major meteorite impacts (as rare random events) could be implemented. I am looking forward to learning/borrowing from your code (I have no Python experience and am a lazy Java/JavaScript amateur).

Eventually, I would like to move towards a global climate change mod with ice ages and much better global warming events than those caused by the in-game nuclear explosions.

My ultimate goal would be to develop a vegetation/ecosystem model. A simpler one could be the succession model (http://en.wikipedia.org/wiki/Ecological_succession) but a state and transition model (http://frap.cdf.ca.gov/projects/hardwood_expert/building_state/overview2.htm) would be more interesting.
Now … I am not sure if it would be a fun mod to play ;)

edit: found a better state and transition model example

ToastyAlbus
Nov 24, 2005, 12:41 AM
Direaussie, if you were wanting a We love the King day when the Olympiad happened,couldn't you just remove all unhappiness from the city for that turn?

upthorn
Nov 24, 2005, 11:11 AM
Great!
I was looking for any hints on the forum about how major meteorite impacts (as rare random events) could be implemented. I am looking forward to learning/borrowing from your code (I have no Python experience and am a lazy Java/JavaScript amateur).

Eventually, I would like to move towards a global climate change mod with ice ages and much better global warming events than those caused by the in-game nuclear explosions.

My ultimate goal would be to develop a vegetation/ecosystem model. A simpler one could be the succession model (http://en.wikipedia.org/wiki/Ecological_succession) but a state and transition model (http://frap.cdf.ca.gov/projects/hardwood_expert/building_state/overview2.htm) would be more interesting.
Now … I am not sure if it would be a fun mod to play ;)

edit: found a better state and transition model example

Heh. When I saw the title of this thread, the First thing that came to mind was to check and see if there were meteor impacts in it, and suggest them if there weren't.

I would suggest making the impact work kind of like a nuclear warhead, (anything on the tile hit, or adjacent to is just outright destroyed), but instead of fallout on the nearby tiles, make a terrain "improvement" of dustclouds, or "impact winter" that destroys any nonroad improvements already on the terrain, and decreases food and gold output by one. If possible, I'd expect the dustcloud to extend for about a 20 or 25 tile radius.

The hard part, though, I'd expect, is making the dustclouds automatically go away after 100-200 years or so. (I'm a bit fuzzy on how long the dark ages lasted, but there is evidence to suggest that they were caused by a meteor impact)

Therapist
Nov 24, 2005, 03:11 PM
The hard part, though, I'd expect, is making the dustclouds automatically go away after 100-200 years or so. (I'm a bit fuzzy on how long the dark ages lasted, but there is evidence to suggest that they were caused by a meteor impact)[/QUOTE]


I hope you're kidding about the dark ages being caused by a meteor impact. Either that or I am very scared for the future. The "dark ages" are not called so due to lack of light.....it is called so due to lack of technological advance along with other cultural "backwardness" during a time of isolation and fear in Europe.

TheFourGuardian
Nov 24, 2005, 04:56 PM
I have litterally no info on that dark age idea, but I assume he means that famines were started due to the light of the sun being dulled by a meteor impact which led to riots and thus led to a lack of progression, as well as the fact that the starved peoples were decimated by plauges.

deleted_scenes
Nov 24, 2005, 05:33 PM
That sounds pretty cool. Modders wouldn't dream of accomplishing something like this in Civ III. Really makes me excited about what Civ IV mods we will see in the future.

Therapist
Nov 24, 2005, 05:47 PM
I thought he was referring to the real "dark ages" that took place in Europe. A meteor strike had nothing to do with the famine and plague that occured during this time period. Am I not understanding him correctly or is there some crazy history book somewhere that says the dark ages occured due to a meteor strike? This is an absolutely ridiculous.

"The poet Petrarch coins the pejorative term Dark Ages to describe the preceding 900 years in Europe, beginning with the fall of the western Roman Empire in 410 through to the renewal embodied in the Renaissance. "

http://en.wikipedia.org/wiki/Dark_Ages

upthorn
Nov 25, 2005, 01:01 AM
I thought he was referring to the real "dark ages" that took place in Europe. A meteor strike had nothing to do with the famine and plague that occured during this time period. Am I not understanding him correctly or is there some crazy history book somewhere that says the dark ages occured due to a meteor strike? This is an absolutely ridiculous.

"The poet Petrarch coins the pejorative term Dark Ages to describe the preceding 900 years in Europe, beginning with the fall of the western Roman Empire in 410 through to the renewal embodied in the Renaissance. "

http://en.wikipedia.org/wiki/Dark_Ages

I was. I remember hearing about it on a Discovery Channel documentary about Meteor impacts. There is a crater in central Europe that dates to just before the Dark Ages. There are European AND Chinese documents from the time that make reference to a star falling, and great clouds obscuring the sun, and it is also linked in Arthurian legend to King Arthur's death in the late 5th century.

I don't claim that they were called the Dark Ages because of the lack of light. However, one could postulate that the dark ages were called thus because of the lack of light, and "dark" took on it's pejorative meaning after the fact, because of the general state of civilization during the dark ages (I simply prefer not to dismiss the idea entirely).

However, part of the reason that the dark ages were so barbaric, and so little progress was made towards regaining the lost culture and technology from the fall of Rome, is because most of Europe believed the end of the world was upon them, so they had little reason to struggle to regain what was lost.

However, I do not recall how long these clouds were supposed to have lasted, and the idea that they lasted from the late 400s all the way through to 1000 seems kind of preposterous.

Rufus T. Firefly
Nov 25, 2005, 01:14 AM
I was. I remember hearing about it on a Discovery Channel documentary about Meteor impacts. There is a crater in central Europe that dates to just before the Dark Ages. There are European AND Chinese documents from the time that make reference to a star falling, and great clouds obscuring the sun, and it is also linked in Arthurian legend to King Arthur's death in the late 5th century.

I don't claim that they were called the Dark Ages because of the lack of light. However, one could postulate that the dark ages were called thus because of the lack of light, and "dark" took on it's pejorative meaning after the fact, because of the general state of civilization during the dark ages (I simply prefer not to dismiss the idea entirely).

However, part of the reason that the dark ages were so barbaric, and so little progress was made towards regaining the lost culture and technology from the fall of Rome, is because most of Europe believed the end of the world was upon them, so they had little reason to struggle to regain what was lost.

However, I do not recall how long these clouds were supposed to have lasted, and the idea that they lasted from the late 400s all the way through to 1000 seems kind of preposterous.

Actually the terms "Dark ages" and "Middle ages" were created on Italian Reinessance . And, as said by Rapist, they refers to the darkness of culture between Romans and Italians of 1400 or the "middle age" between the two golden ages of Rome and Florence (and other reneissance powers).

DireAussie
Nov 25, 2005, 04:17 AM
Hi all, if you're wondering where the next release is...well I work shift work, 2 early shifts (6am to 6pm), 2 late shifts (6pm to 6am) then I have 4 days off, I only just started testing the new earthquakes on the end of my last day off. Also there's a bug with the olympics eras changing before they should.

On my last 4 days off I pretty much spent my whole time working on the mod. A lot of the time was spent re-writing the code after I learned how to do stuff better rather than putting in new features.


I would suggest making the impact work kind of like a nuclear warhead, (anything on the tile hit, or adjacent to is just outright destroyed), but instead of fallout on the nearby tiles, make a terrain "improvement" of dustclouds, or "impact winter" that destroys any nonroad improvements already on the terrain, and decreases food and gold output by one. If possible, I'd expect the dustcloud to extend for about a 20 or 25 tile radius.

If I put in something like this then nobody would want to play it. Imagine how you would feel if a meteorite hit the middle of your empire, having -1 food and gold in a 25 tile radius for 200 turns. Something with such major consequences sort of belongs in its own "world devastation" mod (which sounds pretty cool actually :) )

The hard part, though, I'd expect, is making the dustclouds automatically go away after 100-200 years or so.

That's easy to do in python code. The hard part would be doing the graphics because all the bonus tile graphics are done in 3d and at the moment there's no way to create your own 3d models for the game.

Argh
Nov 25, 2005, 06:27 AM
Hi there, congrats on a great mod idea, and thanks for past, current and future hard work on it.

Now, with regard to putting in events that nobody would want...Is there any way at all that some sort of random events configuration file, like an .ini or something can be included where the mod user can simply turn each random event on or off at will?

Love the mod, but don't want that massive devastating earthquake? Turn it off in the mod options. Or, even have the world devastation events defaulted to off, but included with the mod download...?

I have no clue about modding in general, let alone Civ specifically, so I don't know if that's possible at all?

Oh, and what about a nice topical bird flu event? :drool:

Rufus T. Firefly
Nov 25, 2005, 06:55 AM
Hi there, congrats on a great mod idea, and thanks for past, current and future hard work on it.

Now, with regard to putting in events that nobody would want...Is there any way at all that some sort of random events configuration file, like an .ini or something can be included where the mod user can simply turn each random event on or off at will?

Love the mod, but don't want that massive devastating earthquake? Turn it off in the mod options. Or, even have the world devastation events defaulted to off, but included with the mod download...?

I have no clue about modding in general, let alone Civ specifically, so I don't know if that's possible at all?

Oh, and what about a nice topical bird flu event? :drool:

Personally, I think that bird flu could be a realistic event (starts with biology?), but meteor impact is VERY irrealistic.

Argh
Nov 25, 2005, 07:20 AM
but meteor impact is VERY irrealistic

True, so make it VERY VERY unlikely :) Or, better, (if possible) go down the random events options route I mentioned.

Personalise your own selection of civ-destroying natural disasters. "And would sir like a volcanic eruption with his coffee? No? Might I recommend the 50 foot tidal wave instead then?"

Edit: Meteor impact could have like ONE chance of happening for the WHOLE game, and even that be low. Imagine the stories the few "lucky" people who experienced it could tell. "So, there I was, about to take my elephants round the mountains to FINALLY smash those bleedin' Romans, when, stone me, a bloody great meterorite beat me to it. Phooom, all of the Roman Empire gone. Just like that".

Therapist
Nov 25, 2005, 03:26 PM
It's funny, this topic came up, I am actually watching something regarding asteroid strikes on the earth. According to the History Channel, the asteroid that supposedly wiped out the dinosaurs, the resultant cloud was thought to have lasted months(100s of years as you have asked seems excessive), not years resulting in a massive plant extinction, etc. I have never heard the theory regarding a meteor strike in central Europe, do you have any sources I can read? As far as I know and is generally accepted is the dark ages were the times when the Roman Empire fell up to the renaissance and restoration of European culture. It was thought that "proper" civilization had come to an end. Along with lack of research, plagues and famines it was generally a "dark" time for Europeans. Am I crazy here or can someone back me up on this?

upthorn
Nov 25, 2005, 10:36 PM
Hi all, if you're wondering where the next release is...well I work shift work, 2 early shifts (6am to 6pm), 2 late shifts (6pm to 6am) then I have 4 days off, I only just started testing the new earthquakes on the end of my last day off. Also there's a bug with the olympics eras changing before they should.

On my last 4 days off I pretty much spent my whole time working on the mod. A lot of the time was spent re-writing the code after I learned how to do stuff better rather than putting in new features.


If I put in something like this then nobody would want to play it. Imagine how you would feel if a meteorite hit the middle of your empire, having -1 food and gold in a 25 tile radius for 200 turns. Something with such major consequences sort of belongs in its own "world devastation" mod (which sounds pretty cool actually :) )


That's easy to do in python code. The hard part would be doing the graphics because all the bonus tile graphics are done in 3d and at the moment there's no way to create your own 3d models for the game.

Well, in light of some of the things people more knowledgable than I have said, it would realistically be more like one or two turn, which would be much less annoying. Personally, I was only really thinking that it should last long enough to cause one bout of starvation in the affected area. (That number was a gross misestimate)

Part of the point of the 20-30 tile radius, though, is so that there's more than one nation affected. Maybe instead of -1 gold, though, it should be -1 happiness and/or -1 health. As for the graphics, I was thinking you could use the graphics for fallout, but give it a different name.


In reply to
Personally, I think that ... meteor impact is VERY irrealistic.
I need only link http://www.unb.ca/passc/ImpactDatabase/CINameSort.html

Current total number of confirmed impact structures: 172

Shamier
Nov 26, 2005, 03:29 AM
I have litterally no info on that dark age idea, but I assume he means that famines were started due to the light of the sun being dulled by a meteor impact which led to riots and thus led to a lack of progression, as well as the fact that the starved peoples were decimated by plauges.

There seems to be a theory as well that the bigger volcanoes around the world erupted and the resulting ash/whatnot particles got to the atmosphere thus blocking the sunlight for a longer period of time (don't know about years but long enough anyway) and that's why in the "dark ages" they might have had less food and thus people might have had more diseases.
(Atleast it was in one of those disaster documentaries...).

Maybe that would be a nice implementation as well to this "random events mod" or then the "World devastation mod" ;)
Seeing as volcano eruptions are quite common and according to some, the biggest ones can be quite nasty so there could be a effect "greater volcano eruption" which would decrease food income in larger area around it and a random farm destroying effect to show the effect lack of sunlight has on the farming... (or something like that).

Rufus T. Firefly
Nov 26, 2005, 04:43 AM
In reply to

I need only link http://www.unb.ca/passc/ImpactDatabase/CINameSort.html

Uhm, how are the impacts in the last 3000 years? It seems that in the human hystory we had more earthquake than meteor impact, no?

Then, if the probability of impacts tends to 0, we can said that it could be 0 in a realistic scenario. Ergo, no to the impacts.

lobosan
Nov 26, 2005, 01:10 PM
Yes, a separate "World devastation mod" thread would be more appropriate but I hope that DireAussie doesn't mind this discussion.

Catastrophic, world altering events such as massive meteorite impacts ("Deep Impact" Hollywood extravaganza or from the mass extinction theories), massive volcanic eruptions (Krakatoa eruption in the 1800's), spectacular climatic inversions ("Day After Tomorrow" more Hollywood), small/short climatic variations ("Little Ice Age" - Western Europe from ca.1150 to 1460), and plain old seasonal changes would all have one thing in common - they change the Civ4 terrain during game play!.

There can be 2 general types of terrain changes. For example:

* Terrain Features Changes:
- Oasis and Floodplains appear and disappear
- no Terrain Feature <-> Jungle <-> Forest <-> no Terrain Feature
- Ice (impassable) can cover any Base Terrain
- Hills can appear or disappear on all land Base Terrains except Peaks

* Base Terrain Changes:
- any land Base Terrain <-> Coast <-> Ocean
- Desert <-> Grassland <-> Plains <-> Tundra <-> Snow
- Peaks (impassable) can replace any Base Terrain

Ideally, the mod would not change any Terrain stats but just flip through appropriate Terrain Feature and Base Terrain permutation.

upthorn
Nov 27, 2005, 01:31 AM
Uhm, how are the impacts in the last 3000 years? It seems that in the human hystory we had more earthquake than meteor impact, no?

Then, if the probability of impacts tends to 0, we can said that it could be 0 in a realistic scenario. Ergo, no to the impacts.

In the last 3000 years there have been at least seven, and maybe as many as nine meteor impacts. (two of them happened between 2000 and 6000 years ago)

A game of Civ4 spans 6050 years. So, if it were to be totally realistic, there would be from 12 to nearly 20 meteor impacts during a game. However, only about 1 in 8 is major (causing dust clouds and the like). So, they should be in with a probability of about 1 every 2750 years.

yotaku
Nov 27, 2005, 01:49 AM
I made a few changes to your mod, and added another event - volcanos.

I figured I would post it here for all to enjoy. And incase you want to steal parts of it for your next version.

Changes:
Olympics are more likely to be held in larger, more cultual cities.
Randomly, mountains will become active volcanos
Randomly, active volcanos will errupt killing population in nearby cities, and destroying all nearby improvements.

Rufus T. Firefly
Nov 27, 2005, 04:41 AM
In the last 3000 years there have been at least seven, and maybe as many as nine meteor impacts. (two of them happened between 2000 and 6000 years ago)

A game of Civ4 spans 6050 years. So, if it were to be totally realistic, there would be from 12 to nearly 20 meteor impacts during a game. However, only about 1 in 8 is major (causing dust clouds and the like). So, they should be in with a probability of about 1 every 2750 years.

This is what I mean: the catastophic impact is really improbable in an historic scenario.

palme
Nov 27, 2005, 06:49 AM
I made a few changes to your mod, and added another event - volcanos.

I figured I would post it here for all to enjoy. And incase you want to steal parts of it for your next version.

Changes:
Olympics are more likely to be held in larger, more cultual cities.
Randomly, mountains will become active volcanos
Randomly, active volcanos will errupt killing population in nearby cities, and destroying all nearby improvements.

Nice, I will test it as soon as I can. A mistake I've already found: The volcano-picture is just the locoust-picture with another name?

davymark8
Nov 27, 2005, 11:38 AM
in response to firefly, improbable doesnt mean impossible, so maybe if there was an option at the begining of the game you could choose:
1. no random events
2. realistic frequency (i.e. very rare)
3. more than realistic frequency (i.e. rare but more frequent than realistic)
4. apocalyptic frequency (common frequency)

and maybe more frequencies in between, that way people could choose what type of game they want to play, sort of like picking options in custom game.

Rufus T. Firefly
Nov 27, 2005, 02:09 PM
in response to firefly, improbable doesnt mean impossible

I know, this is why there is always a winner on lotteries. ;)

What I mean is that because it is a very rare event, it is useful than having a reanimation room in my house.

yotaku
Nov 27, 2005, 03:09 PM
Nice, I will test it as soon as I can. A mistake I've already found: The volcano-picture is just the locoust-picture with another name?

Actually that picture isn't used. I was using that while I was developing. But thanks for pointing that out, I'll remove the picture so that future versions are smaller.

DeathCyclops
Nov 27, 2005, 08:29 PM
yotaku, could you post a screenshot of what the volcanoes look like?(erupting or not...or both, doesnt matter) Good job btw:goodjob:

upthorn
Nov 27, 2005, 10:33 PM
This is what I mean: the catastophic impact is really improbable in an historic scenario.

Actually, given one every 2750 years, the probability curve has 2 to 3 major impacts per CIV game, (assuming it lasts until score victory).

DireAussie
Nov 27, 2005, 10:43 PM
I just posted version 1.1

Earthquakes are now in, and a mini-restructure to the code by putting my revised screen code back in and getting rid of the inflexible popups.

I made a few changes to your mod, and added another event - volcanos.

Thanks, will take a look now!

DireAussie
Nov 27, 2005, 11:24 PM
I took a look at the volcanos mod - nice work!

There are a few bugs I noticed - existing mountains can be overwritten. Also the other one you probably know about is that mountain names aren't maintained between saved games. Another thing is that the volcano mod isnt compatible with old save games - something I have accounted for in the version 1.1 code.

I'll fix up the bugs and put the volcanos into version 1.2.

Also another thing I noticed is that the random number seed for the randint function must be written to the save game itself and reused during reloads, because the mountains retain their names if you save the game, load and then reload again.

yotaku
Nov 28, 2005, 12:38 PM
I took a look at the volcanos mod - nice work!

There are a few bugs I noticed - existing mountains can be overwritten. Also the other one you probably know about is that mountain names aren't maintained between saved games. Another thing is that the volcano mod isnt compatible with old save games - something I have accounted for in the version 1.1 code.

I'll fix up the bugs and put the volcanos into version 1.2.

Also another thing I noticed is that the random number seed for the randint function must be written to the save game itself and reused during reloads, because the mountains retain their names if you save the game, load and then reload again.

Why do you think the random number seed needs to be saved? The volcano locations are stored by adding a resource to that location in the map. And the mountain names are stored as landmarks, which get saved when you save the game anyway. The only thing saving the random seed would do is make it so that if you save the game, and then a volcano blows, you could reload and know that the same volcano was going to blow at the same time. Which I suppose might be desirable. But I'm not sure.

I will look at your new version, as it sounds like you have learnt some new things.

Currently I'm looking at making a civil war event. Right now, I'm looking at using relative population size, happiness, and religious seperation as some factors in desiding if a civilization is at risk of a civil war. Any other ideas would be appreciated.

DeathCyclops
Nov 28, 2005, 01:16 PM
how about putting in floods,forest fires, and/or whirlpools (for disasters) and maybe parades(something like +2 happiness) traffic on roads(reduces movement on roads until cleared) and ummmmmm....:confused: (cant think of anymore right now)

Zuul
Nov 28, 2005, 03:02 PM
Maybe a small chance for a goody hut to appear. Small chance for ships to sink, be lost in storms, or just taking some damage. Good crop/bad crop - extra minerals/metals found, or so for a few turns on a tile. Chance for an barbarian unit to convert to your civilization. Chance for units far away becoming baqrbarians. Small chance for roads to dissapeare (break apart). Forrest fire, spreading and destroying forrests.

DireAussie
Nov 28, 2005, 09:42 PM
Why do you think the random number seed needs to be saved?

My bad. I read the code wrong. Disregard everything I said :) I like the way you use the setBonusType function to store the volcano in the game.

Currently I'm looking at making a civil war event. Right now, I'm looking at using relative population size, happiness, and religious seperation as some factors in desiding if a civilization is at risk of a civil war. Any other ideas would be appreciated.

Not sure how elaborate you are looking to make the event, but if you just want to make a city go into civil disorder (like when you take over a city) there is this function in CyCity:

city.setOccupationTimer(2)

Kuratko
Nov 29, 2005, 12:35 AM
Is there any way how to find out where the earthquake took place? I have had many of them in my last game but never noticed any damage.... Is it reported to the player everytime or only when it occurs at his territory?

Very nice mod, looking forward for future developments...

mamimo
Nov 29, 2005, 02:44 AM
How do I use this mod with other mods, like lost unit/wonder?

DireAussie
Nov 29, 2005, 02:53 AM
Is there any way how to find out where the earthquake took place? I have had many of them in my last game but never noticed any damage.... Is it reported to the player everytime or only when it occurs at his territory?

The camera should be centering on the earthquake, and it also flashes the mini-map. All damage is reported to the quick messages on the top left of the screen. At this stage the player will get all information about an earthquake regardless of whether it is in their territory or not.

Small earthquakes generally do no damage while large earthquakes do massive damage.

How do I use this mod with other mods, like lost unit/wonder?

You'd have to manually combine them. Easy if they change different files. More difficult if they dont.

Zuul
Nov 29, 2005, 06:17 AM
Maybe earthquakes should reduce movement points on units near? Hard to walk when the ground is shaking :p.

Snaitf
Nov 29, 2005, 08:06 AM
This one just keeps getting better and better, keep up the good work!

DeathCyclops
Nov 29, 2005, 08:54 PM
for some reason it doesnt work anymore... it worked when I first DL it and then I combined it with Monuements mod and it still worked... but no random events. Then I tried taking out that folder and reinstalling the basic random events mod(v1.2) a when I tried to load it, the game failed to load all xml files and event manager...what's going on?!?!?!:mad: :confused: :eek:

DireAussie
Nov 29, 2005, 09:50 PM
I'm not sure what's going on. It might be the cache. I had the same problem during testing. Try this:

As soon as you double click the icon to start the game, hold down shift key until the popup disappears and the flash screen appears.

If that doesnt work, try renaming the random events folder to something else eg random eventsv1_2, then activate it when you get in game.

hIdDeN_eViL
Nov 30, 2005, 06:53 AM
Sounds like a heaps good mod. but haven't had time to try it yet. so a few questions.

firstly what does the olympics do? and shouldnt the start be triggered by something, like a great wonder, or 5 coloseums or something, rather than having it begin with the game?

and how do i turn off certain things, or tweak at the probabilities/frequencies?

and i think that a 1/400 chance of meteor would be good, with the meteor being a small one, and acts like a randomly landing ICBM.

and a cyclone would be good. it would be like a mix of locus and small earthquake (it moves and effects only the square its immediately over.)
the length of it path should be determined by the size of the map. but say on a small map it moves 6 squares before dissapating, then it should start 3 squares off shore, and then move inland. or somethin like that.


anyway, great mod, i'll try it the moment i can.

DeathCyclops
Nov 30, 2005, 01:14 PM
about how many volcanoes are there at the start of the game?

JamieCiv4Files
Nov 30, 2005, 01:22 PM
I've mirrored this http://civilization4.filefront.com/ at for you DireAussie :)

yotaku
Nov 30, 2005, 02:09 PM
about how many volcanoes are there at the start of the game?

There is a constant in the \Mods\Random Events\Assets\python\RandomEventsConstants file which controls the approx density of volcanos.

Basically the mod, uses that density to determine how many volcanos it should try to add. The default is 1 per 100 squares in the game. Though there may not be that many in the game. The mod then tries up to 100 random squares to find a mountain to add the volcano to. If it doesn't find a mountain in 100 tries, then it just skips that volcano creation, and tries to create the next volcano.

There is also a chance that non-volcano mountains may become a volcano mid-game. That is also controlled by constants in the constants file.

yotaku
Nov 30, 2005, 02:12 PM
The camera should be centering on the earthquake, and it also flashes the mini-map. All damage is reported to the quick messages on the top left of the screen. At this stage the player will get all information about an earthquake regardless of whether it is in their territory or not.


You might want to look at what I did for the volcanos. I made it so that it only tells you about it, if the player can see it.

Basically use: plot.isVisibleToWatchingHuman()

I'm not sure that that would work for multiplayer, but since you disabled that for the mod already, this will work for now.

DireAussie
Nov 30, 2005, 02:34 PM
You might want to look at what I did for the volcanos. I made it so that it only tells you about it, if the player can see it.

Basically use: plot.isVisibleToWatchingHuman()

Yeah, I used that for the new droughts and fertility. I might change it so it does it for earthquakes too.

Basically the mod, uses that density to determine how many volcanos it should try to add. The default is 1 per 100 squares in the game. Though there may not be that many in the game. The mod then tries up to 100 random squares to find a mountain to add the volcano to. If it doesn't find a mountain in 100 tries, then it just skips that volcano creation, and tries to create the next volcano.


When I put your code into my mod I made a few changes to the way this works. Now instead of searching randomly for squares, it builds a list of plots that have peaks. Then it picks out from this list at random when creating volcanos. I also put in code so that it doesnt overwrite an existing volcano.

IIRC, Number of volcanos at the start = random number between 0 and (square root of (length of map * height of map) / 20) + 1

on a duel you'll get 1-2 volcanoes, on a standard map 1-5, huge map probably 1-8 or something like that. Volcanos can be created while playing too.

firstly what does the olympics do?

increase total culture by 10%
adds current amount of trade to your total gold reserves
increases population by 1

and how do i turn off certain things, or tweak at the probabilities/frequencies?

All in the the RandomEventsConstants.py file.

DeathCyclops
Nov 30, 2005, 02:40 PM
Am I able to see volcanoes in World Builder?(the ones created at start of game.... because I play large maps and I dont see any volcanoes...)

yotaku
Nov 30, 2005, 02:50 PM
Am I able to see volcanoes in World Builder?(the ones created at start of game.... because I play large maps and I dont see any volcanoes...)

Assuming that that hasn't changed since DireAussie's modifications of my code. Then yes, volcanos should show up with a name over their peak in the world builder.

DeathCyclops
Nov 30, 2005, 06:17 PM
I reinstalled my game and played it on my dad's profile(logged on as him) and now it works, yay!:D

Neroir2
Dec 01, 2005, 12:31 AM
DireAussie, maybe you should include all the texts of the mod in a single file for an easy translation to other languages.

Shamier
Dec 01, 2005, 01:37 AM
I just wanted to thank you for the great mod.
It definitely adds some change to my games, and now that there are only a few volcanoes they're a good addition (not to mention that the names actually add some character to them.).

Only thing I would like to change in this is that I would like to have volcanoes of different strength (a random amount of bigger volcanoes that affect a larger area).

Can't wait for any other events you might add... Keep up the good work! :goodjob:

hIdDeN_eViL
Dec 01, 2005, 05:59 AM
any chance of some civpedia entries?
that would really complete this mod.

Rufus T. Firefly
Dec 01, 2005, 07:17 AM
any chance of some civpedia entries?
that would really complete this mod.

Clearly, what we need. And I candidate me for Italian translation.

robbiet69
Dec 01, 2005, 11:10 AM
I have come accross a problem with the olympics mod. While playing direct IP games, not always, but most of the time, the games will be held in different cities resulting in an out of sync error. At which time we are playing two seperate games. Any ideas? Any way to re-sync?

DireAussie
Dec 02, 2005, 02:33 AM
I have come accross a problem with the olympics mod. While playing direct IP games, not always, but most of the time, the games will be held in different cities resulting in an out of sync error. At which time we are playing two seperate games. Any ideas? Any way to re-sync?

The mod was not designed for multiplayer. I would have no idea even where to start for that.

Rufus T. Firefly
Dec 02, 2005, 02:40 AM
Instead, I had noted a new bug: on modern era, the modern games counter restart.

DireAussie
Dec 02, 2005, 02:50 AM
Instead, I had noted a new bug: on modern era, the modern games counter restart.

That's actually intentional :) In real life the first modern olympics in Athens started with a one, so I decided to make the counter in-game reset when it goes into modern olympics.

Rufus T. Firefly
Dec 02, 2005, 02:54 AM
That's actually intentional :) In real life the first modern olympics in Athens started with a one, so I decided to make the counter in-game reset when it goes into modern olympics.

You have misunderstood. I know that the counter restarts on industial era, when the railroad tech is discovered. But or it continues to restart or it restarts when we go to modern era.

DireAussie
Dec 02, 2005, 02:19 PM
You have misunderstood. I know that the counter restarts on industial era, when the railroad tech is discovered. But or it continues to restart or it restarts when we go to modern era.

Ah yes, I understand now - I know what the problem is. I'll fix it.

Thanks :)

higgins534
Dec 03, 2005, 12:39 AM
Is it possible to have a random event trigger another random event? Like El Nino or La Nina occuring which would cause droughts and bushfires in the Southern Hemisphere (Or Northern for La Nina) of the map and flooding and severe storms (cyclones) in the Northern Hemisphere (Or Souhtern for Lan Nina) (of course the locations that are affected, like drought in Australia and flooding in the US and Peru, can't really be implemented as not every map would have these continents/countries so it would probably just have to be implemented as Northern/Southern Hemisphere or some other way...I am sure you could work some way out?). Could this work? There could be other events that could trigger other random events as well...like the Olympics could increase the chances of a disease epidemic...

Rufus T. Firefly
Dec 03, 2005, 02:51 AM
Is it possible to have a random event trigger another random event? Like El Nino or La Nina occuring which would cause droughts and bushfires in the Southern Hemisphere (Or Northern for La Nina) of the map and flooding and severe storms (cyclones) in the Northern Hemisphere (Or Souhtern for Lan Nina) (of course the locations that are affected, like drought in Australia and flooding in the US and Peru, can't really be implemented as not every map would have these continents/countries so it would probably just have to be implemented as Northern/Southern Hemisphere or some other way...I am sure you could work some way out?). Could this work? There could be other events that could trigger other random events as well...like the Olympics could increase the chances of a disease epidemic...

I think that this would be a bit tooo complicated to implement.

ostar
Dec 03, 2005, 08:17 AM
Since ocean is the largest terrain group, why not add hurricanes/typhoons? They could harm naval units and/or destroy water tile improvements.

ChaoticWanderer
Dec 05, 2005, 06:56 AM
a few ideas on random events

wild fires. burn a land tile if any improvment is in it its destroyed

great plague. kills os many in each city connected in any sort of trade route * roads or shipping*

flood. along rivers if on city tiles kills people and destorys wonders if improvemnt tile destryes improvment

Discovery. a discovery of a new resource * ie discoery of gold or iron or something*

hurricane: coast square: if near city liofe damage city damage and imporvement damage. maybe have different stregnth oens like earthquakes

tornados: plains and grasslands destroy all it touches if hits city life damage and porperty damage

shocking science breaththorugh. a scientist in yours or tohers land makes surprise sudden breaththrough get random science advance

winter olympics: works like olympics but msut be enar tundra or mountain land scapes to host games

jsut some quick thoughts

ghen
Dec 05, 2005, 07:40 AM
Hmm, adding great plagues and pandemics could be a mod in its own right. Set a tech or city improvement/size that could randomly start the plague and then have a later tech / improvement stop the plague worldwide.. You would then get diplomacy points for stopping the plague with your friends, though enemies would choose to lie and tell their population -they- stopped it. ;)

Black death could be started in any city over size 10 without an aqueduct..
Malaria could be started in any city with 3 or more jungle tiles with a trade connection..
AIDS could be started in any city after scientific method is researched and only contained by genetics.

ChaoticWanderer
Dec 05, 2005, 09:49 PM
and influenza to replace black plague as a reoccuring disease

haveblack plague only be able to happen once but after that influenza can effect cities

therubberduck
Dec 09, 2005, 12:38 PM
Looks good, I'll try it out. But the thought that hit me when I saw volcanoes, is that it might also have some benefits. Maybe every square next to it gets +1 food. After all, the reason people settle next to volcanoes is often because of the fertile soil. It would also present the player with a dilemma. Risk the citizens or leave all that nice extra food useless?

DickieBear
Dec 10, 2005, 11:50 PM
I haven't tried the mod, but I love the fact that you put a FAQ in the first post. I wish all modders would do this. I like to read the entire thread to see peoples ideas and the process of development, but half of every thread I see is people repeating questions that have been asked five times already because they didn't feel like reading a few of the posts.

Shamier
Dec 11, 2005, 12:47 AM
Looks good, I'll try it out. But the thought that hit me when I saw volcanoes, is that it might also have some benefits. Maybe every square next to it gets +1 food. After all, the reason people settle next to volcanoes is often because of the fertile soil. It would also present the player with a dilemma. Risk the citizens or leave all that nice extra food useless?

Maybe even terrain changes depending on the existing terrain? If terrain is fertile and the volcano erupts, the terrain around it becomes less fertile for a certain period of time and then (if the volcano hasn't erupted during that time) Make the terrain better again? ;)

hanskamp
Dec 11, 2005, 09:41 AM
- Olympic Games. This will happen every 35 turns during the ancient era and every 15 turns after any civ researches Railroad. For a city to be eligible to host the games it must be size 10 or greater and have a colosseum

What are the effects for the city if Olympic Games is hosted there?

BTW, I love testing various mods that are presented in this part of the forum. :)

LittleRedPoint
Dec 12, 2005, 10:46 AM
Hi, i have little request... :king:

Could you add plague into random events?

The algorithm should work like this:

Plague event
in the beginning of every (or after two or after n) turn check all cities
if the health in city is less than zero
if true then count unhealthy
divide the sum of unhealthy with 10 (this means that if city has unhealthy -1 it has 10% chance to have plague every turn, if it has health -2, then it has 20% chance to have plague every turn or if it is to grazy then divide it with 20 or so)

if thare is a plague then kill 1 pop or more. It may be also random but one less than minimum population in this city (it is really grazy then :crazyeye: )

You have "know-how" to do this... could you make this? You can handle random events in cities and know how to kill population :D

I made Pop-Up image for the plaque evend, it is in plague.zip and has right coding (64b) and size(256x256) like all your previous pictures. So if you have interest and have time to do plague event then use this image :) (of course if you like it ;))

I look your previous work and it is awsome :goodjob:
Very nice work!

the100thballoon
Dec 18, 2005, 08:37 PM
I wanted so much to do this in CivIII! Thank you!

Jaybe
Dec 23, 2005, 11:41 AM
Awaiting an update (or certification) for cIV 1.52.
I really appreciate the variability (i.e., random events) :) of this mod, though sometimes I wish they happened more often. Then again, I am talking Huge Epic games.

Cyberstar
Dec 26, 2005, 07:01 AM
Hi DireAussie,
I'm excited to give it a try.

One problem I noticed right away was the graphics in the map globe view on the bottom right window. In default high res I get blue streaks distorting the map view. It works fine in medium res. I'm using patch 1.52. I can use all high res graphics in the standard game with no problems.

the100thballoon
Dec 26, 2005, 01:09 PM
would you post a tutorial of how to make these events? i have many many more events Id like to add, including: (some you have already done)

Terrorist attacks
Hurricanes
Plagues/Disease Epidemics
Tornados
Tsunamis
Earthquakes
Floods
Volcanoes
Landslides
Avalanches
Droughts
Wildfires
Friendly Fire (ex. pilot crashes into area near landing site on accident)
Railroad Accidents
Alien aggresion
Olympics
World competitions (ex. World Cup, Ms. Universe, etc)
Crime
Work ethic boost (units in tile gain an HP boost and workers in tile work twice as fast. lasts ~2 turns)


Please consider adding some of these or please show me how to do it myself.

DireAussie
Dec 26, 2005, 04:18 PM
Thanks for the feedback, I havent done any work on the mod since because I've been too busy playing civ 4 and testing it for myself :) Also, I have another unrelated project I'm working on that I need to give priority over this mod.

Could you add plague into random events?

Its on my to do list :) The algorithm you presented is similar to how I was going to implement it, but its going to be a bit more extensive than just a random chance in one city. Think world epidemics :)

One problem I noticed right away was the graphics in the map globe view on the bottom right window

Since my mod doesnt do anything to the map globe view I doubt it is my mod that is causing the problem (I havent played a game with it yet though).

would you post a tutorial of how to make these events? i have many many more events Id like to add, including: (some you have already done)

I think the best way to learn is to read the code I've written, and also take a look at the mods provided by Firaxis eg desert war. You'll need to know how to program otherwise you wont know what you're doing. I'll describe the basic steps for adding a new random event.

My code is quite modular. This means you can go away and write your own event and then post it here and I can put it in with relative ease (if you dont totally mess up the structure :) ).

As an example, say you want to make a flood. Here are the steps:

- Create a file called RandomEventFlood.py and write all the code that does the flood in there. A good idea is to copy one of the other files there and then change the code around a bit.

- If your flood needs a popup screen, open the RandomEventsScreen.py file and write the screen handler code there. You should only add 2 functions:

setEarthquakeScreenVars - allows you to pass variables from RandomEventFlood.py so they can be shown in the popup text

showEarthquakeScreen - code to show the screen

You'll also need to add an entry to the updateScreen() function. Have a look at the other events as an example.

You will also need to create some class variables in the init function at the top of the RandomEventsScreen.py file, and should clearly mark what the flood variables are so that its easy for me to change.

- If your flood needs IO (input/output, so you can save stuff between save/loads) then you'll need to open the RandomEventsIO class and add the needed functions in there. You'll need a "set" and "get" function and the data will need to be a basic data type like int or string or whatever. Take a look at the file and use what I've already done there as a start.

- open the RandomEvents.py file. Here you'll need to put in your class constructor call for your flood and change the event handler code so that the flood will occur. Have a read of the file to see how I've done it for other events - its relatively easy to follow.

- add any constants that will be used by your flood to RandomEventsConstants.py

mtabacco
Dec 26, 2005, 08:12 PM
How could i apply your mod to a earth map?

the100thballoon
Jan 04, 2006, 07:40 PM
Thanks for the feedback, I havent done any work on the mod since because I've been too busy playing civ 4 and testing it for myself :) Also, I have another unrelated project I'm working on that I need to give priority over this mod.



Its on my to do list :) The algorithm you presented is similar to how I was going to implement it, but its going to be a bit more extensive than just a random chance in one city. Think world epidemics :)



Since my mod doesnt do anything to the map globe view I doubt it is my mod that is causing the problem (I havent played a game with it yet though).



I think the best way to learn is to read the code I've written, and also take a look at the mods provided by Firaxis eg desert war. You'll need to know how to program otherwise you wont know what you're doing. I'll describe the basic steps for adding a new random event.

My code is quite modular. This means you can go away and write your own event and then post it here and I can put it in with relative ease (if you dont totally mess up the structure :) ).

As an example, say you want to make a flood. Here are the steps:

- Create a file called RandomEventFlood.py and write all the code that does the flood in there. A good idea is to copy one of the other files there and then change the code around a bit.

- If your flood needs a popup screen, open the RandomEventsScreen.py file and write the screen handler code there. You should only add 2 functions:

setEarthquakeScreenVars - allows you to pass variables from RandomEventFlood.py so they can be shown in the popup text

showEarthquakeScreen - code to show the screen

You'll also need to add an entry to the updateScreen() function. Have a look at the other events as an example.

You will also need to create some class variables in the init function at the top of the RandomEventsScreen.py file, and should clearly mark what the flood variables are so that its easy for me to change.

- If your flood needs IO (input/output, so you can save stuff between save/loads) then you'll need to open the RandomEventsIO class and add the needed functions in there. You'll need a "set" and "get" function and the data will need to be a basic data type like int or string or whatever. Take a look at the file and use what I've already done there as a start.

- open the RandomEvents.py file. Here you'll need to put in your class constructor call for your flood and change the event handler code so that the flood will occur. Have a read of the file to see how I've done it for other events - its relatively easy to follow.

- add any constants that will be used by your flood to RandomEventsConstants.py
im not a coder. :( is there no chance you'll put these into the mod?

hIdDeN_eViL
Jan 23, 2006, 03:15 AM
has anyone tested the new release?
any known issues?

SirBruce
Feb 01, 2006, 12:19 PM
Okay, I've just run into a big issue, and it's something that I don't think is fixable.

Because volcanoes, droughts, and fertiles are implemented as resources, they are resources. However, since there's no tile improvement that effects them, normally they can't be "obtained" in any real sense.

The problem crops up where in my current game, drought has struck a variety of squares, one of which is a city square. City squares seem to be unique and not something you can mod via XML. They are hardcoded(?) to pick up any resource they are on, and thus, you can get Drought. And even trade it to the AI. If the AI won't take it, no problem; just give it to them!

This seems to be a problem. Now, I don't think trading them actually DOES anything, since the drought resource doesn't show up in the city screen. But perhaps more annoyingly, I can find no way to declare a resource "non-tradeable" in the XML files. There's no option for it in the BonusInfos file. I tried changing <TechCityTrade>, say, TECH_FUTURE_TECH but that had no effect -- and that might only effect the city screen, anyway. There's no "NEVER" option, either.

If it actually had an improvement, I could set <bBonusTrade> to 0 in ImprovementInfos, but since this doesn't seem to have any effect when a city is on it. (It's not like cities automatically call the farm, mine, etc. routines... sigh.)

Finally, I tried to making <TechObsolete> to something I already had, like TECH_AGRICULTURE. That didn't work, either. I don't understand why.

At this point, I'm stumped. There doesn't seem to be a way to make a non-improveable resource non-tradeable. Now in Civ4, all normal resources require improvements to unlock them, so you could make them non-tradeable then. But I'm thinking there's also a bug in THAT code, in that cities built on the resource will still be able to trade it, since the non-tradeable code is associated with the improvement, not the resource.

But I'm a newbie at this and maybe I've missed something completely. Anyone?

Bruce

SirBruce
Feb 01, 2006, 01:41 PM
Okay, I'm partly wrong here.

The problem seems to be a drought-sticken tile that somehow got placed there when the world was created. It's not on my city and not improved or even being worked, but it's within my bounds and it still shows up for trade...

Bruce

ChaoticWanderer
Feb 02, 2006, 10:21 AM
well jsut make sure their is no way to trade them like make them only tradeable if worked a certain way then dont make that way avaiable in the game LOL

SirBruce
Feb 03, 2006, 02:40 AM
That's what I was going for, but there doesn't seem to be a way to do that, since founding a city on a resoures always makes it available (since a Worker can't improve it to access it otherwise), and every resource has to have a tech which makes is tradeable (there's no "never").

However, that wasn't the problem anyway, as I discovered. The problem is that some fertile and drought tiles (and possibly "stray" volcano too) were getting populated on the game map through the regular map generation procedures, and somehow these are allowed to be tradeable even when not worked. What I've done is change <iPlacementOrder> from 2 to -1; that seems to make it so the resources won't get placed during map generation. Volcanos will still get placed anyway by the Python script when a new game is actually started.

Bruce

GIR
Feb 03, 2006, 03:20 AM
hmm, and if you make a python code which checks if a city is on a drought resource? (if yes, remove this resource on that title)

junter
Feb 03, 2006, 04:45 AM
Thanks for the feedback, I havent done any work on the mod since because I've been too busy playing civ 4 and testing it for myself :) Also, I have another unrelated project I'm working on that I need to give priority over this mod.



Its on my to do list :) The algorithm you presented is similar to how I was going to implement it, but its going to be a bit more extensive than just a random chance in one city. Think world epidemics :)



Since my mod doesnt do anything to the map globe view I doubt it is my mod that is causing the problem (I havent played a game with it yet though).



I think the best way to learn is to read the code I've written, and also take a look at the mods provided by Firaxis eg desert war. You'll need to know how to program otherwise you wont know what you're doing. I'll describe the basic steps for adding a new random event.

My code is quite modular. This means you can go away and write your own event and then post it here and I can put it in with relative ease (if you dont totally mess up the structure :) ).

As an example, say you want to make a flood. Here are the steps:

- Create a file called RandomEventFlood.py and write all the code that does the flood in there. A good idea is to copy one of the other files there and then change the code around a bit.

- If your flood needs a popup screen, open the RandomEventsScreen.py file and write the screen handler code there. You should only add 2 functions:

setEarthquakeScreenVars - allows you to pass variables from RandomEventFlood.py so they can be shown in the popup text

showEarthquakeScreen - code to show the screen

You'll also need to add an entry to the updateScreen() function. Have a look at the other events as an example.

You will also need to create some class variables in the init function at the top of the RandomEventsScreen.py file, and should clearly mark what the flood variables are so that its easy for me to change.

- If your flood needs IO (input/output, so you can save stuff between save/loads) then you'll need to open the RandomEventsIO class and add the needed functions in there. You'll need a "set" and "get" function and the data will need to be a basic data type like int or string or whatever. Take a look at the file and use what I've already done there as a start.

- open the RandomEvents.py file. Here you'll need to put in your class constructor call for your flood and change the event handler code so that the flood will occur. Have a read of the file to see how I've done it for other events - its relatively easy to follow.

- add any constants that will be used by your flood to RandomEventsConstants.py
Can you create the spy can steal a technology from a rival civilization ?

SirBruce
Feb 03, 2006, 11:01 AM
Okay guys, I retract my earlier retraction. There's actually two bugs at work here: first, the placement of a few fertile and drought tiles at map creation (which I think my suggestion fixes), but also, as I originally suspect, if a drought or fertility strikes on top of a city, it becomes a tradeable resource. And there doesn't seem to be any way in the Civ 4 engine that I can see to mod how a city effects a resource; it seems to always assume it can access it if a city is on it.

I believe adding "and not newplot.isCity()" in the drought and fertile python files in the apporpriate place will fix this. I suggest putting it only in the placement function, not in the removal one; that way existing saves who have the bug will still have it removed once the drought or fertility ends. The only drawback to this fix is that they are slightly less impactful, but this is not a big deal. They can still happen "centered" on city squares; they just won't affect the city square itself.

I hope DireAussie sees this. :)

Bruce

AnarhCassius
Feb 04, 2006, 11:43 AM
SirBruce, to help you in the future remember that ALL resources are tradeable when not worked. You only need the improvement and a road, it doesn't even have to be in city limits, just cultural boundaries. You get it as a trade resource but of course none of the worked bonus. Since drought and fertile normally don't need an improvement or tech they are just avalible. It shouldn't make a difference if they are placed on start or by an event either, though they shouldn't be placed on start anyway.

Making them unworkable without things that don't exist seems a very sloppy workaround to me. For one it doesn't fix cities like you said. Also it means putting an unobtainable tech or improvement in the game for them to not use and that will show up in the Civapedia.

My solution is more drastic and I am not sure it would work but would solve most of these issues. We have oodles of resources as it is and these things are not really resources anyway. Make them features instead. Features don't produce trade resources, do modify terrain output, I think they can even overlap other features, something the resources can't do with other resouces. It fixes most of the problems both conceptually and in terms of game mechanics. Volcanoes are unarguably closer in concept to a forest or icecap than beavers or dye. I think this works on the XML level though I haven't double checked, I think the Python could be changed to handle it but I am new at Python myself.

[to_xp]Gekko
Feb 05, 2006, 03:37 AM
Hi DireAussie, I'm having some problems combining this mod with the RealFort mod. this is because in the CvEventInterface.py file located in the python/entrypoints folder, RealFort defines:

normalEventManager = CvCustomEventManager.CvCustomEventManager()

while your mod defines:

normalEventManager = CvRandomEventsEventManager.CvRandomEventsEventMana ger()

is there a way around this? thanx in advance for your support! :)

SirBruce
Feb 05, 2006, 04:53 AM
I agree that features seem to be the right way to go, as well. However, I you're wrong in that simply building a road to a resoures makes it available for trade, if you have the right tech. I think it does have to be worked. I haven't tested it, though, so maybe I'm wrong, but since I made my change, fertility strikes don't suddenly make my fertility tradeable.

But I agree, changing them to features seems to be the appropriate answer...

Bruce

Narn
Feb 06, 2006, 07:26 AM
Hi guys my first post here

I was wondering if its possible to use 2 different mods at once? Say I want to use the composite mod which i load up in the menu and then want the random events mod as well it will only use the last mod which i loaded up, that being the random events one

cheers guys

SirBruce
Feb 06, 2006, 12:35 PM
Not really, no. You can't even do multiple new civilizations at once, which seems like a really major oversight on the part of Firaxis.... they should have made every civ compartmentalized, so you could load multiple new civs at the very least.

But as for mods in general, mods basically have versions of their own files that are loaded instead of the stock game files at startup. Two mods most likely will have at least one file that they both have, so there's no way to really load them both at once without actually editing them.

Some people are making collected mod packs of various other mods, but these are really just one big mod that are hand-cobbled together by smart people. :)

Bruce

DireAussie
Feb 07, 2006, 07:09 PM
Okay guys, I retract my earlier retraction. There's actually two bugs at work here: first, the placement of a few fertile and drought tiles at map creation (which I think my suggestion fixes),

That's a bug I never got around to fixing. Also I think that when a drought/fertile land ends, it sometimes leaves the odd square around - this may be because other civ's trade it with other civs. Not 100% sure though.

But I agree, changing them to features seems to be the appropriate answer...

Thats something I was considering at the time. Resources are definitely not the most ideal solution.

Maybe when the SDK comes out it will allow more flexibility with what I could do with this mod.

normalEventManager = CvRandomEventsEventManager.CvRandomEventsEventMana ger()

is there a way around this?

No because both mods use their own separate events manager. There are ways to merge the two but you'd need to know how to program it in.

Can you create the spy can steal a technology from a rival civilization ?

I think it is possible but its not a simple add in, it would need work. Not sure why you're posting this in random events mod though.

Robo Magic Man
Feb 08, 2006, 03:15 PM
This is really a fantastic mod :goodjob:. I love the variety of the events, and how you don't have to wait long at all for the events to start and make the game more interesting.

I've also used it as part of a new mod that I'll post soon. Keep up the good work! :D

Robo Magic Man
Mar 07, 2006, 05:00 PM
How often is the olympics supposed to occur? I have used your mod as part of a composite, but haven't seen the olympics occur yet.

dimaliok
Apr 18, 2006, 04:52 PM
:scan: can i get a list of events:scan: :nuke: :badcomp:

Slavic Sioux
Jun 11, 2006, 10:54 AM
What are the types of ramdom events that occur???Aslo could you have a certin random event occur only on certin parts of a map (such as a Blizzard happening on Tundra,Ice and Coniferous forests???)

zulu9812
Jul 21, 2006, 03:54 AM
Is this compatible with the 1.61 patch?

Italicus
Sep 17, 2006, 08:53 PM
And with Warlords?

primem0ver
Oct 30, 2006, 04:51 PM
I have a question.... I was considering doing a mod component like this for the mod I am on the team for (the genetic era mod (http://forums.civfanatics.com/showthread.php?t=184182)for warlords).

But before I really got into it, I wanted to see if anyone had already made something like it.

We were going to call it the DisasterEngine (not truly a mod... but a component like yours). Sorry if I am asking questions that have already been answered but I don't have the time right now to read through 6+ pages of comments.

Questions:

Does your mod involve making serious changes to the SDK? (Adding of new classes etc...)

Does your mod involve separate XML files for your disasters? (I.E. something like a RandomEventInfos.xml)?

Are the random events directly coded into python or the mod, or is their some XML that represents them?

I was thinking of making some very involved changes to the SDK to accomodate my/our ideas (those developing the mod with me) so that disasters could be customizeable by modders if they desired. I have already gotten started but I don't know what your mod involves as far as it is approach. I have downloaded it myself to see what you have done but does the download include SDK source? I don't mean to copy necessarily... rather it might be nice to combine our ideas... If your mod suites our needs then maybe we will use it. Otherwise, it would be nice to work together and REALLY make something useful... and easily expandable so that modders can create their own disasters!

Meanwhile, I will check it out when I have the time.

primordial stew
Nov 12, 2006, 06:11 PM
I'm going to use tiny parts of this in RFRE. Petra was destroyed by an earthquake in 363AD, and so it will be in the game! Pompeii is too small to have on the map, but maybe I'll make a pop up and play the volcano sound in order to acknowledge the historical event.

kristopherb
Dec 08, 2006, 04:23 PM
warlords compatable