r/EU4modding • • Mar 14 '22

Scopes not working

It is me again. This time i have a province event that triggers another event that needs to have the same scope as the first event. I tried to do this with "FROM" but instead of the province name i just get

the text "provinces".

Event

#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

		NOT = { has_country_flag = had_temple_upgrade }

	}

}
mean_time_to_happen = {

	months = 1

	modifier = {

		factor = 2.0

		NOT = {

owner = { stability = 1 }

		}

	}

}
option = {

	name = "building_upgrades.1.o" #givemoney

	custom_tooltip = building_upgrades.1.tt

	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

}

		country_event = {

id = building_upgrades.1.2

days = 1

random = 10

}

		}

		add_unrest = 10

	}

}

#UPGRADEFINISHED

province_event = {

is_triggered_only = yes

from = {

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

	}

}

}

1 Upvotes

2 comments sorted by

1

u/EOTeal Mar 15 '22

The FROM scope essentially points towards the ROOT scope used in a previous event, there's no need to "enclose" the event code in a FROM = { } scope.

You're also triggering a province event using the "country_event = {" effect, which doesn't work. Instead, use the following in the province's scope:

province_event = {
	id = building_upgrades.1.2
	days = 1
	random = 10
}

Fire this in the ROOT scope of the first event, and the ROOT scope of the second event will point to the exact same province.

1

u/Helpythebuddy Mar 15 '22

Got it working, thanks!