• 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(448336)

First Lieutenant
6 Badges
Feb 11, 2012
216
0
  • Crusader Kings II
  • For the Motherland
  • Hearts of Iron III
  • Semper Fi
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
I've played through the demo a few times already, but there's only so many times that one can play the same twenty years... So to deal with the waiting, I decided to start writing up a series of events that's been rattling about in my head for a few years. Or at least as many of them as I can get to notepad before the full game comes out :) .

These look correct to me (though I already had to correct a few careless mistakes in them), but since I can't trigger them by console in the demo, I can't really test them the way that I'd wish. So instead, I thought I'd ask the forum. Of course, the paradox forums aren't my private beta-testers, so there will be no hard feelings if people aren't interested in proofreading my code for me :) .

The code below should do the following:

1. Over roughly 100 years (accounting for trait-related modifiers), it should create a character with the "mysterious stranger" trait in the court of ruler receiving the event, who will have no traits, but be young and of good health. This character will start with two flags dictating his or her goals and tone. She or he will then have a secondary goal set in an event triggered for the character.

2. On character creation, it will trigger an event informing the rest of the world that something has happened.

3. This will begin an event-driven negotiation between the ruler and this character. The ruler can either accept the terms, reject them, imprison the character, or contest any of the three more objectionable clauses. The character is unlikely to agree to changes, but if they do, the ruler can press for one of the others; else, the only remaining options are to accept or refuse the final agreement.

4. If the terms are refused, the stranger leaves to another, more reasonable court.

5. If the ruler attempts imprison the character, the ruler dies and the character moves to a different court.

6. More happens later, but I haven't coded that far yet :) .

A few changes I would like to make:

1. I'd prefer not to make a second event to trigger the additional goal, but I only thought of using multiple random_lists after I wrote up that excessively sized one. I don't think I've seen multiple lists used in other events, however; it doesn't seem like it should be an issue, but do multiple random_lists cause any unexpected problems? What about setting a random_list inside of a random_list? Likewise, I should be able to random_list inside of create_character without trouble, right? If so, I'll set up two random_lists to seperate out tone and goal, and set a third random_list inside the goal list (to ensure that the character doesn't end up with the same goal twice).

2. On the topic of lists, is it possible to weight the outcome of a random_list according to various factors? At the very least, I'd like to make it more likely that the ruler can negotiate more favorable conditions with a higher diplomacy rating.

3. On the issue of style, is there a more efficient way to structure the code? A way to make it more legible, perhaps? It's already making my eyes wish to avoid focusing on any given line...

4. Is it possible to tie an increase in defense against assassinations and plots to the mysterious_stranger trait instead of giving her a very high intrigue stat? It would cause severe issues if the character were to die too early, but a high intrigue stat creates problems of it's own.

5. Is there a way to direct the character towards an appropriate court should the offer be refused? Banish removes her from the starting court, but examining other events it's used in seems to suggest it's a rather blunt tool. It's assumed that the character receiving the event is unlikely to refuse, so it's not a big issue, but... Well, it could cause some strange results all the same.

A few parts that I'm not certain I used properly:

1. Will it be roughly a hundred years before the first event fires? I went a bit heavy on the modifiers to ensure that it would go to an "appropriate" character, so I increased the mtth to compensate, but I'm not entirely certain how common ambitious, decietful, leper counts actually are in the game, regardless of how often they seem to appear as my vassals.

2. I do want to be using narrative_event for this, right? It's a major event that's structured similarly to the questing segments of King Arthur, so it seems like it should be appropriate, based on the pictures I've seen of what I assume are narrative events, and recalling the description of what I assume were narrative events in previous dev diaries, but... It's possible I've made a completely inaccurate assumption as to what the proper use of the narrative_event scope is meant to be used for, and that my assumptions are completely inaccurate.

3. Do demense_flags actually exist? I could have sworn they existed when I wrote the event, but searching the rest of the files seems to suggest that the only place they existed were in my head. It wouldn't be too troublesome to switch them to global_flags instead (avoiding character_flags as the heir is also bound to these terms, though given the option to renegotiate them), but I dislike using global scopes for local problems.

4. Did I make any glaringly obvious errors, like forgetting to include the id number on an event? It's been forever and a half since I was doing something like this myself.

