Random Events

There is an quest for harbors which has been adjusted to work with the harbor upgrades. However the similar event for ports has not.
 
@strategyonly

Since your making new events are you going to try to make some from this thread too?

Not at the moment, i have ALOT to do ONCE i get those tags (hint hint) from TB that i need, Plus those Camps XML and python i need to work correctly(AIAndy/DH and ls612), then i have ALL those Stone Age Events also i need to do, so it might be 3-4 months from now??
 
Some of the Stone Age events need discussions with me because they would interact best with Indigenous People improving the "immersion" of the events:mischief:. Especially the ones that refer other tribes and princesses :)

There are a number of events that need fixing to better fit with things we have in C2C - the Immigration and Locust events just for starters.;)
 
Not at the moment, i have ALOT to do ONCE i get those tags (hint hint) from TB that i need, Plus those Camps XML and python i need to work correctly(AIAndy/DH and ls612), then i have ALL those Stone Age Events also i need to do, so it might be 3-4 months from now??

I've not been dragging my feet on those tags. They went in as part of a large tag adding project and I found it was bugged. Got stuck for the last few weeks on one of those bugs but I've got that sorted out now. All day I've been finding the next bug and sorting that out and repeat. I have no idea how many bugs I'll find by project's end but suffice it to say I'm finally making good progress on cleaning it up and making it all work correctly. Some of the ones I included in this are enormously more complex than I had anticipated and there's a number of things I apparently did incorrectly. But I just wanted to take a moment to assure you... they're comin'.
 
Ok, I had a look at an event modding guide and I feel confident to start making some.
If there are any idea, I'd be happy to implent them.

Note that my phyton skills are... well, non-existant :crazyeye:. I had a look at the Python used for other quests and I understand what they did there, but I can't write new code totally from scratch. So I'm limited to XML modding OR maybe use Python that is similar to already existing events.

I also found a first bug in the events :lol: "Girls best friend" require BONUS_GEMS on the map. I will change this to BONUS_DIAMOND soon. ALso, I will look at all events and check if they can trigger at all.

What I also want to bring up is that events (as some might know) have a chance that they appear in a game. I think this change is fair too low for some (iE Quests have 25% chance), since a game in Civ usually takes a few weeks - if not longer. I recommend increase these to 90% and have some balancing events like the Fire events at 100% (if they aren't already). Any problems with that?

Last but not least: I complained some time ago that "Tea trading" events gives you around 60 :gold: - ALL up to the TH era. This bugs me, as well as it bugs me that Burned Forests only cost 10 :gold: then as well. I'm pretty sure that you can have a python outcome that can link +/- :gold: events to Beakercosts of current Tech, Number of cities, number of units, gold in Treasury... This can adjust the benefits (and losses) from events as the game progresses - without creating an event multiple times!
Pretty cool hm? :goodjob:
 
Ok, I had a look at an event modding guide and I feel confident to start making some.
If there are any idea, I'd be happy to implent them.

Note that my phyton skills are... well, non-existant :crazyeye:. I had a look at the Python used for other quests and I understand what they did there, but I can't write new code totally from scratch. So I'm limited to XML modding OR maybe use Python that is similar to already existing events.

I also found a first bug in the events :lol: "Girls best friend" require BONUS_GEMS on the map. I will change this to BONUS_DIAMOND soon. ALso, I will look at all events and check if they can trigger at all.

What I also want to bring up is that events (as some might know) have a chance that they appear in a game. I think this change is fair too low for some (iE Quests have 25% chance), since a game in Civ usually takes a few weeks - if not longer. I recommend increase these to 90% and have some balancing events like the Fire events at 100% (if they aren't already). Any problems with that?

Last but not least: I complained some time ago that "Tea trading" events gives you around 60 :gold: - ALL up to the TH era. This bugs me, as well as it bugs me that Burned Forests only cost 10 :gold: then as well. I'm pretty sure that you can have a python outcome that can link +/- :gold: events to Beakercosts of current Tech, Number of cities, number of units, gold in Treasury... This can adjust the benefits (and losses) from events as the game progresses - without creating an event multiple times!
Pretty cool hm? :goodjob:

Just take a look at my modular ones and just copy and paste from there.
 
, as well as it bugs me that Burned Forests only cost 10 :gold: then as well.

There is currently a bug that is making the terraform python not load at all. Which is why the improvements "new forest" and "plant forest" are not becoming normal terrain feature "forest". It is also why the stuff I did for reefs and beacon/lighthouses which reduce damage and time to navigate reefs is not working.

The "Burnt Forest" event should change the feature to "Burnt Forest" and if the amount of money is paid the improvement "new forest" added to the plot so that the forest can grow back if worked.
 
I don't know why it is happening and every time I try and fix it I end up with none of the python modules being loaded. I need to get on to the BUG thread and ask.
 
Ok I reviewed SO's and Ori's events, now I take the core events. If you don't know what an event does: Just ask me!

I will post my observations and suggestions here and I'd REALLY appriciate if some people would take the time to comment on them.

I listed them structured so you don't need to quote, just add the number and letter in front of your comment and then I know which event you are talking about.

If there aren't any comments on a point I will just make it the way I'd do it. So no comment means you agree with me :mischief:

@DH: Do you want me to make my changes here before V34 or after the freeze?

Here is the first batch:

1) Forest Fire: (Forest burned down -> Pay to save it or let it disappear)

a)Requires Tribalism -> Why? I'd remove that and make its prereqs only Forest and Flammability.

b)Trigger doesn't take Flammability of the city into account -> Should it?

c)Is only active in 70% of the games. Probably should be 100%
d)As DH said, the first choice (Replant it) should remove it and put a "New Forest" on the plot while the others should put a burned forest on the plot. I think he said this is not possible yet?

d) With Fire Suppression I think a new option should become available: "Rescue (?) the Forest" -> Forest remains.

---------------------------------------------------

2) City Ruins (search city ruins for technology -> Get 15% towards a random tech)

a) They have a very high iWeight (Likelyhood that this event will be picked from the event-pool) compared to others (1000 were most only have 100-200). However, I don't see this very often so it's probably ok. Opinions?

----------------------------------------------------

3) Best Hunter (Good Hunting Outcomes -> Give 8 :food: one-time)

a) Requires Hunting. Should we change that to Presistance Hunting?

b) Only gives 8 :food:. While this is quite much in the very early beginning, it means nothing in the later game. We could keep Hunting as Prereq and change it to 20 instead.

c) Also quite high iWeight (500). But it would be ok for me.

----------------------------------------------------

4) Mother Lode (Discovered Mother Lode! -> Gives 100-200 :gold:)

a) Requires Writing OR Monotheism OR Priesthood OR Bronze Working. I'd say we can switch this to Hydraulic Mining probably. Or maybe Mining?

b) Never obsoletes, but requiers Mine or Shaft Mine and therefore can't occur when you have Modern Mines. Should I add these as OrPrereq?

c) Only gives 100-200 gold... I was thinking of changing the event to give the plot +3 :commerce:. OR, what I'd like more, to make it require a Gold Mine (Building) and then give this building +3 :gold:.

----------------------------------------------------

5) Washed Out (Either pay 20 :gold: or route is destroyed)

a) Well... only 20? But since routes are so cheap (40 :gold: in the late game for the Magnetic Levitation Route? Come on...) I will leave it for now. Alternatively I could make multiple events for different type of routes and adjust the :gold: for it. It maybe could be done due python but I have no idea how :(

----------------------------------------------------

6) At the Swords! (One unit gets +3 Experience)

a) Currently only for Light Swordman and Swordman. What about Obsidian Swordman and Heavy Swordman?

b) Obsoletes at Invention OR Paper OR Theology OR Philosophie OR Music. I'd say Gunpoder would be more appropiated.

