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

Kindjal

Major
47 Badges
Nov 13, 2003
623
15
Visit site
  • Hearts of Iron IV: Death or Dishonor
  • Victoria 2: Heart of Darkness
  • Warlock: Master of the Arcane
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Stellaris
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Victoria 2: A House Divided
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Prison Architect
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Federations
  • Divine Wind
  • Crusader Kings II: Charlemagne
  • 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
  • Darkest Hour
  • Europa Universalis III
  • Europa Universalis III Complete
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Sword of the Stars
  • Victoria 2
I am trying to make a generic event that fires for all countries listed in TAG within the same time frame, once a flag is set.
I tried a few variations based on the example here:

Code:
event = {
	id = 100001
	random = no
	TAG = { ENG GER RUS MEX USA U00 U02 VIC U05 }
	all = yes #execute for all tags in the list
	persistent = yes
	trigger = {
		flag = someflag
	}

	name = "name"
	desc = "desc"
	style = 2
	picture = "news_paper"

	date = { day = 10 month = january year = 1936 }
	offset = 3
	deathdate = { day = 1 month = february year = 1936 }

	action = {
		name = "OK"
		command = { type = relation which = GER value = 5 }
	}
}

I tried adding "invention = yes", an OR clause with all countries in question within the trigger, with and without TAG/"all", and several variants thereof.
Yet the only country ever to receive the event is the first in the TAG, England. I even tried using a local flag but that had no effect either.

Any ideas?
 
There's a variety of ways you can do this. First off, all=yes is a wrong parameter (why the game doesn't crash is beyond me). Using inventions = yes is another bad idea since that'd tie it to random modifiers in misc.txt (iirc).

You can use local flags and global flags. If you want an event to fire for every country once, here is an example:

Code:
event = {
	id = 9999
	random = no
	persistent = yes
	save_date = yes
	TAG = { FRA JAP GER INO IRE ITA PHI POR SAU SCH SIA SPR TAN TUR U00 U01 U02 U03 U04 U05 U07 U08 U10 UGS YUG}
	
	trigger = {
		flag = japan_falls
		not = {local_flag = 9999}
		or = {
		event = {id = 10000 days = 2}
		event = {id = 11010 days = 2}
		}
	}
	
	style = 2
	name = "Japan Falls"
	desc = "World governments around the world watch as the Oriental Incident draws to a close and yet another country falls to Britannia."

	date = { day = 1 month = august year = 1957 }
	offset = 1
	deathdate = { day = 30 month = december year = 1973 }
	
	picture = "surrender"
	
	action = {
		name = "It is too soon to tell the effects"
		command = { trigger = { not = {country = U00}} type = domestic which = interventionism value = 1}
		command = { trigger = { not = {country = U00}} type = domestic which = defense_lobby value = 1}
		command = { trigger = { and = {country = JAP control = {province = 1562 data = JAP} }} type = independence which = U01 value = 1}
		command = { trigger = { and = {country = U00 control = {province = 1562 data = U00} not = {flag = japan_resist} }} type = independence which = U01 value = 1}
		command = { trigger = { country = U00} type = name where = U01 which = "War Refugees"}
		command = { trigger = { country = U00 } type = independence which = U09 value = 1}
		command = { trigger = { country = U00 } type = make_puppet which = U09}
		command = { trigger = { country = U00 } type = secedearea which = U09 value = "Hokkaido" }
		command = { trigger = { country = U00 } type = secedearea which = U09 value = "Tohoku" }
		command = { trigger = { country = U00 } type = secedearea which = U09 value = "Honshu" }
		command = { trigger = { country = U00 } type = secedearea which = U09 value = "Kyushu_Shikoku" }
		command = { trigger = { and = {country = U00 control = {province = 1562 data = U00}}} type = secedeprovince which = U09 value = 1562}
		command = { trigger = { and = {country = U00 control = {province = 1563 data = U00}}} type = secedeprovince which = U09 value = 1563}
		command = { trigger = { and = {country = U00 control = {province = 1564 data = U00}}} type = secedeprovince which = U09 value = 1564}
		command = { trigger = { and = {country = U00 control = {province = 1542 data = U00}}} type = trigger which = 11902 }
		command = { trigger = { country = U00 } type = secedeprovince which = U09 value = 1543 }
		command = { trigger = { country = U01 } type = set_domestic which = democratic value = 3 }
		command = { trigger = { country = U01 } type = set_domestic which = political_left value = 7 }
		command = { trigger = { country = U01 } type = set_domestic which = freedom value = 7 }
		command = { trigger = { country = U01 } type = set_domestic which = free_market value = 3 }
		command = { trigger = { country = U01 } type = set_domestic which = professional_army value = 2 }
		command = { trigger = { country = U01 } type = set_domestic which = defense_lobby value = 10 }
		command = { trigger = { country = U01 } type = set_domestic which = interventionism value = 10 }
		command = { trigger = { country = U00 } type = trigger which = 100310 }
		command = { type = local_setflag which = 9999}
	}
}

If you want a decision like event that once triggered immediately triggers the same event for other countries, you can do something like this:

Code:
event = {
	id = 100001
	random = no
	TAG = { ENG RUS MEX USA U00 U02 VIC U05 } # GER removed based on what you wanted.

	persistent = yes
	
        # Triggered (just trigger this event for a country instead of setflag)
        # OR if you want to limit to once per country
        # trigger = { not = { local_flag = 100001 } }
        # don't include deathdate/startdate with above trigger.

	name = "name"
	desc = "desc"
	style = 2
	picture = "news_paper"

	action = {
                trigger = {
                     not = { flag = 100001 }
                }
		name = "OK"
		command = { type = relation which = GER value = 5 }
                command = { type = setflag which = 100001 }
                command = { trigger = { not = { country = ENG } } type = event which = 100001 where = ENG when = 0 }
                command = { trigger = { not = { country = RUS } } type = event which = 100001 where = RUS when = 0 }
                command = { trigger = { not = { country = MEX } } type = event which = 100001 where = MEX when = 0 }
                command = { trigger = { not = { country = USA } } type = event which = 100001 where = USA when = 0 }
                command = { trigger = { not = { country = U00 } } type = event which = 100001 where = U00 when = 0 }
                command = { trigger = { not = { country = U02 } } type = event which = 100001 where = U02 when = 0 }
                command = { trigger = { not = { country = VIC } } type = event which = 100001 where = VIC when = 0 }
                command = { trigger = { not = { country = U05 } } type = event which = 100001 where = U05 when = 0 }
                command = { type = local_setflag which = 100001 } # If you want to keep track if this event fired or not for this country, optional.
	}

        action = {
                trigger = {
                      flag = 100001
                }
		command = { type = relation which = GER value = 5 }
                command = { type = local_setflag which = 100001 } # If you want to keep track if this event fired or not for this country, optional.
        }
}

Although why you would be writing such a complicated event for just setting relations is beyond me. Why not have 1 event that modifies the relations with the list of countries fired BY Germany?
You shouldn't even need a generic event for this.
 
Last edited:
The content of the event does not matter it was an example.

Anyway I got around to testing this. I tried it earlier before without apparent success, and it didn't seem to work now either.
Then I had an idea and checked the autosave. Set flags tell me the countries in question do get the event, but the game does not tell you about it.
It simply does not show up in the log, but that is not always ideal either.
 
Last edited: