I suppose that many people already know this kind of methods to create "dynastic ties", but I put it in case it may be useful to someone. This script is used to join two factions together through marriage of the heir (or leader) with the Princess. When the years pass and die the leader of the other faction, you'll inherit all domains.
In this example, it will join the Sicily (AI) faction with France (local faction). The first thing to do, is go with the diplomat directly to the Princess to establish diplomatic relations and provide the marriage.
First, you must created a hidden trait for princesses, to be able to recognize them in the script. In this example, for Sicily.
Add this to "...\data\export_descr_character_traits.txt"
Code:
;------------------------------------------
Trait PrincessSicily
Characters princess
Hidden
Level Princess_Sicily
Description Princess_Sicily_desc
EffectsDescription Princess_Sicily_effects_desc
Threshold 1
Effect PersonalSecurity 1
;------------------------------------------
Code:
;------------------------------------------
Trigger princess_of_sicily
WhenToTest CharacterComesOfAge
Condition AgentType = princess
and FactionType sicily
Affects PrincessSicily 1 Chance 100
;------------------------------------------
Add the trait to Princess in "...\data\world\maps\campaign\imperial_campaign\descr_strat.txt"
Code:
character Matilda, princess, female, age 17, x 159, y 83
traits IAmPrincess 1 , PrincessSicily 1 , NaturalPrincess 2 , GoodPrincess 1
Add this to "...\data\world\maps\campaign\imperial_campaign\campaign_script.txt"
Code:
declare_counter ties_fra_sic
declare_counter union_fra_sic
monitor_event CharacterMarriesPrincess FactionType france
and Trait Factionleader = 1
and SpouseTrait PrincessSicily = 1
and I_LocalFaction france
set_counter ties_fra_sic 1
terminate_monitor
end_monitor
monitor_event CharacterMarriesPrincess FactionType france
and Trait Factionheir = 1
and SpouseTrait PrincessSicily = 1
and I_LocalFaction france
set_counter ties_fra_sic 1
terminate_monitor
end_monitor
monitor_event InterFactionMarriage FactionType sicily
and I_CompareCounter ties_fra_sic = 1
and I_LocalFaction france
set_counter union_fra_sic 1
terminate_monitor
end_monitor
monitor_event CeasedFactionLeader FactionType sicily
and I_FactionLeaderAttribute sicily Command < 5
and I_SettlementOwner Naples = sicily
and I_SettlementOwner Paris = france
and I_CompareCounter union_fra_sic = 1
and I_LocalFaction france
historic_event france_sicily true factions { france, }
terminate_monitor
end_monitor
monitor_event EventCounter EventCounterType france_sicily_accepted
and I_EventCounter france_sicily_accepted = 1
give_everything_to_faction sicily france false
historic_event sicily_crown
terminate_monitor
end_monitor
In the first two events, it detects if our character has married a Princess and who has been exactly. The third event detects that a marriage has occured between two factions. Indicating the other faction. In this case, Sicily.
Once has given the value of 1 to the counter of "union", adds an event that will trigger the message with question. The conditions are to personal taste, I put these as an example; Once dead the leader of the other faction. Once answered the question, if so, the "give_everything_to_faction" command is used to unite Sicily to the kingdom of France.
Add event descriptions in "...\data\text\historic_events.txt"
Code:
{FRANCE_SICILY_BODY}The King of Sicily has died, and his successor doesn't have the support of much of the nobility. Since your Royal family has the same family relationships that the Kingdom of Sicily, you can claim your legitimate right to the throne in the Sicilian Court.\n\nDo you want to claim your dynastic rights to the Crown?
{FRANCE_SICILY_TITLE}Union of France with Sicily
{SICILY_CROWN_BODY}The Kingdom of France and the Kingdom of Sicily are joined forming a single Crown, under the command of the French King.
{SICILY_CROWN_TITLE}The Kingdom of France and Sicily
If you want to change the coat of arms and banners you can add this command:
Code:
set_faction_banner
faction france
banner FACTION
end_set_faction_banner
To add the image to the message, you need a TGA file with the name of the event in the "eventpics" folder. Example for this case: "...\data\ui\northern_european\eventpics\sicily_crown.tga"
Sample photos of the script:
I hope to be useful for you. Best regards.