5. Silly question, but how exactly do I look at the pictures for events outside of the game itself? I don't seem to have a program suited to opening them... But that doesn't mean much more than me having glanced at the folder and saying "Oh, I don't have that file type affiliated to a program".

I ~think~ that should cover all of my concerns involving this code, and describe well enough what it's intended to accomplish. My thanks to anyone who looks over this :) .

Code:
narrative_event = {
	id = 900000				#Create stranger; remember to set extreme and moderate agenda variants
	desc = "EVTDESC900000"
	picture = (identify later)

	min_age = 16
	only_rulers = yes
	capable_only = yes
	prisoner = no

	NOT = { 
		tier = baron
		tier = king
	}
	NOT = {
		trait = stresed
		trait = depressed
		trait = lunatic
		trait = possessed
		trait = syphilitic
		trait = wounded
		trait = maimed
		trait = infirm
		trait = incapable
		trait = drunkard
		trait = bastard
		trait = twin
		trait = excommunicated
		trait = inbred
		trait = content
	}
	NOT = {
		has_global_flag = mysterious_stranger_arrived
	}

	mean_time_to_happen = {
		months = 1800
	
		modifier = {
			factor = 0.9
			trait = kind
		}
		modifier = {
			factor = 1.1
			trait = just
		}
		modifier = {
			factor = 0.8
			trait = leper
		}
		modifier = {
			factor = 0.9
			trait = has_tuberculosis
		}
		modifier = {
			factor = 0.9
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 0.9
			trait = has_typhus
		}
		modifier = {
			factor = 0.9
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 0.9
			trait = has_measles
		}
		modifier = {
			factor = 0.9
			trait = has_small_pox
		}
		modifier = {
			factor = 0.8
			trait = kinslayer
		}
		modifier = {
			factor = 0.9
			trait = fair
		}
		modifier = {
			factor = 1.1
			trait = ugly
		}
		modifier = {
			factor = 0.8
			trait = genius
		}
		modifier = {
			factor = 0.9
			trait = quick
		}
		modifier = {
			factor = 1.1
			trait = slow
		}
		modifier = {
			factor = 1.2
			trait = imbicile
		}
		modifier = {
			factor = 1.1
			trait = strong
		}
		modifier = {
			factor = 0.9
			trait = weak
		}
		modifier = {
			factor = 0.8
			trait = celibate
		}
		modifier = {
			factor = 0.95
			trait = homosexual
		}
		modifier = {
			factor = 1.1
			trait = hedonist
		}
		modifier = {
			factor = 0.8
			trait = scholar
		}
		modifier = {
			factor = 1.1
			trait = impaler
		}
		modifier = {
			factor = 1.1
			trait = duelist
		}
		modifier = {
			factor = 1.2
			trait = hunter
		}
		modifier = {
			factor = 1.2
			trait = lustful
		}
		modifier = {
			factor = 0.9
			trait = chaste
		}
		modifier = {
			factor = 0.9
			trait = temperate
		}
		modifier = {
			factor = 0.8
			trait = greedy
		}
		modifier = {
			factor = 1.2
			trait = charitable
		}
		modifier = {
			factor = 1.5
			trait = slothful
		}
		modifier = {
			factor = 0.9
			trait = envious
		}
		modifier = {
			factor = 1.5
			trait = kind
		}
		modifier = {
			factor = 1.5
			trait = patient
		}
		modifier = {
			factor = 0.8
			trait = proud
		}
		modifier = {
			factor = 1.5
			trait = humble
		}
		modifier = {
			factor = 0.8
			trait = deceitful
		}
		modifier = {
			factor = 2
			trait = honest
		}
		modifier = {
			factor = 0.8
			trait = brave
		}
		modifier = {
			factor = 2
			trait = shy
		}
		modifier = {
			factor = 0.5
			trait = ambitious
		}
		modifier = {
			factor = 0.7
			trait = arbitrary
		}
		modifier = {
			factor = 2
			trait = just
		}
		modifier = {
			factor = 0.8
			trait = cynical
		}
		modifier = {
			factor = 0.8
			trait = zealous
		}
		modifier = {
			factor = 0.8
			trait = trusting
		}
	}

	option = {
		name = "EVTDESC900000"
		set_global_flag = mysterious_stranger_arrived
		any_ruler = {
			character_event = {
				id = 900005
			}
		}
		random_list = {
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_w_moderate
					set_character_flag = secretly_kind
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}

				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_w_moderate
					set_character_flag = secretly_detached
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_w_moderate
					set_character_flag = secretly_monstrous
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_x_moderate
					set_character_flag = secretly_kind
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_x_moderate
					set_character_flag = secretly_detached
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_x_moderate
					set_character_flag = secretly_monstrous
					age = 20
					health = 10
					trait = mysterious_stranger
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_y_moderate
					set_character_flag = secretly_kind
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_y_moderate
					set_character_flag = secretly_detached
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_y_moderate
					set_character_flag = secretly_monstrous
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_z_moderate
					set_character_flag = secretly_kind
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_z_moderate
					set_character_flag = secretly_detached
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_z_moderate
					set_character_flag = secretly_monstrous
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_w_extreme
					set_character_flag = secretly_kind
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}

				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_w_extreme
					set_character_flag = secretly_detached
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_w_extreme
					set_character_flag = secretly_monstrous
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_x_extreme
					set_character_flag = secretly_kind
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_x_extreme
					set_character_flag = secretly_detached
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_x_extreme
					set_character_flag = secretly_monstrous
					age = 20
					health = 10
					trait = mysterious_stranger
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_y_extreme
					set_character_flag = secretly_kind
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_y_extreme
					set_character_flag = secretly_detached
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_y_extreme
					set_character_flag = secretly_monstrous
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_z_extreme
					set_character_flag = secretly_kind
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_z_extreme
					set_character_flag = secretly_detached
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					set_character_flag = has_agenda_z_extreme
					set_character_flag = secretly_monstrous
					age = 20
					health = 10
					trait = mysterious_stranger
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					random_courtier = {
						limit = {
							has_trait = mysterious_stranger
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			narrative_event = {
				id = 900006
			}
		}
	}
}

