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

Scripted effect

configure_start_single_combat_effect

configure_start_single_combat_effect = { FATALITY = … FIXED = … INVALIDATION_EVENT = … LOCALE = … OUTPUT_EVENT = … SC_ATTACKER = … SC_DEFENDER = … SC_INITIATOR = … }

game/common/scripted_effects/00_single_combat_effects.txt, line 9 (180 lines). Parameters: $FATALITY$, $FIXED$, $INVALIDATION_EVENT$, $LOCALE$, $OUTPUT_EVENT$, $SC_ATTACKER$, $SC_DEFENDER$, $SC_INITIATOR$.

configure_start_single_combat_effect is a scripted effect in Crusader Kings III, written at line 9 of its file. A call passes 8 parameters: FATALITY, FIXED, INVALIDATION_EVENT, LOCALE, OUTPUT_EVENT, SC_ATTACKER, SC_DEFENDER and SC_INITIATOR. The game's script calls it in 52 places, among them Challenge for Artifact (interaction), Challenge to Duel (interaction) and Punish Criminal (interaction). Patch 1.20.1.2, from game/common/scripted_effects/00_single_combat_effects.txt.

What it does

• 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)
configure_start_single_combat_effect = {
	# DOCUMENTATION
	## scope:sc_initiator
		### Who started the combat? This is who the output/invalidation events will fire for.
	## scope:sc_attacker
		### The attacking party.
	## scope:sc_defender
		### The defending party.
	## scope:fatality = flag:default/possible/no/always
		### default: always if tribal, no otherwise.
		### possible: losing can be fatal, but isn't necessarily.
		### no: losing is never fatal.
		### always: losing always fatal.
		### practice: no death, no wounds.
	## scope:fixed = flag:no/flag:sc_attacker/scope:sc_defender
		### No: the match uses normal rules.
		### scope:sc_attacker: the attacker will always win.
		### scope:challenged: the defender will always win.
	## scope:locale = flag:XYZ
		### These just trigger the event background of the same name. New ones can be added as needed, but should be added across all three events (round, victory, loss/single_combat.0001, single_combat.0031, single_combat.0041), as we can't add a scripted list.
		### terrain_scope
		### battlefield
		### alley_night
		### alley_day
		### temple
		### corridor_night
		### corridor_day
		### courtyard
		### dungeon
		### docks
		### feast
		### market
		### tavern
		### throne_room
		### army_camp
	## output event ID
		### Which event fires after the combat's completion?

	# Sort parties.
	$SC_INITIATOR$ = { save_scope_as = sc_initiator }
	$SC_ATTACKER$ = { save_scope_as = sc_attacker }
	$SC_DEFENDER$ = { save_scope_as = sc_defender }
	# Arrange aftermath.
	## We're doing this early so we can invalidate well in a sec.
	if = {
		limit = { exists = scope:sc_finished }
		clear_saved_scope = sc_finished
	}
	save_scope_value_as = {
		name = follow_up_event
		value = event_id:$OUTPUT_EVENT$
	}
	save_scope_value_as = {
		name = invalidation_event
		value = event_id:$INVALIDATION_EVENT$
	}
	# Invalidation check: have we managed to set scope:sc_attacker and scope:sc_defender to the same person?
	## If so, invalidate the duel, because this will cause crashes on Mac due to the duel's logic then looping in on itself later.
	### Shocking to hear Mac has problems, I know.
	if = {
		limit = {
			scope:sc_attacker != scope:sc_defender
		}
		# Make sure they're clean for setup.
		hidden_effect = { remove_single_combat_info_effect = yes }
		# Set them both to busy for the single combat.
		scope:sc_attacker = {
			set_variable = {
				name = engaged_in_single_combat
				value = yes
			}
		}
		scope:sc_defender = {
			set_variable = {
				name = engaged_in_single_combat
				value = yes
			}
		}
		## Then try to take shirts off.
		single_combat_apply_default_shirtlessness_effect = {
			ATTACKER = scope:sc_attacker
			DEFENDER = scope:sc_defender
		}
		# Set rules.
		save_scope_value_as = {
			name = fatality
			value = flag:$FATALITY$
		}
		save_scope_value_as = {
			name = fixed
			value = flag:$FIXED$
		}
		save_scope_value_as = {
			name = locale
			value = flag:$LOCALE$
		}
		## Note where the fight is taking place, if we're using a specific location.
		if = {
			limit = { scope:locale = flag:terrain_scope }
			scope:sc_defender.location = { save_scope_as = background_terrain_scope }
		}
		# Configure starting bonus/threshold variables.
		scope:sc_attacker = {
			set_variable = {
				name = sc_attacker_injury_bonus
				value = starting_injury_bonus
			}
		}
		scope:sc_defender = {
			set_variable = {
				name = sc_defender_injury_bonus
				value = starting_injury_bonus
			}
			set_variable = {
				name = success_threshold
				value = starting_success_threshold
			}
		}
		# Configure starting round variables.
		scope:sc_attacker = {

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

The first 120 of its 180 lines; the rest is in game/common/scripted_effects/00_single_combat_effects.txt from line 9.

Where it is used

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

Events (46)

40 more

Scripted effects inside an event file (1)

  • ep3_laamp_flavour_ewan_2091_start_duel_to_death_effect

Source: game/common/scripted_effects/00_single_combat_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?