Events system brainstorm

Modified version of the university policy event...

What's going on here? The rollover text shows correctly the +5 science (+3 base plus +2 from event). The top level text is showing +7 science. Prior to the event choice being selected, it is correctly showing +3 for both. I also checked for a second event choice that offers +2 faith and it doing the same thing (showing +2 in one window and +4 in the other).

Also - is there a way to add Building_UnitCombatFreeExperiences and ReligiousPressureModifier to buildings through the events system? I could use dummy buildings but I only want the effect added in cities with universities. Or, to achieve the same thing, is there a LUA hook that could be written that:

If event choice X is active then
Build dummy building in all cities with existing universities
Build dummy building in any other city that later builds university
End if

?
 

Attachments

  • Screenshot (1)_crop.png
    Screenshot (1)_crop.png
    223.7 KB · Views: 23
Last edited:
There was a UI bug a long time ago that looked like this. Perhaps it has returned.

No, you can't do what you're asking with the xml.
dummies or lua.
another way of doing it is to have a city event with only 1 choice that can fire if the city has university AND the global event choice is picked.
So you would do your event then all your cities would be eligible to fire events that added the dummy. Make sense?
 
Using a lot of events so they really "random" and more replayable. Something like ChatGPT should be able to generate a lot :D
 
Would it be possible to have a "multiple choice" event system? So, for example, when a certain event triggers, you'll get one of:
Event Possibility A
Event Possibility B
Event Possibility C

And each of those possibilities would have their own unique choices?

Something Like:
Event Possibility A
Choice 1
Choice 2
Choice 3

When I was planning my mod for Civ5, before my neurological conditions got too bad for me to continue, it was something I wanted to do, but I never actually got under the hood to see if it was possible.
 
Another plan I had - for increased realism, was for Natural Disaster Events to occur every single turn. They would be Global Events. It's not that every Civ would experience every Natural Disaster Event every single turn, but that every turn a Natural Disaster Event would occur to one single Civ/Citystate. Also, Natural Boosting Events (like Great Harvest, Great Trading Event, etc.,) would also occur every single turn, but just in some random Civ/Citystate, not every Civ/Citystate.
 
another way of doing it is to have a city event with only 1 choice that can fire if the city has university AND the global event choice is picked.
So you would do your event then all your cities would be eligible to fire events that added the dummy. Make sense?

Yes. I just made the changes and modified several events to function this way. My thoughts are that I'll use the events system to allow for some city specialization that folks have been requesting, but balanced through the events system. For example, the event where you can pick whether to add culture or gold to public schools is now a choice for science, culture, or production all at a gold cost. You can also slightly increase gold if you forgo the others. And it's now a city level choice, not a player level choice. I'm setting up several events to work this way with more in my head.

With that in progress, is there a way to do a check for # of buildings so I can turn off a choice if a threshold is met? I'd like to use the City:IsCityEventChoiceValid(CityEventChoiceTypes eEventChoice) option or something like that to turn off the choice once the max is reached. I know next to nothing about lua but figure I can start piecing things together if I can see some game examples that I can look at.

One of the city specialization events I'm working on lets you build a park that offers some modest increases (+1 GG or GA point, 5% food carryover, a new promotion for workers built by the city), but I don't want it to become too imbalanced by a huge empire always picking GG points and getting 20 per turn. I'd like to limit the max to 5. I've got the MaxPlayerInstances set in the BuildingClasses but haven't checked it yet to see what's going to happen when the event choice is fired and you are at 6+.
 
Would it be possible to have a "multiple choice" event system? So, for example, when a certain event triggers, you'll get one of:
Event Possibility A
Event Possibility B
Event Possibility C

And each of those possibilities would have their own unique choices?

Something Like:
Event Possibility A
Choice 1
Choice 2
Choice 3

When I was planning my mod for Civ5, before my neurological conditions got too bad for me to continue, it was something I wanted to do, but I never actually got under the hood to see if it was possible.

That's the idea of the BYOA method of events development that I'm working on.
 
Another thing I'd like to know how to do is find out whether a city is not adjacent to a coast / river, does not have certain terrain types / resources / improvements / features /etc so I can base events around those criteria.
 