character_event = {
	id = 900001				#Setting subagenda, learn if it can be consolidated under 900000
	desc = "EVTDESC900001"
	picture = (decide later)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA90001"
		trigger = {
			OR = {	
				has_character_flag = has_agenda_w_moderate
				has_character_flag = has_agenda_w_extreme
			}		
		}
		random_list = {
			33 = {
				set_character_flag = bonus_agenda_x
			}
			33 = {
				set_character_flag = bonus_agenda_y
			}
			33 = {
				set_character_flag = bonus_agenda_z
			}
		}
	}
	option = {
		name = "EVTOPTA90001"
		trigger = {
			OR = {
				has_character_flag = has_agenda_x_moderate
				has_character_flag = has_agenda_x_extreme
			}
		}
		random_list = {
			33 = {
				set_character_flag = bonus_agenda_w
			}
			33 = {
				set_character_flag = bonus_agenda_y
			}
			33 = {
				set_character_flag = bonus_agenda_z
			}
		}
	}
	option = {
		name = "EVTOPTA90001"
		trigger = {
			OR = {
				has_character_flag = has_agenda_y_moderate
				has_character_flag = has_agenda_y_extreme
			}		
		}
		random_list = {
			33 = {
				set_character_flag = bonus_agenda_w
			}
			33 = {
				set_character_flag = bonus_agenda_x
			}
			33 = {
				set_character_flag = bonus_agenda_z
			}
		}
	}
	option = {
		name = "EVTOPTA90001"
		trigger = {
			OR = {
				has_character_flag = has_agenda_z_moderate
				has_character_flag = has_agenda_z_extreme
			}
		}
		random_list = {
			33 = {
				set_character_flag = bonus_agenda_w
			}
			33 = {
				set_character_flag = bonus_agenda_x
			}
			33 = {
				set_character_flag = bonus_agenda_y
			}
		}
	}
}

character_event = {
	id = 900005		#Warn the other rulers
	desc = "EVTDESC900005"
	picture = (decide later)

	is_triggered_only = yes

	option = {
		name = "EVTOPT900005"
	}
}

