• 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.

XiDragon

Whatever
42 Badges
Aug 21, 2004
116
29
  • Hearts of Iron IV: Cadet
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Mount & Blade: Warband
  • Stellaris
  • Magicka
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Stellaris: Ancient Relics
  • Crusader Kings III
  • Divine Wind
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III Complete
  • Cities in Motion
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • Heir to the Throne
  • Europa Universalis III Complete
  • King Arthur II
Hi Modders,

I would love to be informed when one of my envoys has come home. As of now I have to look to often into the ledger to get the information where they are and when they are coming back and that isn't very comfortable. Even better would be to add the envoys to the Outliner but I dont think that this would be possible.

So how would I program such an event?
Or is that not possible at all?

Any help would be highly appreciated.

Have Fun
XiDragon
 
Following are 2 versions of an event I tried to resolve what I posted in the opening post.

The following events should fire whenever a player envoy is send abroad. A second event (not posted) should fire when the envoy is back home that will remove the flag set by the first event. But as of now none of the events fires when I send an envoy abroad. The first test event so fires when a foreign envoy is in my country, not what I wanted.

Code:
First test via character event:
# Envoy Abroad 1
character_event = {

	id = 199001

	trigger = {
		is_envoy = yes
		not = { has_character_flag = envoy_abroad }
		location = { owner = { not = { ai = yes } } } 
	}

   	mean_time_to_happen = { days = 1 }

	title = "EVTNAME199001"
	desc = "EVTDESC199001"

	option = {
		name = "EVTOPTA199001"
		set_character_flag = envoy_abroad
	}
}

Second Test - via a country event
# Envoy Abroad 2
country_event = {

	id = 199002

	trigger = {
		any_character = {
			is_envoy = yes
			not = { has_character_flag = envoy_abroad }
			location = { not = { owned_by = this } }
		}
		
	}

   	mean_time_to_happen = { days = 1 }

	title = "An Envoy is gone Abroad 2"
	desc = "Blabla"

	option = {
		name = "Okidoki"	
		any_character = {
			is_envoy = yes
			location = { not = { owned_by = this } }
			set_character_flag = envoy_abroad
		}
	}
}

Any advise?
 
Last edited:
I am a newbie to the EU event system. I just need some tips in the right direction.

What I need to know:
1. Is it possible to create an event that fires with 100% likelihood if the trigger is met?

2. In regards to 1., does this get me there?:
mean_time_to_happen = { days = 1 }

3. How do I create a trigger that fires whenever an envoy is abroad?
Does the following used in a character event achieve that?:
Code:
is_envoy = yes
location = { owner = { not = { ai = yes } } }


Thanks in advance.
 
It is definitely the trigger, but I have no clue what to do about it, I dont know how possible this is.
 
XiDragon said:
1. Is it possible to create an event that fires with 100% likelihood if the trigger is met?
Yes, they all should.

XiDragon said:
2. In regards to 1., does this get me there?:
mean_time_to_happen = { days = 1 }
That will work. If you have no mtth that will also work, though I don't know what the default is.

XiDragon said:
3. How do I create a trigger that fires whenever an envoy is abroad?
Does the following used in a character event achieve that?:
Code:
is_envoy = yes
location = { owner = { not = { ai = yes } } }
Try replacing the second line with 'country = { not = { ai = yes } }' instead. It could be that a character on a mission has no location, so that's not working properly.
 
Tried the following but it does not trigger automatically. If I trigger it manually the event is working like it should. Why the heck is that?
Any further help?

Code:
# Envoy Abroad
country_event = {

	id = 199001

	trigger = {
		any_character = {
			not = { has_character_flag = envoy_abroad }
			is_envoy = yes
			is_ruler = no 
			country = { has_country_flag = player_controlled }
		}	
	}

   	mean_time_to_happen = { days = 1 }

	title = "EVTNAME199001"
	desc = "EVTDESC199001"

	option = {
		name = "EVTOPTA199001"					# Envoy xy is at target

		any_character = {
			limit = { is_ruler = no is_envoy = yes }
			not = { has_character_flag = envoy_abroad }
			country = { has_country_flag = player_controlled }
			set_character_flag = envoy_abroad
		}
	}
}
# Envoy Back
country_event = {

	id = 199002

	trigger = {
		has_country_flag = player_controlled
		any_character = {
			has_character_flag = envoy_abroad
		}
	}

   	mean_time_to_happen = { days = 1 }

	title = "EVTNAME199002"
	desc = "EVTDESC199002"

	option = {
		name = "EVTOPTA199002"					# Our Envoy xy is back

		any_character = {
			limit = { has_character_flag = envoy_abroad }
			clr_character_flag = envoy_abroad
		}
	}
}
 
if you not set the trigger "player_controlled" manually or with extra event, it doesn´t work.
better you try the trigger "not = { ai = yes }", thats working fine for events, they should only happend to the player.
 
Also, you'll want to change the limit in the option to cover all the limits. Like:
Code:
any_character = {
	limit = {
		is_ruler = no
		is_envoy = yes
		not = { has_character_flag = envoy_abroad }
		country = { ai = no }
	}
	set_character_flag = envoy_abroad
}
 
Thanks for your advice. Tried it all but the event is still not triggered the way it should. I limited the first event for testing purposes to a minimum, just to see if it is triggered and yes it is just not daily but monthly! What is wrong there?
Or maybe I misunderstand the event system. Isn't it so that if the MTTH is set to "days = 1" the event is fired once a day and than the triggers will be checked?

Code:
# Envoy Abroad
country_event = {

	id = 199001

	trigger = {
		any_character = { 
			is_envoy = yes 
			not = { has_character_flag = envoy_abroad }
		}	
	}

   	mean_time_to_happen = { days = 1 }

	title = "EVTNAME199001"
	desc = "EVTDESC199001"

	option = {
		name = "EVTOPTA199001"					# Envoy xy is at target

		any_character = {
			limit = { 
				is_envoy = yes 
				not = { has_character_flag = envoy_abroad } 
			}
			set_character_flag = envoy_abroad
		}
	}
}