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

unmerged(287474)

Captain
2 Badges
Mar 19, 2011
389
0
  • Crusader Kings II
  • Victoria 2: A House Divided
I have a lot of events I mod in the game and they are stacking up and sometimes I really don't have anything meaningful to say.

All the events I'm using right now are character_event's.

I know how to hide a tooltip, but I want to do that to the whole event, for it to fire, do its thing, don't notify the player.

If player must be notified, then at least I'd like to limit it to just one of those top-right corner notifications that don't stop the game.

Any help is much appreciated!
 

unmerged(287474)

Captain
2 Badges
Mar 19, 2011
389
0
  • Crusader Kings II
  • Victoria 2: A House Divided
In the mean time I'm going to try to find a way to fire an event off on a player character without having the player notified.

Maybe something like:


Code:
# test
character_event = {
	id = 987011
	desc = "HOKIDESC0021"
	picture = GFX_evt_emissary
	
	is_triggered_only = yes
	
	trigger = {
		#actual conditions here,
		#condition
		#condition
		#followed by filtering out the players, but targetting their spouse
		OR = {
			ai = yes
			spouse = { 
				AND = {
					ai = no
					#annoying duplication of conditions just for targeting the player
					#condition
					#condition
				}
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1000
	}
	
	option = {
		name = "HOKIDESC0022"
		
		if = {
			limit = {
				AND = {
					ai = yes
					spouse = { ai = no }
				}
			}
		
			spouse = {
				#do silent player related modifications and other things
			}
		}
		
		if = {
			limit = {
				AND = {
					ai = yes
					NOT = { spouse = { ai = no } }
				}
			}

			#do the same thing but to non-player characters
		}
	}
}


Ok I just tested this method out and it works. (added a test trait to my character if he didn't have it already)
Though it still has the problem where your trigger conditions are duplicated for the player's spouse, and ditto for targetting based on the player's spouse instead of the player character itself, and it relies on you having a spouse, or some other obvious one-to-one relationship to the player.
Perhaps you could use the player character's mother, even if shes dead. I'll have to try that out.

But its still annoying. If anyon knows how to do a silent event by default please reply.
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
I've been poking around for a way to do this too. Best solution I've found is to just fire it for an AI vassal/courtier and target ai = no liege.
 

Meneth

Crusader Kings 3 Programmer
153 Badges
Feb 9, 2011
10.056
5.378
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Hearts of Iron IV: Expansion Pass
  • Steel Division: Normand 44 Sign-up
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Way of Life
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: El Dorado
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Surviving Mars: Digital Deluxe Edition
  • BATTLETECH: Flashpoint
  • Crusader Kings II: Conclave
  • Surviving Mars
  • Cities: Skylines Industries
  • Stellaris: Galaxy Edition
  • BATTLETECH
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Humanoids Species Pack
  • Prison Architect
  • Crusader Kings II: The Old Gods
  • Cities: Skylines - Campus
  • Hearts of Iron IV: No Step Back
  • BATTLETECH - Digital Deluxe Edition
  • Crusader Kings Complete
  • Cities: Skylines - Parklife
  • Europa Universalis IV
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cradle of Civilization
  • 500k Club
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis III Complete
  • Cities: Skylines - Mass Transit
  • Europa Universalis III Complete
  • Cities: Skylines - Green Cities
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Rule Britannia
Hi Wiz,
could you elaborate on this?
I'm trying to understand how this would work...

Thanks in advance!
As a condition you'd do something like this:
Code:
trigger = {
[INDENT]AND = {
[/INDENT]
[INDENT=2]ai = yes
liege = {[/INDENT]
[INDENT=3]ai = no[/INDENT]
[INDENT=2]}
# Any other relevant conditions[/INDENT]
[INDENT]}[/INDENT]
}
option = {
[INDENT]if = {[/INDENT]
[INDENT=2]limit = {[/INDENT]
[INDENT=3]AND = {[/INDENT]
[INDENT=4]ai = yes
liege = {[/INDENT]
[INDENT=5]ai = no[/INDENT]
[INDENT=4]}[/INDENT]
[INDENT=3]}[/INDENT]
[INDENT=2]}
liege = {[/INDENT]
[INDENT=3]#apply whatever you want to happen[/INDENT]
[INDENT=2]}[/INDENT]
[INDENT]}[/INDENT]
}
The advantage over your method is that this works even if the player has no spouse.
 

unmerged(287474)

Captain
2 Badges
Mar 19, 2011
389
0
  • Crusader Kings II
  • Victoria 2: A House Divided
As a condition you'd do something like this:
Code:
trigger = {
[INDENT]AND = {
[/INDENT]
[INDENT=2]ai = yes
liege = {[/INDENT]
[INDENT=3]ai = no[/INDENT]
[INDENT=2]}
# Any other relevant conditions[/INDENT]
[INDENT]}[/INDENT]
}
option = {
[INDENT]if = {[/INDENT]
[INDENT=2]limit = {[/INDENT]
[INDENT=3]AND = {[/INDENT]
[INDENT=4]ai = yes
liege = {[/INDENT]
[INDENT=5]ai = no[/INDENT]
[INDENT=4]}[/INDENT]
[INDENT=3]}[/INDENT]
[INDENT=2]}
liege = {[/INDENT]
[INDENT=3]#apply whatever you want to happen[/INDENT]
[INDENT=2]}[/INDENT]
[INDENT]}[/INDENT]
}
The advantage over your method is that this works even if the player has no spouse.

With this are there issues with multiple event actions?
That is, for each vassal of the player, would this execute an action on the player that many times?
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
With this are there issues with multiple event actions?
That is, for each vassal of the player, would this execute an action on the player that many times?

Use flags to ensure it only fires once (or however often you want it to fire).
 

unmerged(287474)

Captain
2 Badges
Mar 19, 2011
389
0
  • Crusader Kings II
  • Victoria 2: A House Divided
NOt sure how to use flags. If they are inferred like javascript, undeclaredVariable = 1, would they be scoped to the event, or would they be global scope?

Lets say you only want to do something to the player character once per event but the event can happen to it many times.
 

Meneth

Crusader Kings 3 Programmer
153 Badges
Feb 9, 2011
10.056
5.378
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Hearts of Iron IV: Expansion Pass
  • Steel Division: Normand 44 Sign-up
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Way of Life
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: El Dorado
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Surviving Mars: Digital Deluxe Edition
  • BATTLETECH: Flashpoint
  • Crusader Kings II: Conclave
  • Surviving Mars
  • Cities: Skylines Industries
  • Stellaris: Galaxy Edition
  • BATTLETECH
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Humanoids Species Pack
  • Prison Architect
  • Crusader Kings II: The Old Gods
  • Cities: Skylines - Campus
  • Hearts of Iron IV: No Step Back
  • BATTLETECH - Digital Deluxe Edition
  • Crusader Kings Complete
  • Cities: Skylines - Parklife
  • Europa Universalis IV
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cradle of Civilization
  • 500k Club
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis III Complete
  • Cities: Skylines - Mass Transit
  • Europa Universalis III Complete
  • Cities: Skylines - Green Cities
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Rule Britannia
NOt sure how to use flags. If they are inferred like javascript, undeclaredVariable = 1, would they be scoped to the event, or would they be global scope?

Lets say you only want to do something to the player character once per event but the event can happen to it many times.
Flags can apply to various different things. In this case you'd usually want is a character-flag. The relevant commands/conditions are:
set_character_flag, clr_character_flag, has_character_flag, had_character_flag
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
There are also global flags if you want a thing to only fire once in the game, instead of for each ruler.

For instance:

trigger = {
NOT = { has_global_flag = fire_once }
}

option = {
set_global_flag = fire_once
}

An event setup like that will only fire once in any single game.
 

unmerged(287474)

Captain
2 Badges
Mar 19, 2011
389
0
  • Crusader Kings II
  • Victoria 2: A House Divided
Yes but what about flags for an event scope? Character flags and global flags don't cut it for that. Unless you rig some flag removal event.

Also I'm wondering can you change the scope of the target so that you don't need to duplicate actions for players and ai?
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
I'm really not following what you mean. You can set global flags inside any scope, and you can set character flags like:

liege = { set_character_flag = i_am_the_player }
 

unmerged(287474)

Captain
2 Badges
Mar 19, 2011
389
0
  • Crusader Kings II
  • Victoria 2: A House Divided
The idea to use a vassal to target the player through liege = { ai = no }, theoretically this would fire for every vassal.
How does a character flag help to prevent this per event, instead of one per character?
Adding a character flag adds the flag until you remove it. What if you only want to have a local flag, or a flag applied for only the duration of the event?
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
Set the flag on the ruler, check the flag on the ruler. You can clear a flag at the end of an event. I really don't understand what you think the limitation is, but trust me it's not there.
 

unmerged(287474)

Captain
2 Badges
Mar 19, 2011
389
0
  • Crusader Kings II
  • Victoria 2: A House Divided
How do you remove it at the end of an event? Does the event not fire for each character separately? As in, its a completely synchronous loop and it fires for everyone it effects at the same time, then moving down the code synchronously where you remove the flag?


Code:
trigger = {
			ai = yes
			liege = { ai = no }
	}
	
	mean_time_to_happen = {
		days = 1000
	}
	
	option = {
		name = "HOKIDESC0022"
		
		if = {
			limit = {
				AND = {
					ai = yes
					liege= { ai = no NOT = { has_character_flag = player_processed_for_this_event } }
				}
			}
		
			liege = {
				#do silent player related modifications and other things
                                set_character_flag = player_processed_for_this_event
			}
		}
		
		if = {
			limit = {
				AND = {
					ai = yes
					liege= { ai = no has_character_flag = player_processed_for_this_event }
				}
			}
		
			liege = {
                                clr_character_flag = player_processed_for_this_event
			}
		}
	}
}
This is guaranteed to fire once for the player no matter how many vassals it has?
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
Events fire randomly... the event engine is on a single thread and will only fire for one character at a time.