narrative_event = {
	id = 900006				#Terms of association established, accept, contest demands, reject, or imprison.
	desc = "EVTDESC900006"
	picture = (decide later)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA900006"
		ai_chance = {
			factor = 22
		}
		set_character_flag = mysterious_stranger_negotiations
		set_demense_flag = secret_technology
		set_demense_flag = daughter_apprenticed
		set_demense_flag = autonomy_approved
		narrative_event = {
			id = 900007
		}
	}
	option = {
		name = "EVTOPTB900006"
		ai_chance = {
			factor = 22
		}
		set_character_flag = mysterious_stranger_negotiations
		set_demense_flag = secret_technology
		set_demense_flag = daughter_apprenticed
		random_list = {
			75 = {
				set_demense_flag = autonomy_approved
				narrative_event = {
					id = 900008
				}
			}
			25 = {
				narrative_event = {
					id = 900009
				}
			}
		}
	}
	option = {
		name = "EVTOPTC900006"
		ai_chance = {
			modifier = 22
		}
		set_character_flag = mysterious_stranger_negotiations
		set_demense_flag = secret_technology
		set_demense_flag = autonomy_approved
		random_list = {
			50 = {
				set_demense_flag = daughter_apprenticed
				narrative_event = {
					id = 900008
				}
			}
			50 = {

				narrative_event = {
					id = 900010
				}
			}
		}
	}
	option = {
		name = "EVTOPTD900006"
		ai_chance = {
			modifier = 22
		}
		set_character_flag = mysterious_stranger_negotiations
		set_demense_flag = daughter_apprenticed
		set_demense_flag = autonomy_approved
		random_list = {
			75 = {
				set_demense_flag = secret_technology
				narrative_event = {
					id = 900008
				}
			25 = {
				narrative_event = {
					id = 900011
				}
			}
		}
	}
	option = {
		name = "EVTOPTE900006"
		ai_chance = {
			modifier = 6
		}
		any_courtier = {
			LIMIT = {
				has_trait = mysterious_stranger
			}
			banish = yes
		}
		narrative_event = {
			id = 900013
		}
	}
	option = {
		name = "EVTOPTF900007"
		ai_chance = {
			modifier = 6
		}
		narrative_event = {
			id = 900012
		}
	}
	
}

narrative_event = {				#Finalizes negotations
	id = 900007
	desc = "EVTDESC90007"
	picture = (decide later)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA900007"
	}
}

narrative_event = {
	id = 900008				#Negotiations break down, accept current arrangements or no deal.
	desc = "EVTDESC900008"
	picture = (decide later)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA900008"
		ai_chance = {
			factor = 75
		}
		narrative_event = {
			id = 900007
		}
	}
	option = {
		name = "EVTOPTB900008"
		ai_chance = {
			factor = 12
		clr_character_flag = mysterious_stranger_negotiations
		clr_demense_flag = secret_technology
		clr_demense_flag = daughter_apprenticed
		clr_demense_flag = autonomy_approved
		any_courtier = {
			LIMIT = {
				has_trait = mysterious_stranger
			}
			banish = yes
		}
		narrative_event = {
			id = 900013
		}
	}
	option = {
		name = "EVTOPTC900008"
		clr_character_flag = mysterious_stranger_negotiations
		clr_demense_flag = secret_technology
		clr_demense_flag = daughter_apprenticed
		clr_demense_flag = autonomy_approved
		narrative_event = {
			id = 900012
		}
	}
}

narrative_event = {
	id = 900009				#Negotiations continue, autonomy_approved rejected.
	desc = "EVTDESC900009"
	picture = (decide later)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA900009"
		ai_chance = {
			factor = 50
		}
		narrative_event = {
			id = 900007
		}
	}
	option = {
		name = "EVTOPTC900009"
		trigger = {
			has_demense_flag = daughter_apprenticed
		}
		ai_chance = {
			modifier = 22
		}
		random_list = {
			75 = {
				narrative_event = {
					id = 900008
				}
			}
			25 = {
				clr_demense_flag = daughter_apprenticed
				narrative_event = {
					id = 900010
				}
			}
		}
	}
	option = {
		name = "EVTOPTD900009"
		trigger = {
			has_demense_flag = secret_technology
		}
		ai_chance = {
			modifier = 22
		}
		random_list = {
			90 = {
				narrative_event = {
					id = 900008
				}
			10 = {
				clr_demense_flag = secret_technology
				narrative_event = {
					id = 900011
				}
			}
		}
	}
	option = {
		name = "EVTOPTE9000009"
		ai_chance = {
			modifier = 6
		}
		narrative_event = {
			id = 900008
		}
	}
	
}

