Random events v3

ArbogLi

Chieftain
Joined
Apr 25, 2010
Messages
64
Random events v7

A new mod where which add random events to the game. You have a chance of 5% more or less to have one of this events per turn. For now you can find events are:

- v1-2: get a free tile, population increase in one city or earn extra gold.
- v3: only can see the event of your empire, can loose gold and natural disasters happens.
- v4: can raze a forest, cities can get an extra amount of food and some minor bugs fixed.
- v5: can earn or loose research point, a damaged unit can get free experience and a city can loose food and can find new resources deposits.
- v6: a puppet or an occupied city can become yours, a city can be reduced to 1 population if the empire is really unhappy, can finish a production or loose all the production progress, can occur a tsunami (a lot of damage) and minor bugs fixed.
- v7: can grow a forest somewhere in the map, text changes and bug with added resources solved.

Known bugs

When you conquer a city and this city (f.ex. from a city-state) has get one tile with the "free tile event", even if the civ is defeated it continue being the owner of this land. (I tryed to fix it but I missend, if someone could help me..., follow this link to read about the problem thread)



Ideas for new random events are welcome (but not a hundred in one day, think that I'm human) or if you make a random event to add pass me and I will test an add.

Is releases and you can find using the mod browser and searching for "Random events".

Actual random event list:

Spoiler :
- Freet tile: the choosen city get a free tile.
- Add cityzen: the choosen city grow by one.
- Add gold: you the gold between 50-200.
- Loose gold: you loose gold between 50-200.
- Disaster: a disaster destroy improvements around the affected city.
- Fire: a forest is lost near a city.
- Extra food: a city increase the food reserves. Depending of the resource, it changes between 6 and 11 units.
- Research increase: the current research receive extra science points.
- Research decrease: the current research loose science points.
- Free exp.: a damaged unit get free exp. points.
- Plague: a plague destroy all the city food reserves.
- New resources: a new resource is discovered inside your territory.
- Exodus: if your empire is very unhappy the citizens of one city decide to leave it reducing the size to one.
- Merge: if your happiness is over 10, a pupet and/or an occupied city will decide become part of your empire.
- Production accident: the current production of one city is lost.
- Production finished: the current production of the city is finished.
- Tsunami: a big tsunami devast one coast city, killing a lot of citizens and destroying the current production.
- Forest: A forest can appear somewhere in the map
 
Downloading :D

New events could be for example:
research breakthrough - extra science points for current research
culture breakthrough - extra culture points for next policy
fire in forest - removes forest feature in culture borders
resource found - adds extra resources in culture borders
 
add some negative events too, disease (pop drop), flood/earthquake/tornado (building loss), improvement loss.

was thinking great person but that might be overpowered, maybe addition to gp counter instead. unit advance, free promotion/xp. diplomatic events good and bad.
 
No reason to reinvent the wheel...Civ4 ROM had ...err.....hundreds (or maybe thousands?) of events...

Btw, would it be possible right now, before modders get DLL access, to have events that give players a choice rather than just "happen"? e.g., forest fire, 2 choices: lose the forest, or pay 20 gold and have the trees replaced.
 
Buy is a bit diferent: all the events can't be re-created in civ5 (and I don't know all the events that someone create) and the gameplay is different to the last civilization, for this reason asking for ideas.

By the way... the v3 released! :)
 
Definitely true. There were a lot of religion events, for example, and those would be obsolete in the current version of the game. However, just because we can just take over an old wheel doesn't mean we have to reinvent it...maybe look down the event list and pick 'n choose what you like/is possible?

BTW, here is a link of nice long list of events....should keep ya busy for a while :D
 
Thanks hgthechinese, I'll look the events!

And by the way... there is not relligion... for now!! In units XML you can find:
- <Column name="SpreadReligion" type="boolean" default="false"/>
- <Column name="IsReligious" type="boolean" default="false"/>

@Valkrionn, was my intention to do it from the begining but I had have some problems with the IsHuman function, now are solved and this change is running ^^
 
Thanks hgthechinese, I'll look the events!

And by the way... there is not relligion... for now!! In units XML you can find:
- <Column name="SpreadReligion" type="boolean" default="false"/>
- <Column name="IsReligious" type="boolean" default="false"/>

@Valkrionn, was my intention to do it from the begining but I had have some problems with the IsHuman function, now are solved and this change is running ^^

Those religion tags are also in the building.xml files
 
@Edgecrusher: yep. They don't hide what will be in the expansions.

@Opera: it was a good idea and now we can't have the events, so we adapt a mod to the new game and enjoy it ^^

By the way: v4 released.
 
ArbogLi, is there a way to modify the odds for events to happen? In my current game I had 3 random events happen to me so far---bankrupt, bankrupt, and bankrupt. IDK if it is just my luck, or maybe because of my situation I'm extremely prone to bankruptcy or something, but it is kinda annoying that nothing but "you just lost this much money" happen to me randomly :(
 
Any chance you can add in comment aroudn what you changed in the NotificationPanel.lua please? It will make merging with other mods that use this file alot easier.
 
@hgthechinese: In the NewTurn.lua (you can open with a simple text editor) you can find (I use a if-else... don't know why but I'm unable to find a switch for LUA)

Code:
function RandomEvent()

	--loop through players:
	for cPlayer_num = 0, GameDefines.MAX_CIV_PLAYERS - 1 do

		if (Map.Rand(1000, "Random generator, a chance of 5% to happens a random event") < 50) then

			--LuaEvents.CustomNotification(5,5,"Entered players loop","Generic");
			local pCurrentPlayer = Players[cPlayer_num];	--get next player

			--Select one of the events
			local random = math.random (7);
			if (random == 1) then
				addPlot(pCurrentPlayer)
			elseif (random == 2) then
				addCitizen(pCurrentPlayer)
			elseif (random == 3) then
				addGold(pCurrentPlayer)
			elseif (random == 4) then
				deductGold(pCurrentPlayer)
			elseif (random == 5) then
				disasters(pCurrentPlayer)
			elseif (random == 6) then
				Ffire(pCurrentPlayer)
			elseif (random == 7) then
				extraFood(pCurrentPlayer)
			end
			
		end -- First IF ending
	end -- Players loop end
end -- RandomEvent()

All is random (but you seem really unlucky), if you don't want the "Bankrupt" you must change:

Code:
elseif (random == 4) then
	deductGold(pCurrentPlayer)

for:

Code:
elseif (random == 4) then
	--deductGold(pCurrentPlayer)

The if the number 4 appears, nothing will happen (in this case, no money loose).

@Horem, if I'm not wrong in NotificationPanel.lua the changes are limited by "-- Mod" and "-- /Mod" in the source.
 
@Horem, if I'm not wrong in NotificationPanel.lua the changes are limited by "-- Mod" and "-- /Mod" in the source.

I did see that, did u happen to make the same changes as this mod?

From what I can see the changes look identical, going to go with it, and see.
 
I did see that, did u happen to make the same changes as this mod?

From what I can see the changes look identical, going to go with it, and see.

Yep, you are right. As template used the Emigration mod... I think I didn't make any changes to the notifications in this Lua. In my opinion really useful.
 
Top Bottom