That's the idea of the BYOA method of events development that I'm working on.
It seems to me that BYOA is more about nested events with various choices on each part of the "adventure" - whereas what I'm asking is can any given one-time event be more random than it currently is, when that event does occur.

So, for example, when the event "Nomad Incursion" occurs, you might get one of the possibilities (totally random though, so that the event won't always be the exact same thing for every single game, nor every single Civilization either.) You only ever get one of Possibility A, B, or C, in any given game. This, again, is just to add randomness to any given one-time event, nothing to do with nested choice events...

Nomad Incursion Possibility A
Choice 1 - Let the nomads settle land around you (bonus border expansion points)
Choice 2 - Let the nomads settle into your city (bonus population)
Choice 3 - Let the nomads spread their religion (bonus faith)
Nomad Incursion Possibility B
Choice 1 - Let the nomads integrate into our society (bonus culture)
Choice 2 - Let the nomads join our army (bonus military unit)
Choice 3 - Let the nomads join our workforce (bonus worker)
Nomad Incursion Possibility C
Choice 1 - Let the nomads settle land around you (bonus border expansion points)
Choice 2 - Let the nomads integrate into our society (bonus culture)
Choice 3 - Let the nomads join our army (bonus military unit)

So, yes, your BYOA idea for events is awesome. But, I also want one-time events. I also want Global Events, as I described earlier. I want all different kinds of events, which will hopefully make the events seem unique to every single game.
 
Another thing I'd like to know how to do is find out whether a city is not adjacent to a coast / river, does not have certain terrain types / resources / improvements / features /etc so I can base events around those criteria.
No, again this is not supported.
The way to do it is to have a dummy event fire if it *is* one of those things, then your new event is blocked by that dummy one.
 
...So, for example, when the event "Nomad Incursion" occurs, you might get one of the possibilities (totally random though, so that the event won't always be the exact same thing for every single game, nor every single Civilization either.) You only ever get one of Possibility A, B, or C, in any given game. This, again, is just to add randomness to any given one-time event, nothing to do with nested choice events...
I like it! Looks pretty easy to pull off. I'll just have to make sister events and have them linked so only one can be active at a time. First one to fire is the one you get.

Once I get this expansion pack I'm working on wrapped up, I might revisit some of the events I've already modified and/or built and incorporate this idea.
 
No, again this is not supported.
The way to do it is to have a dummy event fire if it *is* one of those things, then your new event is blocked by that dummy one.
Ugh. That's what I was doing and I thought it was pretty clunky, especially when the dummy event didn't fire for ages and ages, so the second event would fire.

What about this question:

rsc2a said:
Is there a way to do a check for # of buildings so I can turn off a choice if a threshold is met? I'd like to use the City:IsCityEventChoiceValid(CityEventChoiceTypes eEventChoice) option or something like that to turn off the choice once the max is reached. I know next to nothing about lua but figure I can start piecing things together if I can see some game examples that I can look at.

And another couple I have thought of:

  • Is there some kind of code that could be triggered that would force a Holy City to move? I'm thinking of a NW event where a requirement is a state religion and one of the effects is forcing the Holy City to move to the City with the NW.
  • Can specialists have a negative yield? I'm thinking of a couple events that boost specialists in one way while adding a new cost from a yield they might now have (e.g. +1 science for -3 gold where the specialist has nil gold)
  • If you have an event that gives a bonus trade route (via a dummy building) and destroy the building in another event, what would happen if the player was suddenly over on the trade limit? I'm thinking that over max would be okay without a bug, but you wouldn't be able to build any more except up to the new max.
 
And a general question for everyone...

You have an event that boosts a local improvement that exclusively requires a resource (e.g. camps, pastures, quarries, plantations, fishing boats), not terrain or features (e.g. mines and lumber mills) Would you want the event to add a relevant bonus resource (not strategic or luxury) simpler to the 4UC buffalo camp or keep it as is. No resource...."Oh well, better luck next time" for that event or no?
 
I like it! Looks pretty easy to pull off. I'll just have to make sister events and have them linked so only one can be active at a time. First one to fire is the one you get.

Once I get this expansion pack I'm working on wrapped up, I might revisit some of the events I've already modified and/or built and incorporate this idea.
Great. More randomness, game to game, would be extremely welcome in the events system.
You're the best thing that has happened to events in Civ since they were introduced, my dude. :hug:
And a general question for everyone...

You have an event that boosts a local improvement that exclusively requires a resource (e.g. camps, pastures, quarries, plantations, fishing boats), not terrain or features (e.g. mines and lumber mills) Would you want the event to add a relevant bonus resource (not strategic or luxury) simpler to the 4UC buffalo camp or keep it as is. No resource...."Oh well, better luck next time" for that event or no?
I'm inclined to say that every choice should matter, no choices should lead to nothing. Positive, Neutral, Negative - something should happen.
 
Great. More randomness, game to game, would be extremely welcome in the events system.
You're the best thing that has happened to events in Civ since they were introduced, my dude. :hug:
Most definitely not. I've got a couple new events right now and am working on several more but the vast majority of what I've done has been modifying the amazing work of the others who developed the Community Events mod and the core VP events.

And I know I keep saying this, but I should have the re-calibrated events posted in a few days. Working through edits one more expansion pack (NW events), and you'll have the following packages: Natural Disasters, Signs and Wonders, Era Events, and Natural Wonder Events (revised).
 
Ugh. That's what I was doing and I thought it was pretty clunky, especially when the dummy event didn't fire for ages and ages, so the second event would fire.
If you make it certain to fire ( i dont remember if the probability should be 1000 or -1...), then I seem to remember there is a flag like ignoresglobalcooldown. So this shouldn't be an issue.

For #building it's the same thing, there is only the positive check, not the opposite, so you have to split it into two events.

In many ways splitting into 2 events adds to the mystique of the system ;) Promise.

  • Is there some kind of code that could be triggered that would force a Holy City to move? I'm thinking of a NW event where a requirement is a state religion and one of the effects is forcing the Holy City to move to the City with the NW.
  • Can specialists have a negative yield? I'm thinking of a couple events that boost specialists in one way while adding a new cost from a yield they might now have (e.g. +1 science for -3 gold where the specialist has nil gold)
  • If you have an event that gives a bonus trade route (via a dummy building) and destroy the building in another event, what would happen if the player was suddenly over on the trade limit? I'm thinking that over max would be okay without a bug, but you wouldn't be able to build any more except up to the new max
The first one is beyond my paygrade. I'm not sure how the holy city stuff works after it is assigned. It might be quite heavy lua.
I think specialists can have negative yields, yes. My source is the negative gold(?) that civil servants used to have. Not sure if the event table allows it, but certainly I had -gold on buildings in some of my events so I imagine it is fine for specialists too.
Extra trade routes are already granted by some buildings, so you can test by making one of them and then (using firetuner/IGE) razing the city. I have a feeling the gain of trade routes is permanent, but not 100% sure.
 
While playing through my latest game tonight, another thought about events occurred to me. We have Civ-specific events, but can we have CulturalGroup-specific events? If so, that could add another layer to the gameplay.
 
It seems to me that BYOA is more about nested events with various choices on each part of the "adventure" - whereas what I'm asking is can any given one-time event be more random than it currently is, when that event does occur.

So, for example, when the event "Nomad Incursion" occurs, you might get one of the possibilities (totally random though, so that the event won't always be the exact same thing for every single game, nor every single Civilization either.) You only ever get one of Possibility A, B, or C, in any given game. This, again, is just to add randomness to any given one-time event, nothing to do with nested choice events...
Done! I just modified five events (to start with) to all have varying versions of the same event with with differing choices. And they are all city-level events so you'll see more variety since they fire more often.

Question for the modders: Here is my set-up for doing this (basically what epiccivfreak described above...in fact, one of the events was the nomad event he suggested):

Event_version 1
Choice 1
Choice 5
Choice 2
Event_version 2
Choice 5
Choice 3
Choice 1
Event_version 3
Choice 4
Choice 2
Choice 3

Then I use the EventLinks to block the other events once one of them fires. First to fire wins the city.

The question: is there a less clunky way to do this? It's easy to set up multiple events but I end up with a fair number of database entries for a single randomized event.

If you make it certain to fire ( i dont remember if the probability should be 1000 or -1...), then I seem to remember there is a flag like ignoresglobalcooldown. So this shouldn't be an issue.

For #building it's the same thing, there is only the positive check, not the opposite, so you have to split it into two events.

In many ways splitting into 2 events adds to the mystique of the system ;) Promise.


The first one is beyond my paygrade. I'm not sure how the holy city stuff works after it is assigned. It might be quite heavy lua.
I think specialists can have negative yields, yes. My source is the negative gold(?) that civil servants used to have. Not sure if the event table allows it, but certainly I had -gold on buildings in some of my events so I imagine it is fine for specialists too.
Extra trade routes are already granted by some buildings, so you can test by making one of them and then (using firetuner/IGE) razing the city. I have a feeling the gain of trade routes is permanent, but not 100% sure.
Okay. I've got several tutorial and "set-up" single-choice events to fire now on certain conditions. For example, when you found a city, you will get an event if it's on a river, a second event if it's on a coast, and a sister event to the coast to flag that it's inland. It give me a couple extra tags I can use to block events based on these earlier ones that fire. For the notification, I've just got a nice little tag and quote, maybe about how rivers are soothing or oceans are wild.

What I'd like to do is randomize it slightly so you aren't see the same quote over and over for a set condition. My thoughts are to have several single-choice events for the same condition (e.g. on a river) and let a random one fire to set the tag. I know it can be done because the old Events and Decisions mod had the randomized settlement events but, looking through that mod, I cannot figure out how it was set up. Any hints?

Edit: Or as another option, some way to call random text tags (wildcard?) similar to the diplomacy responses (generic_text_1, generic_text_2, generic_text_3,....)

While playing through my latest game tonight, another thought about events occurred to me. We have Civ-specific events, but can we have CulturalGroup-specific events? If so, that could add another layer to the gameplay.
Cultural group? Do you mean policy-based? That's possible and in the works.

----

@Tekamthi - I was thinking about incorporating portions of your TreeSuccession mod into the forest fire and wet season events. If the forest is on fire, shouldn't there be a chance it disappears? And the wet season could help some of that burned down stuff grow back so it's not a wasteland by turn 300. I haven't looked at the code at all and know virtually nothing about lua but would it be something that could be tied to the events system and tied to a specific city somehow?
 
Last edited:
I was thinking about incorporating portions of your TreeSuccession mod into the forest fire and wet season events. If the forest is on fire, shouldn't there be a chance it disappears? And the wet season could help some of that burned down stuff grow back so it's not a wasteland by turn 300. I haven't looked at the code at all and know virtually nothing about lua but would it be something that could be tied to the events system and tied to a specific city somehow?
my first take here is that this would be best built-in to TreeSuccession itself. I'm just speaking from vague memories right now but I believe there is a lua hook for event triggers... so when one of these events goes off, TreeSuccession's lua would check which one it is, and if its one of the desired events, would light or extinguish or create new growth or change ignition probability etc. As it stands there's no intentional way to trigger or modify TreeSuccession features, though afaik you could just call the mod's functions with the right lua. FYI TreeSuccession generally uses global probability variables ie if you had a "dry season" with higher chances of fires lighting, that dry season would be for entire map not just certain continents or hemispheres etc.

Still, all this suits my tastes, its essentially what I had in mind for any next version of that mod, whenever i get to it. Was planning on connecting to the forest fire events themselves, but there could be more than just that.

You are welcome to use anything I've posted on CF, dissect and re-purpose etc., please just add a credit/attribution somewhere. I think you might accomplish what you've described via the lua require function, and thus be able to call TreeSuccession's functions in a separate lua, but I don't have experience doing this. I would say TreeSuccession leans towards the 'intermediate' category of lua implementations, its probably not where you wanna start if you're brand new, though if you have solid experience in other coding language you'll understand everything no problem.

I can't make any promises as far as when i might get to any implementation, but if you develop any specific ideas for TreeSuccession related events and wanna post the particulars here, I'll definitely consider how they might best be implemented.
 
Last edited:
Cultural group? Do you mean policy-based? That's possible and in the works.
I was thinking of the way that "culturally linked" map placement works. I'm not 100% sure what the cultural groups are these days nor how they actually work, so this is just an example, not necessarily how Civ5 works:
African Events, American Events, European Events, Middle Eastern Events, etc.
 
Top Bottom