narrative_event = {
	id = 900010				#Negotiations continue, daughter_apprenticed rejected.
	desc = "EVTDESC900010"
	picture = (decide later)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA900010"
		ai_chance = {
			factor = 50
		}
		narrative_event = {
			id = 900007
		}
	}
	option = {
		name = "EVTOPTC900010"
		trigger = {
			has_demense_flag = autonomy_approved
		}
		ai_chance = {
			modifier = 22
		}
		random_list = {
			90 = {
				narrative_event = {
					id = 900008
				}
			}
			10 = {
				clr_demense_flag = autonomy_approved
				narrative_event = {
					id = 900010
				}
			}
		}
	}
	option = {
		name = "EVTOPTD900010"
		trigger = {
			has_demense_flag = secret_technology
		}
		ai_chance = {
			modifier = 22
		}
		random_list = {
			90 = {
				narrative_event = {
					id = 900008
				}
			10 = {
				clr_demense_flag = secret_technology
				narrative_event = {
					id = 900011
				}
			}
		}
	}
	option = {
		name = "EVTOPTE900010"
		ai_chance = {
			modifier = 6
		}
		narrative_event = {
			id = 900008
		}
	}
	
}

narrative_event = {
	id = 900011				#Negotiations continue, secret_technology rejected.
	desc = "EVTDESC900011"
	picture = (decide later)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA900011"
		ai_chance = {
			factor = 50
		}
		narrative_event = {
			id = 900007
		}
	}
	option = {
		name = "EVTOPTC900011"
		trigger = {
			has_demense_flag = autonomy_approved
		}
		ai_chance = {
			modifier = 22
		}
		random_list = {
			90 = {
				narrative_event = {
					id = 900008
				}
			}
			10 = {
				clr_demense_flag = autonomy_approved
				narrative_event = {
					id = 900010
				}
			}
		}
	}
	option = {
		name = "EVTOPTD900011"
		trigger = {
			has_demense_flag = daughter_apprenticed
		}
		ai_chance = {
			modifier = 22
		}
		random_list = {
			75 = {
				narrative_event = {
					id = 900008
				}
			25 = {
				clr_demense_flag = daughter_apprenticed
				narrative_event = {
					id = 900011
				}
			}
		}
	}
	option = {
		name = "EVTOPTE900011"
		ai_chance = {
			modifier = 6
		}
		narrative_event = {
			id = 900008
		}
	}
	
}

narrative_event = {
	id = 900012				#Imprisonment failed, ruler dead and stranger escaped #Should more die?
	desc = "EVTDESC900012"
	picture = (determine later)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA900012"
		death = yes
		clr_character_flag = mysterious_stranger_negotiations
		clr_demense_flag = secret_technology
		clr_demense_flag = daughter_apprenticed
		clr_demense_flag = autonomy_approved
		any_courtier = {
			LIMIT = {
				has_trait = mysterious_stranger
			}
			banish = yes
		}
	}
}

narrative_event = {
	id = 900013				#Stranger leaves, but the offer remains ominous.
	picture = (determine later, but preferably someone looking troubled-ly at someone walking away. I remember seeing something like that, right?)

	is_triggered_only = yes

	option = {
		name = "EVTOPTA900013"
	}
}

Ah, and while I'm asking questions, when it comes to laws, setting an event to trigger on law changes is as simple as

Code:
		effect = {
			any_vassal = {
				character_event = {
					id = 900100
				}
			}
		}

right?
 
I may be mistaken, because I don't know the order in which the conditions are applied, but it seems to me that in your case the game will first search for a suitable ruler, and then wait for 150 years. And when the ruler dies before the event is fired (which I thing is very likely :) ), the mtth resets for a new ruler.
Moreover, as I know, mtth is not a determined date, it is a probability of that event happening. Mtth of 1800 means that event has 1/1800 chance to fire each month. So, if you have 150 rulers which are over 16, not depressed, stressed etc., and if the mtth is calculated for each one separately, and you are likely to see the event firing in 18 months :)