c) The effect seems a bit weak, what do you think? How about free City Rider I for every Sword-Unit?

----------------------------------------------------

7) Man Named Jed (All Oil revealed)

a) What it seems to do: You need a Scout, Explorer or Adventurer on a plot with Oil on it. (I don't know if the Oil has to be revealed or not). If it fires, then you can pay 10 :gold: to reveal every Oil Resource - long before the Tech that would reveal it!

b) iWeight of 5000 (!). The iWeight is ok due the hard requirements I think.

c) 10 :gold: is way too few for it. I'd say we should remove the Scout prereq, increase :gold: to 1000 and add the Guide as OrPrereq (are there any other fitting Scout-Units)?

----------------------------------------------------

8) Inspired Mission (Convert 4 own cities, if you pay up to 4 more)

a) Only 10 :gold: to convert 1 more city and 25 :gold: for 4 more cities (both not necessary own cities). -> Increase to 100/250

b) The converted cities must not have more than 1 other religion. Maybe this should be increased to 2 or 3?

----------------------------------------------------

9) Hymns and Sculptures (Gives free Great Artist)

a) Only active in 20% of the games -> Will increase it to 90%.

b) Requires a lot of Cathedrals but not all, at least 10 global. (not sure if this is AND or OR). I will add the other Cathedrals if I find their tags.

----------------------------------------------------

10) Careless Apprentice (Lose the Forge or pay for it)

a) It is more likely to occur the more units you have. No idea why. I will remove this ok?
 
Ok I reviewed SO's and Ori's events, now I take the core events. If you don't know what an event does: Just ask me!

@DH: Do you want me to make my changes here before V34 or after the freeze?

After the release would be best.

1) Forest Fire: (Forest burned down -> Pay to save it or let it disappear)

a)Requires Tribalism -> Why? I'd remove that and make its prereqs only Forest and Flammability.

b)Trigger doesn't take Flammability of the city into account -> Should it?

c)Is only active in 70% of the games. Probably should be 100%
d)As DH said, the first choice (Replant it) should remove it and put a "New Forest" on the plot while the others should put a burned forest on the plot. I think he said this is not possible yet?

d) With Fire Suppression I think a new option should become available: "Rescue (?) the Forest" -> Forest remains.

There probably should be many.
  • One for natural fires caused by lightning strikes.
  • One near active volcanoes.
  • One third would be due to man made activity and based on Flammability
    • no probability before controlled fire
    • very low probability from then to the Slash and Burn tech.
    • low probability after

c) No point in replacing with new forest until I can figure why the python for that is not being loaded. Failure to pay should result in Burnt Forest feature rather than cleared.

d) Yes.

2) City Ruins (search city ruins for technology -> Get 15% towards a random tech)

a) They have a very high iWeight (Likelyhood that this event will be picked from the event-pool) compared to others (1000 were most only have 100-200). However, I don't see this very often so it's probably ok. Opinions?

I would like to replace this and the treasure one with a mission "Explore Ruins" for workers and recon units and adding an Archaeologist unit for better results. Needs more discussion.

I would also like to get rid of the Poison Arrow event since we have poison and I expect us to have a normal equipment building for this instead.


3) Best Hunter (Good Hunting Outcomes -> Give 8 :food: one-time)

a) Requires Hunting. Should we change that to Presistance Hunting?

b) Only gives 8 :food:. While this is quite much in the very early beginning, it means nothing in the later game. We could keep Hunting as Prereq and change it to 20 instead.

c) Also quite high iWeight (500). But it would be ok for me.

This should probably be a number of events based on tech. One active from Persistance Hunting to Hunting and so on. That way the result can be scaled.
 
You can always scale the outcome with python...
DH should know :mischief:
 
You can always scale the outcome with python...
DH should know :mischief:

Yes, I also saw that it might be possible. I don't know how to write python but if I had an example I could just copy/paste and maybe adjust it. I'd like to scale gold income/payment for events as well.
 
