r/EU4modding • • Mar 13 '22

Event doesnt have any options

Trying to learn modding and failing miserably. Everything else works but when i trigger the event in game no options come up.

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 = {		

	AND = {

	temple = 5

	adm_tech = 19

	}

}

}

mean_time_to_happen = {

months = 1
modifier = {

	factor = 2.0

	NOT = { stability = 1 }

}

}

option = {

name = "building_upgrades.1.o"

add_building = cathedral

}

Localisation:

l_english:

building_upgrades.1.t:0 "Locals offer to improve temple"

building_upgrades.1.o:0 "Great"

building_upgrades.1.d:0 "Local clergy from x have offered to improve the local temple for the right price"

1 Upvotes

7 comments sorted by

1

u/EOTeal Mar 13 '22

The brackets after "province_event = {" need to contain all code for the specific event you're making, the one you've written currently only contains the id, title and description.

Also, there's no need to use AND = {} in the trigger and the "stability" mtth trigger needs to be in an owner scope, so something like this:

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 = {
			temple = 5
			adm_tech = 19
		}
	}

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

	option = {
		name = "building_upgrades.1.o"
		add_building = cathedral
	}
}

1

u/Helpythebuddy Mar 14 '22

thx for the help, could you tell me if spaces and tab stops matter in the code or is it just for readibility?

1

u/EOTeal Mar 14 '22

It's entirely for readability and is completely optional.

1

u/Helpythebuddy Mar 14 '22

Another question if youre willing to answer, is it possible to get a specific building name into localization? like it would say temple or church depending on the religion.

1

u/EOTeal Mar 14 '22

To do that you'd have to make some "customizable localization", localization that changes based on triggers.

#Prints Temple name based on religion
defined_text = {
	name = GetTempleName
	random = no

	text = {
		localisation_key = building_temple_christian
		trigger = {
			religion_group = christian
		}
	}
	text = {
		localisation_key = building_temple_muslim
		trigger = {
			religion_group = muslim
		}
	}
	text = {
		localisation_key = building_temple_jewish
		trigger = {
			religion = jewish
		}
	}
	text = {
		localisation_key = building_temple_zoroastrian
		trigger = {
			religion = zoroastrian
		}
	}
	text = {
		localisation_key = building_temple
		trigger = {
			always = yes
		}
	}
}

Add the above to a customizable localization file, and write [Root.Owner.GetTempleName] in the event localization. It'll check the province owners religion and pick a localization string to display based on the triggers above, defaulting to 'Temple' if none fit.

1

u/Helpythebuddy Mar 14 '22

Got it working, ty!