It may still be that I simply don't know the scripting language enough, and my remark is worthless, but if I were making such event, I would set the "year=1166" condition, and then test different mtth clauses.
 
You must put this part inside trigger = {}:

Code:
NOT = { 
		tier = baron
		tier = king
	}
	NOT = {
		trait = stresed
		trait = depressed
		trait = lunatic
		trait = possessed
		trait = syphilitic
		trait = wounded
		trait = maimed
		trait = infirm
		trait = incapable
		trait = drunkard
		trait = bastard
		trait = twin
		trait = excommunicated
		trait = inbred
		trait = content
	}
	NOT = {
		has_global_flag = mysterious_stranger_arrived
	}

It should look like this:
Code:
trigger = {
	NOT = { 
		tier = baron
		tier = king
	}
	NOT = {
		trait = stresed
		trait = depressed
		trait = lunatic
		trait = possessed
		trait = syphilitic
		trait = wounded
		trait = maimed
		trait = infirm
		trait = incapable
		trait = drunkard
		trait = bastard
		trait = twin
		trait = excommunicated
		trait = inbred
		trait = content
	}
	NOT = {
		has_global_flag = mysterious_stranger_arrived
	}
}

trait = mysterious_stranger won't work as it's not a trait in the game, use something else or set a flag with that name. You cannot create a character with flags, instead you can use new_character which will change the scope to the newly created character and set the flags there and you can use it to send a new event to the character as well.

This is how it could look like:
Code:
			4 = {
				create_character = {
					random_traits = no
					dynasty = (tbd)
					age = 20
					health = 10
					attributes = {
						intrigue = 25
					}
				}
				hidden_tooltip = {
					new_character = {
						set_character_flag = mysterious_stranger
						set_character_flag = has_agenda_z_extreme
						set_character_flag = secretly_monstrous
							character_event = {
								id = 900001
							}
						}
					}
				}				
			}
			narrative_event = {
				id = 900006
			}

Not quite sure what you want this to do:
Code:
ai_chance = {
			factor = 12
		clr_character_flag = mysterious_stranger_negotiations
		clr_demense_flag = secret_technology
		clr_demense_flag = daughter_apprenticed
		clr_demense_flag = autonomy_approved
If you want to clear the flags, just remove "ai_chance = { factor = 12" or close it with a }.

Code:
ai_chance = {
			factor = 12
		}

This is not correct, it should be "factor" instead of "modifier":
Code:
ai_chance = {
			modifier = 22
		}
Or:
Code:
ai_chance = {
			factor = 1
			modifier = {
				factor = 10
				wealth = -100
			}
		}

has_demense_flag is not correct, it should be has_province_flag but that only works in province scopes and you use narrative_event. You can either do a scope change or you use character_flag instead. Narrative events are character events, you can write longer event descriptions than in character events but for triggers and effects they are the same. An example of scope change:
random_demesne_province = { set_province_flag = NAME }

Just read through your events real quick, might be that I have forgotten something. Looks like an interesting event chain though, good luck!
 
Last edited:
:eek:hmy: ! I hadn't expected a developer to answer my questions, thank you very much for your help :D !

I had been planning on making a new trait called "mysterious stranger" to apply to this character, adding it to the traits list. I had chosen that approach to make it easier for this player to identify this character over the course of the event chain, but it isn't that important if that isn't possible (I haven't tried it yet, but your response suggests it isn't).

Thank you for the other corrections, I've gone ahead and applied them :) .

It's not really that interesting a chain, though; it's just a silly little thing where a radical from the future tries to change the past, in hopes that it might bring the future more in line with his desires. If it works as intended, it should play out similarly to the mongolian invasion; the duke working with this character will build an empire, with the help of several reforms and sudden advancements, then collapse terribly once the character dies and the reforms start to fall apart and/or be rolled back. It will be fun to write, but I can't imagine it being as fun to play as the regular game :) .
 
Last edited:
Great post from SolSara!
A big thank you for taking your time and helping Mallorie and others modders (including newbies like myself) better understand how to go about this.

@Mallorie: it is possible to add traits, yes - if you check out some of the other new threads, you'll find more on this - as for instance here.

Good luck with the mod and feel free to keep updating your experiments, we can always learn from others' works and ideas!