Code:
def doGreatBeast3(argsList):
	kTriggeredData = argsList[1]
	
	player = gc.getPlayer(kTriggeredData.ePlayer)
	(loopCity, iter) = player.firstCity(false)

	while(loopCity):
		if loopCity.isHasReligion(kTriggeredData.eReligion):
			loopCity.changeHappinessTimer(40)
		(loopCity, iter) = player.nextCity(iter, false)

There are some events that come with effects done via python.
Great Beast is one of them.

The duration is fixed at 40, but to scale it with era for instance:
Code:
def doGreatBeast3(argsList):
	kTriggeredData = argsList[1]
	player = gc.getPlayer(kTriggeredData.ePlayer)
	iDuration = 40 * (player.getCurrentEra() + 1)
	(loopCity, iter) = player.firstCity(false)

	while(loopCity):
		if loopCity.isHasReligion(kTriggeredData.eReligion):
			loopCity.changeHappinessTimer(iDuration)
		(loopCity, iter) = player.nextCity(iter, false)

Or additional duration with certain techs
Code:
def doGreatBeast3(argsList):
	kTriggeredData = argsList[1]
	player = gc.getPlayer(kTriggeredData.ePlayer)
	iDuration = 40
	if gc.getTeam(player.getTeam()).isHasTech(gc.getInfoTypeForString("TECH_HUNTING")):
		iDuration += 20
	(loopCity, iter) = player.firstCity(false)

	while(loopCity):
		if loopCity.isHasReligion(kTriggeredData.eReligion):
			loopCity.changeHappinessTimer(iDuration)
		(loopCity, iter) = player.nextCity(iter, false)

Some event results like Mother Lode are done in XML, but you can always add a python result.
Naturally, all results can be scaled in python.
 
Let's see if I got it:

Code:
doMotherLode(argsList):
	kTriggeredData = argsList[1]
	player = gc.getPlayer(kTriggeredData.ePlayer)
	iIncome = 200
	if gc.getTeam(player.getTeam()).isHasTech(gc.getInfoTypeForString("TECH_HYDRAULIC_MINING")):
		iIncome += 100

This should give him 200 and 300 if he has Hydraulic Mining. But I think I still need to define somewhere what should be done with iIncome, right?

How can I adjust it to let's say 10% of current tech cost?

Is there a list of civ's python "tags"?
 
http://civ4bug.sourceforge.net/PythonAPI/index.html

The mother lode event however, has XML tags which provide 100 to 200 gold.
So you need to scrape those or there will be double payout.

Code:
doMotherLode(argsList):
	kTriggeredData = argsList[1]
	player = gc.getPlayer(kTriggeredData.ePlayer)
	iIncome = 200
	if gc.getTeam(player.getTeam()).isHasTech(gc.getInfoTypeForString("TECH_HYDRAULIC_MINING")):
		iIncome += 100
	player.changeGold(iIncome)

After you done the calculations, naturally you need some codes to actually give the gold.
To vary it with current research
1) iTech = player.getCurrentResearch ()
2) Check that iTech is not -1
3) iCost = gc.getTeam(player).getResearchCost(iTech)
4) Divide by 10

The rest is up to DH to mentor, I am lazy to write a python tutorial.
 
Code:
doMotherLode(argsList):
	kTriggeredData = argsList[1]
	player = gc.getPlayer(kTriggeredData.ePlayer)
        iTech = player.getCurrentResearch ()

        if iTech < 0
           iTech == 1000

        iCost = gc.getTeam(player).getResearchCost(iTech) / 10
        player.changeGold(iCost)


So for example, if iTech is below 0, it is set to 1000.

If I want the event to make you to pay, I just change
Code:
iCost = gc.getTeam(player).getResearchCost(iTech) / 10
to
Code:
iCost = gc.getTeam(player).getResearchCost(iTech) / -10

Or is this not working?
 
Back
Top Bottom