Scripted effect
had_sex_with_effect
had_sex_with_effect = { CHARACTER = … PREGNANCY_CHANCE = … }game/common/scripted_effects/00_romance_effects.txt, line 361 (385 lines). Parameters: $CHARACTER$, $PREGNANCY_CHANCE$.
had_sex_with_effect is a scripted effect in Crusader Kings III, written at line 361 of its file. A call passes 2 parameters: CHARACTER and PREGNANCY_CHANCE. The game's script calls it in 124 places, among them apa_exchanging_race_commentary (activity pulse), … …: Grappling with Lust (event ep2_tournament_events.2005) and ... From My Friends (event imperial_examination.4030). Its body carries 3 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/00_romance_effects.txt.
What it does
If
One of these
- scope:had_sex_root_character: Is a child
or
scope:had_sex_with_effect_partner: Is a child
Then
error_log = Trying to run had_sex_with_effect but one or more partners is a child
If
a check the game hides
Then
If
scope:had_sex_root_character:NOT = { is_consort_of = scope:had_sex_with_effect_partner }NOT = { has_relation_lover = scope:had_sex_with_effect_partner }might_cheat_on_every_partner_trigger = no
Then
- scope:had_sex_with_effect_partner › scope:had_sex_root_character:
error_log = had_sex_with_effect.log.root_cheated_inappropriately
If
scope:had_sex_with_effect_partner:NOT = { is_consort_of = scope:had_sex_root_character }NOT = { has_relation_lover = scope:had_sex_root_character }might_cheat_on_every_partner_trigger = no
Then
- scope:had_sex_root_character › scope:had_sex_with_effect_partner:
error_log = had_sex_with_effect.log.target_cheated_inappropriately
clear_saved_scope = ignore_cheating_error_checkIf
a check the game hides
Then
- You lay with …
Else if
root = scope:had_sex_with_effect_partner
Then
- Lays with …
Otherwise
- … lays with …
If
a check the game hides
Then
create_character_memory = { … }
If
a check the game hides
Then
$CHARACTER$ = { … }If
a check the game hides
Then
- Stress and fulfillment impact: by trait: Lustful -15, Rakish -15
If
- scope:had_sex_root_character: Has the Trait: Violet Poet
Then
- scope:had_sex_root_character: Violet Poet experience changes
If
- scope:had_sex_with_effect_partner: Has the Trait: Violet Poet
Then
- scope:had_sex_with_effect_partner: Violet Poet experience changes
fp2_had_friend_with_benefits = yesce3_papal_bull_check_effect = yes
• the game's own tooltip text · ◦ our reading of the script line · code the script where neither exists
“They” is whatever it runs on (the scope it is called in). The scripted triggers and effects it calls link to their own pages; $PARAMETERS$ stay as written: each call fills them in.
The script as written (120 lines of game script)
had_sex_with_effect = {
save_scope_as = had_sex_root_character
$CHARACTER$ = { save_scope_as = had_sex_with_effect_partner }
# Error logging
## Children should never run this effect.
if = {
limit = {
OR = {
scope:had_sex_root_character = { is_adult = no }
scope:had_sex_with_effect_partner = { is_adult = no }
}
}
error_log = "Trying to run had_sex_with_effect but one or more partners is a child"
}
## Did you forget to run the check for whether adultery was valid?
if = {
limit = {
# Rarely, we may also want to block this check (e.g., seduction schemes or monogamous threesomes).
NOT = { exists = scope:ignore_cheating_error_check }
}
# Check whether the root char is cheating.
if = {
limit = {
scope:had_sex_root_character = {
NOR = {
is_consort_of = scope:had_sex_with_effect_partner
has_relation_lover = scope:had_sex_with_effect_partner
}
might_cheat_on_every_partner_trigger = no
}
}
# The weird structure here is so that we can use prev scope in loc to grab both chars.
scope:had_sex_with_effect_partner = {
scope:had_sex_root_character = { error_log = had_sex_with_effect.log.root_cheated_inappropriately }
}
}
# Check whether their partner is cheating.
## Though this does lead to potential duplication in the error log, where you'll get an entry for X cheating with Y _and_ for Y cheating with X, it is necessary: it's perfectly possible for one char to be cheating but the other not.
if = {
limit = {
scope:had_sex_with_effect_partner = {
NOR = {
is_consort_of = scope:had_sex_root_character
has_relation_lover = scope:had_sex_root_character
}
might_cheat_on_every_partner_trigger = no
}
}
# The weird structure here is so that we can use prev scope in loc to grab both chars.
scope:had_sex_root_character = {
scope:had_sex_with_effect_partner = { error_log = had_sex_with_effect.log.target_cheated_inappropriately }
}
}
}
### Plus, remove the blocking scope we might have.
clear_saved_scope = ignore_cheating_error_check
if = {
limit = { this = root }
custom_tooltip = had_sex_with_effect.first_person.tt
}
else_if = {
limit = { root = scope:had_sex_with_effect_partner }
custom_tooltip = had_sex_with_effect.other_person.tt
}
else = {
custom_tooltip = had_sex_with_effect.third_person.tt
}
if = {
limit = {
NOT = { exists = scope:no_sex_memory }
}
create_character_memory = {
type = had_sex
participants = {
sex_partner = scope:had_sex_with_effect_partner
}
}
}
#Stress
if = {
limit = { # For use with events that add/remove more stress than these values, to avoid ugly tooltips
NOT = {
has_character_flag = no_sex_stress_loss
}
}
$CHARACTER$ = {
if = {
limit = { this = root }
stress_and_fulfillment_impact = {
lustful = minor_stress_impact_loss
rakish = minor_stress_impact_loss
}
}
else = {
hidden_effect = {
stress_and_fulfillment_impact = {
lustful = minor_stress_impact_loss
rakish = minor_stress_impact_loss
}
}
}
}
if = {
limit = { this = root }
stress_and_fulfillment_impact = {
lustful = minor_stress_impact_loss
rakish = minor_stress_impact_loss
}
}
else = {
hidden_effect = {
stress_and_fulfillment_impact = {
lustful = minor_stress_impact_loss
rakish = minor_stress_impact_loss
}
}As written in game/common/scripted_effects/00_romance_effects.txt.
The first 120 of its 385 lines; the rest is in game/common/scripted_effects/00_romance_effects.txt from line 361.
Where it is used
Every place in common/, events/ and history/ that calls had_sex_with_effect — the first 120 of 124.
Activity pulse actions (1)
- apa_exchanging_race_commentary
Events (114)
- … …: Grappling with Lust
ep2_tournament_events.2005 - ... From My Friends
imperial_examination.4030 - … Intimate Desires
pilgrimage.2101 - … The Fishermen of …
pilgrimage_seasia.500 - …: Caught!
tour_general.4004 - …: the Garden
ep3_laamp_decision_event.1045
108 more
- …: The Lost …
ep2_tournament_events.1004 - …: Up to the Task
councillor_spouse_learning.2603 - 'Celestial Hierarchy'
pam_secular_faith_events.0049 - 'Haunted' Manor: Which Witch?
travel_events.2020 - A … in Our Bed
bp1_yearly.9019 - A Beautiful Specimen
hunt.5003 - A Bishop's Ring
ecumenical_council_events_josh.0012 - A Bloom In The Wilderness
intrigue_temptation.3011 - A Follower, Enamored
ep3_story_cycle_violet_poet.1015 - A Good Tumble
elder_events.1400 - A Meeting of Houses
ep2_wedding.3400 - A Moment Alone
hunt.4011 - A Night to Die For
ep2_wedding.3060 - A Place at Court
hold_court.8090 - A Poetic Life: An Ephemeral …
tgp_japan_yearly_events.1263 - A Poetic Life: An Exchange of Verses
tgp_japan_yearly_events.1262 - A Poetic Life: Imperial Immortality
tgp_japan_yearly_events.1261 - A Rival's Reunion
feast_tsagaan_sar_events.0220 - A Sensual Proposal
seduce_outcome.0003 - A Single Night
feast_default.3006 - A Sultry Study Break
bp2_adult_education.9200 - A Sweet Farewell
intrigue_temptation.3000 - A Tumble to Die For
elder_events.1500 - A Warm Welcome
travel_events.3020 - Alone in the Dark
tour_travel.3020 - An Interesting Proposition
host_dinner_events.3001 - An Odd Request
bp1_yearly.9020 - Another Lover
bp1_yearly.9009 - Befriend: Friendly Offering
befriend_ongoing.9105 - By the Pond
witch.3015 - Carnal Comforts
bp1_yearly.7030 - Carnal Revelation
pam_secular_faith_events.0037 - Caught in the Act
intrigue_temptation.3150 - Ceremonial Commitments
ep2_wedding.3200 - Dinner and a Show
feast_events_ewan.0201 - Do You Know of …?
prelude_events.0150 - Ecstasy: A Rollicking Good Time
harm.0631 - Ecstasy: Sweet Music
harm.0632 - Eminent Eunuch: Indiscretions
ep3_story_cycle_admin_eunuch.4010 - Evening Ride
nomad_events.0120 - Extremes of Passion
intrigue_temptation.3160 - Fabricate Hook: Gossip
fabricate_hook_ongoing.0003 - Far from People
hunt.1021 - Forbidden Love
yearly.0003 - Friends of the New …
coronation_events.6030 - Gone In The Night
yearly.1010 - Hearty Competition: Broken Heart
fp1_yearly.2101 - Homesick
nomad_events.0230 - House of Pleasure
tour_travel.3007 - Hunted While Hawking
hunt.8210 - In the Act
feast_default.3007 - Indirect Espionage
hold_court.1001 - Indiscreet Councillor
yearly.0002 - Inspiration: Unhappy Stanza
fund_inspiration.6300 - Inspiration: Up Late
fund_inspiration.2120 - Issues of Fertility
learning_medicine.2022 - Issues of Fertility
learning_medicine.2023 - Late Night Baijiu
imperial_examination.4050 - Learn Language: An Amorous Misunderstanding
learn_language_ongoing.1010 - Learn Language: Lexical Love
learn_language_ongoing.1130 - Mandala Ritual: Divine Witness
tgp_east_asia_mandala_task_contract_events.1400 - Mandala Ritual: Midwives' Dream
tgp_east_asia_mandala_task_contract_events.1500 - Mandala Ritual: River Ritual
tgp_east_asia_mandala_task_contract_events.1800 - Mandala Ritual: The First Seed
tgp_east_asia_mandala_task_contract_events.1200 - Mandala Ritual: Withered Grove
tgp_east_asia_mandala_task_contract_events.2000 - Mental Break: Repressed Desires
stress_threshold_special.2001 - My Beloved
lover.3203 - Nice to See You
prelude_events.0030 - Not Quite the …
ep3_wedding.0001 - Obsession
stress_trait_ongoing.1501 - Put to Bed
ep2_wedding.3300 - Religious Study: A Second Pair of Hands
study_scripture_outcome.1040 - Rhythms of the Dark
ep3_wedding.0002 - Sins of the …: In Flagrante
bp1_yearly.5707 - Strange Bedfellows
bp1_yearly.5703 - Study Rite: An Intimate Understanding
study_faith_ongoing.1010 - Study Rite: Pleasures of the Faith
study_faith_ongoing.1130 - Sunrise in Seclusion
hunt.1022 - Tempest in the Wilderness
bp1_yearly.0101 - Temptations of the Flesh
trait_specific_ongoing.5003 - Tent Camp: Stealing a Moment
ep2_locale_events.3001 - Tent Camp: Wanton Warriors
ep2_locale_events.3002 - That's My …!
ep3_wedding.0003 - The … …
pam_secular_faith_events.0050 - The … Among the Weeds
tour_travel.1002 - The … in My Bed
bp1_yearly.9021 - The … of …
bp3_journey.2200 - The Arrival
pilgrimage.4002 - The First to Finish
chariot_race.4031 - The Hippodrome's Refreshments
chariot_race.4030 - The Oldest Joke In The Book
yearly.1060 - The Romance of Poetry
ep3_story_cycle_violet_poet.1010 - The Stars Align
witch.3016 - Through Downcast Lashes
yearly.1001 - To Forgive, Divine
feast_events_flavor.0002 - Tourney Troubles
relation_upgrade.0001 - Tourney Troubles
relation_upgrade.0011 - Tumble Trouble
vassal.3002 - Tumble Trouble
vassal.3003 - Tumble Trouble
vassal.3004 - Two Ships In The Night
bp1_yearly.2010 - Unexpected Wake Up Call
host_dinner_events.1006 - Unsheathed
mpo_events_ariana.0041 - Wandering Hearts
intrigue_temptation.3120 - Weaponsmith: Armed and Ready
ep2_locale_events.4501 - What Beautiful... Stitching
intrigue_temptation.3100 - Why Trot When You Can Ride?
migration_events.1010 - With Cold Heart
intrigue_temptation.3130
Scripted effects inside an event file (4)
- coronation_events_6030_choose_courtesan_effect
- tour_grounds_1004_shag_effect
- tour_grounds_events_6000_sex_effect
- witch_3017_soulmate_sex_effect
Scripted effects (1)
Source: game/common/scripted_effects/00_romance_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.