Create a submod for the AGOT mod in Crusader Kings 3. I want an event to appear in the later bookmarks for a king of House Targaryen after the ruins of Summerhall are restored, allowing for the decision to create and grant the title of Prince of Summerhall to the younger son/brother, similar to how it happens with Dragonstone when the heir comes of age.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Creating a submod for the A Game of Thrones (AGOT) mod in Crusader Kings 3 (CK3) involves scripting a custom event that allows a House Targaryen king to grant the title of Prince of Summerhall to a younger son or brother after the Ruins of Summerhall are restored. Below is a step-by-step guide, including the necessary code snippets, to help you achieve this.
1. Folder Structure
First, set up the appropriate folder structure for your submod:
Before creating the event, ensure that the title Prince of Summerhall exists. Create a titles_summerhall.txt file in the common/titles/ directory:
plaintext
# common/titles/titles_summerhall.txt
# Define the County
c_summerhall = {
color = { 0.7 0.3 0.3 }
# Define the Prince title
k_prince_of_summerhall = {
title = "Prince of Summerhall"
holder = YOUR_DEFAULT_HOLDER_HERE
}
}
Replace YOUR_DEFAULT_HOLDER_HERE with the appropriate default holder if necessary.
3. Creating the Event
Create an event file named targaryen_summerhall_events.txt in the events/ folder:
plaintext
# events/targaryen_summerhall_events.txt
namespace = targaryen_summerhall
# Event ID: targaryen_summerhall.1
event targaryen_summerhall.1 {
title = "Summerhall Restored"
desc = "The ruins of Summerhall have been restored to their former glory, providing a dignified seat for House Targaryen's younger members."
picture = GFX_evt_castle_rebuilt
is_triggered_only = yes
trigger = {
is_killed = no
ruler = {
dynasty = { is_house_targaryen = yes }
has_title = k_high_valyrian
# Replace with the actual title of the Targaryen king
}
# Check if Summerhall is restored
holder_of = c_summerhall
# Ensure the title is under Targaryen control
holder_of = {
title = c_summerhall
is_at_war = no
}
# Optional: Check for specific bookmark dates if necessary
}
option = {
name = "Grant the Title of Prince of Summerhall"
ai_chance = {
factor = 80
}
# Choose the appropriate character: a younger son or brother
hidden_effect = {
# Find the eligible character
set_variable = {
name = "eligible_member"
value = ROOT.owning_female_children_or_male_children_or_brother
# Implement logic to select the youngest son or brother
# This might require more specific scripting based on your mod's structure
}
if = {
limit = { var = eligible_member }
grant_title = {
title = k_prince_of_summerhall
target = var:eligible_member
}
}
# Optional: Add further effects or notifications
}
}
option = {
name = "Decline"
ai_chance = {
factor = 20
}
# No effect
}
}
Explanation of the Event Script:
Namespace: Helps avoid conflicts with other events.
Event ID: Unique identifier for the event.
Title & Description: What the player sees.
Picture: An appropriate image; you can choose one from existing game assets.
Trigger Conditions:
The ruler must belong to House Targaryen.
Summerhall must be restored and controlled by the Targaryens.
Additional conditions can be added based on specific bookmarks or dates.
Options:
Grant the Title: Selects an eligible younger son or brother and grants them the title.
Decline: No action is taken.
4. Localization
Create a localization file named targaryen_summerhall_events_l_english.yml in the localization/english/ folder:
yaml
# localization/english/targaryen_summerhall_events_l_english.yml
l_english:
targaryen_summerhall.1.title: "Summerhall Restored"
targaryen_summerhall.1.desc: "The ruins of Summerhall have been restored to their former glory, providing a dignified seat for House Targaryen's younger members."
targaryen_summerhall.1.a: "Grant the Title of Prince of Summerhall"
targaryen_summerhall.1.b: "Decline"
5. Implementing the Event Trigger
To ensure the event triggers at the right time (e.g., during later bookmarks), you might want to add specific date checks. Modify the trigger section in your event accordingly:
plaintext
trigger = {
is_killed = no
ruler = {
dynasty = { is_house_targaryen = yes }
has_title = k_high_valyrian
}
holder_of = c_summerhall
year > 1450 # Example year; adjust based on your mod's timeline
}
Replace year > 1450 with the appropriate in-game year corresponding to the later bookmarks in your mod.
6. Scheduling the Event
To have this event appear automatically after the restoration of Summerhall, you can create a state event or title event that triggers when the conditions are met. Alternatively, use a global trigger that periodically checks the conditions.
Here’s an example of scheduling the event using a global event:
plaintext
# events/targaryen_summerhall_events.txt (Add the following outside the event definition)
namespace = targaryen_summerhall
event targaryen_summerhall.schedule_event {
trigger = {
any_ruler = {
is_killed = no
dynasty = { is_house_targaryen = yes }
has_title = k_high_valyrian
holder_of = c_summerhall
year > 1450
}
}
immediate = {
create_event = targaryen_summerhall.1
}
}
# Create a trigger for the global event
on_game_start = {
create_listener = {
id = "targaryen_summerhall_listener"
days = 30
random_days = 30
trigger = {
targaryen_summerhall.schedule_event_trigger
}
on_trigger = {
targaryen_summerhall.schedule_event
}
}
}
This script sets up a scheduled check every 30 days to see if the event should trigger.
7. Final Steps
Test Your Mod:
Launch CK3 with your submod enabled.
Play as a House Targaryen ruler and ensure that after restoring Summerhall and meeting the conditions, the event triggers appropriately.
Adjust as Necessary:
Based on testing, you might need to tweak the triggers, conditions, or effects to better fit your mod's balance and narrative.
Packaging:
Ensure all files are correctly placed within the submod's folder structure.
Update the descriptor.mod file accordingly to include all paths and dependencies.
8. Example Complete Event File
Here’s the complete targaryen_summerhall_events.txt for clarity:
plaintext
# events/targaryen_summerhall_events.txt
namespace = targaryen_summerhall
# Event ID: targaryen_summerhall.1
event targaryen_summerhall.1 {
title = "Summerhall Restored"
desc = "The ruins of Summerhall have been restored to their former glory, providing a dignified seat for House Targaryen's younger members."
picture = GFX_evt_castle_rebuilt
is_triggered_only = no
trigger = {
is_killed = no
ruler = {
has_title = k_high_valyrian
dynasty = { is_house_targaryen = yes }
}
holder_of = c_summerhall
year > 1450
}
option = {
name = "Grant the Title of Prince of Summerhall"
ai_chance = {
factor = 80
}
hidden_effect = {
# Select the youngest eligible son
set_target = {
limit = {
has_eligible_prince = yes
}
set_variable = {
name = eligible_member
value = ROOT.children
where = {
age < 50 # Adjust age as needed
is_male = yes
is_alive = yes
not_in_any_realm = yes
}
}
}
# Grant the title
if = {
limit = { var = eligible_member }
grant_title = {
title = k_prince_of_summerhall
target = var:eligible_member
}
}
}
}
option = {
name = "Decline"
ai_chance = {
factor = 20
}
# No effect
}
}
# Global Event Listener to schedule the event
event targaryen_summerhall.schedule_event = {
trigger = {
any_ruler = {
is_killed = no
dynasty = { is_house_targaryen = yes }
has_title = k_high_valyrian
holder_of = c_summerhall
year > 1450
}
}
immediate = {
create_event = targaryen_summerhall.1
}
}
# Listener to periodically check conditions
on_game_start = {
create_listener = {
id = "targaryen_summerhall_listener"
days = 30
random_days = 30
trigger = {
any_ruler = {
is_killed = no
dynasty = { is_house_targaryen = yes }
has_title = k_high_valyrian
holder_of = c_summerhall
year > 1450
}
}
on_trigger = {
targaryen_summerhall.schedule_event
}
}
}
Note: The above script includes placeholders and simplified logic for selecting an eligible member. Depending on your mod's complexity, you may need to implement more sophisticated selection criteria for younger sons or brothers.
9. Additional Considerations
Compatibility: Ensure that your submod is compatible with the latest version of the AGOT mod and CK3.
Localization: If you want to support multiple languages, create corresponding .yml files for each language.
Testing: Thoroughly test the event in various scenarios to ensure it works as intended and doesn't cause conflicts or bugs.
By following the above steps, you can create a custom event in your AGOT submod for CK3 that allows House Targaryen kings to grant the title of Prince of Summerhall appropriately. Adjust the scripts as needed to fit your mod's specific structures and lore.