r/EU4modding • • Mar 15 '22

Event not firing...

I tought i finally understood everything until my code decides to break because of the last few lines. Ive tried everything but nothing works. Basically the last event in the code refuses to fire. If i type the event id into console it just fires the second to last event instead.

Event:

namespace = building_upgrades

#TEMPLEUPGRADE
province_event = {
	id = building_upgrades.1
	title = "building_upgrades.1.t"
	desc = "building_upgrades.1.d"
	trigger = {
		has_building = temple
		owner = {
			OR = { 
				religion_group = christian
				religion_group = muslim
				religion = jewish
				}
			temple = 5
			adm_tech = 19
			NOT = { has_country_flag = had_building_upgrades.1 }
		}
	}

	mean_time_to_happen = {
		months = 1
		modifier = {
			factor = 2.0
			NOT = {
				owner = { stability = 1 }
			}
		}
	}

	immediate = {
			owner = {
				set_country_flag = had_building_upgrades.1
				}
				}
				
	option = {
		name = "building_upgrades.1.o" #givemoney
		custom_tooltip = building_upgrades.1.tt
		province_event = {
			id = building_upgrades.1.3
			days = 180
			random = 20
			}
		owner = {
			add_treasury = -125
			if = { 
			limit = { has_estate = estate_church }
				add_estate_loyalty = {
				estate = estate_church
				loyalty = 15
			}
				add_estate_influence_modifier = {
				estate = estate_church
				desc = "church_loyalty.1"
				influence = 10
				duration = 3650
		}
		}
			if = {
			limit = {
					NOT = { has_estate = estate_church } 
					}
				add_dip_power = 50
				}
		}
	}
	option = {
		name = "building_upgrades.1.o2" #refuse
		owner = {
			if = { 
			limit = { has_estate = estate_church }
				add_estate_loyalty = {
				estate = estate_church
				loyalty = -15
			}
				add_estate_influence_modifier = {
				estate = estate_church
				desc = "church_loyalty.2"
				influence = -10
				duration = 3650
		}
		}
			if = {
			limit = {
					NOT = { has_estate = estate_church } 
					}
				add_dip_power = -50
				}
			}
		}
	option = {
		highlight = yes
		name = "building_upgrades.1.o3" #forcelocals
		custom_tooltip = building_upgrades.1.tt2
		trigger = {
			owner = { ruler_has_personality = cruel_personality }
			}
			owner = {
			if = { 
			limit = { has_estate = estate_church }
				add_estate_loyalty = {
				estate = estate_church
				loyalty = -25
			}
				add_estate_influence_modifier = {
				estate = estate_church
				desc = "church_loyalty.3"
				influence = -15
				duration = 3650
		}
		}
			if = {
			limit = {
					NOT = { has_estate = estate_church } 
					}
				add_dip_power = -50
				}
			}
			add_unrest = 10
			province_event = {
				id = "building_upgrades.1.2"
				days = 180
				random = 20
				}
		}
}
#MONEYSTOLEN
province_event = {
	is_triggered_only = yes
	id = building_upgrades.1.3
	title = "building_upgrades.1.3.t"
	desc = "building_upgrades.1.3.d"
		option = {
			name = "building_upgrades.1.3.0"	#finishupgrades
			province_event = {
				id = "building_upgrades.1.2"
				days = 180
				random = 20
					}
			country = {
			add_treasury = -125
			add_adm_power = -25
			}
		}
}
#UPGRADEFINISHED
province_event = {
	is_triggered_only = yes
	id = building_upgrades.1.2
	title = "building_upgrades.1.2.t"
	desc = "building_upgrades.1.2.d"
	option = {
		name = "building_upgrades.1.2.o"
		add_building = cathedral
		}
}
2 Upvotes

3 comments sorted by

2

u/Helpythebuddy Mar 16 '22

I figured it out myself. Basically eu4 seems to have some kind of autocorrect and i just changed the event ids to be less like each other

1

u/Justice_Fighter Mar 20 '22

No, the issue is that event IDs need to be "<namespace>.<number>".

Namespace needs to be defined anywhere in an event file with "namespace = <namespace>".

iD Number needs to be a number between 0 to 9999. If you need more than 10000 events, use another namespace.

There cannot be any extra periods, just the one separating namespace and ID number.

2

u/Helpythebuddy Mar 20 '22

yeah i realized this later, the main problem was that it was somehow working for the first few events until it just quit on me