• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

chefkoch

Banned
Oct 3, 2007
698
0
Hi, I have a question about random events. Is it possible to have province-specific random events?

I made a couple like this one:

event = {
id = xxx
trigger = {
ai = yes
year = 1337
NOT = { year = 1803 }
NOT = { exists = THU }
NOT = { owned = { province = 347 data = BAY } }
}
random = yes
province = 347
name = "Grant Würzburg independence"
desc = "AI Event"
style = 1

action_a = {
name = "Grant Würzburg independence"
command = { type = independence which = THU }
}
}

I'm waiting now for 15 years that this event fires for the AI-country that owns #347 but nothing...
 
I don't think so. Havard's bible mentions random events can be nation-specific but has nothing on whether they can be province-specific. I think he would have mentioned it if it was possible.

Anyway this is a good thread title, because I myself was about to ask a question on random events. For some reason my mod atm only runs if I include the "event = "db\events\randomevents.txt" line in my events.txt. If I exclude it (which I was attempting for testing purposes) then the game freezes upon the "initialising script" phase. If putting a "#" infront of that line or delete that line then it will freeze. If I rename the randomevents file, it will use the vanilla one instead. This seems to arisen after I edited some other events in different files. How can I turn off the randomevents? And why it is freezing when I do?

I can either have:
- all the event files on
- all the event files off
- all the event files off except randomevents.txt
- a selected few event files on and randomevents.txt off
but not all the events on except randomevents.txt.
 
Last edited:
I don't think so. Havard's bible mentions random events can be nation-specific but has nothing on whether they can be province-specific. I think he would have mentioned it if it was possible.

Hm, i then have to change my triggers and replace...

province = 347

with

owned = { province = 347 data = -1 }


...I hope that works.

Thanks.



----
If you exclude "event = "db\events\randomevents.txt" in your event.txt, did you also exclude it in the scenario-file (.eug)?
 
Last edited:
Hm, i then have to change my triggers and replace...

province = 347

with

owned = { province = 347 data = -1 }


...I hope that works.

Thanks.

Yes, that should work.

If you exclude "event = "db\events\randomevents.txt" in your event.txt, did you also exclude it in the scenario-file (.eug)?

I only have the line "include = "db\events.txt"" in the .eug. Then my db\events.txt looks something like this:

Code:
event = "db\events\xxxx1.txt"
event = "db\events\xxxx2.txt"
event = "db\events\xxxx3.txt"
event = "db\events\xxxx4.txt"
event = "db\events\xxxx5.txt"

event = "db\events\randomevents.txt"

and if I put a '#' before that last line, it will freeze. I assume i have a badly written event or something but I find it interesting that it works when all the events are turned on.
 
Found the problem. I had a couple of random events in another file. I think by excluding the randomevents.txt I was leaving the game with too few random events for it to handle. By relocating all the random events to the one file and then excluding that file, the game can now run without any random events. :)
 
As tested, the game requires a minimum of 20 possible random events for each country on the map. And by "possible" I mean with trigger true for the country when internal check is made.

Otherwise, there is a risk of CTD at any time...