CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

Scripted effect

sway_end_effect

sway_end_effect = yes

game/common/scripted_effects/00_scheme_scripted_effects.txt, line 15548 (142 lines). No parameters.

sway_end_effect is a scripted effect in Crusader Kings III, written at line 15548 of its file. It takes no parameters: sway_end_effect = yes. The game's script calls it in 5 places, among them sway_outcome.0001 (event), sway_outcome.0002 (event) and Sway: An Opportunity (event sway_outcome.1001). Its body carries 2 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/00_scheme_scripted_effects.txt.

What it does

  • If

    • scope:target:
      • NOT = { has_opinion_modifier = { target = scope:owner modifier = scheme_sway_opinion value >= sway_max_value } }

    Then

    • If

      a check the game hides

      Then

    • If

      a check the game hides

      Then

      • You continue your efforts

      Otherwise

      • You will make another attempt
    • scope:owner:
      • If

        • Is played by the AI
        • scope:target:
          • Not all of these

            • is_vassal_of = scope:owner
            • Is a faction member
            • Opinion of owner less than 100

        Then

        • If

          • scope:target:
            • Is Leasing holdings from their Liege
            • Opinion of owner at most 50

          Then

          • 10% chance of › scope:scheme:
            • end_scheme = yes

          Else if

          • scope:target: Opinion of owner less than -25

          Then

          • 10% chance of › scope:scheme:
            • end_scheme = yes

          Else if

          • scope:target: Opinion of owner less than 0

          Then

          • 30% chance of › scope:scheme:
            • end_scheme = yes

          Else if

          • scope:target: Opinion of owner less than 35

          Then

          • 50% chance of › scope:scheme:
            • end_scheme = yes

          Otherwise

          • scope:scheme:
            • end_scheme = yes

    Otherwise

    • scope:owner › scope:scheme:
      • end_scheme = 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)
sway_end_effect = {
	if = {
		limit = {
			scope:target = {
				NOT = {
					has_opinion_modifier = {
						target = scope:owner
						modifier = scheme_sway_opinion
						value >= sway_max_value # 100 by default
					}
				}
			}
		}
		if = {
			limit = {
				exists = scope:scheme
			}
			scope:scheme = {
				reset_failed_scheme_effect = yes
			}
		}
		if = {
			limit = {
				exists = scope:scheme_successful
			}
			custom_tooltip = sway_continue
		}
		else = {
			custom_tooltip = sway_try_again
		}
		
		scope:owner = { # The AI never stops swaying unless we force it to, this makes them use a more even spread of schemes
			if = {
				limit = {
					is_ai = yes
					scope:target = {
						NAND = {
							is_vassal_of = scope:owner
							is_a_faction_member = yes
							opinion = {
								target = scope:owner
								value < 100
							}
						}
					}
				}
				if = { # Sway your realm priest for a long time
					limit = {
						scope:target = {
							is_theocratic_lessee = yes
							opinion = {
								target = scope:owner
								value <= 50
							}
						}
					}
					random = {
						chance = 10
						scope:scheme = {
							end_scheme = yes
						}
					}
				}
				else_if = {
					limit = {
						scope:target = {
							opinion = {
								target = scope:owner
								value < -25
							}
						}
					}
					random = {
						chance = 10
						scope:scheme = {
							end_scheme = yes
						}
					}
				}
				else_if = {
					limit = {
						scope:target = {
							opinion = {
								target = scope:owner
								value < 0
							}
						}
					}
					random = {
						chance = 30
						scope:scheme = {
							end_scheme = yes
						}
					}
				}
				else_if = {
					limit = {
						scope:target = {
							opinion = {
								target = scope:owner
								value < 35
							}
						}
					}
					random = {
						chance = 50
						scope:scheme = {
							end_scheme = yes
						}
					}
				}
				else = {
					scope:scheme = {
						end_scheme = yes
					}
				}
			}
		}
	}
	else = {

As written in game/common/scripted_effects/00_scheme_scripted_effects.txt.

The first 120 of its 142 lines; the rest is in game/common/scripted_effects/00_scheme_scripted_effects.txt from line 15548.

Where it is used

Every place in common/, events/ and history/ that calls sway_end_effect.

Source: game/common/scripted_effects/00_scheme_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.

Spotted a mistake on this page?