死亡模組製作

本頁面所適用的版本可能已經過時,最後更新於2.6


As of patch 2.6, death reasons and text displayed on succession screen have become moddable.

Death reasons

Death reasons are defined in folder common/death/.

The format is:

<death_reason> = {
	long_desc = DEATH_REASON_DESC
	sound_list = {
		female = {
			"female_violent_death_01"
		}
		male = {
			"male_violent_death_01"
		}
	}
}

All are optionals, except for long_desc:

Configuration key Type Description
violent bool
long_desc key Localization key. Ex: DEATH_BY_MURDER_UNKNOWN (died under suspicious circumstances).
  • In case a killer is specified(e.g. death = { death_reason = death_battle killer = FROM}), the variable $KILLER$ will have its name.
  • death_trait is a bit special, as it will inject variable $TRAIT_DEATH$ in localization, with the <trait_name>_death text, defined for traits that reduce heath.
can_nokiller bool
murder_unknown bool
sound bool If set to no, killing someone with that reason will not cause a death sound.
sound_list list<sfx> Female and male lists of death sounds.
  • For custom death sounds, sound files are placed in the sound folder and referenced by sound.sfx, within the interface folder.
execution bool
death_date_desc key Changes the text shown when hovering over someone's age. Useful for death reasons like "Went to China" that aren't really outright dying.

Execution methods

When executing someone, an execution method is randomly determined from the execution methods defined in the common/execution_methods folder. They are written in execution_method blocks. Each execution method must contain a death reason defining the sound and description of the death. They also contain a weight multiplier to determine which of the available death reasons are used. Finally, they contain a trigger. If the trigger evaluates to false, the execution method is not available.

Within the weight_multiplier and trigger blocks, FROM is the executioner and ROOT is the executed.

Example

execution_method = {
    death = death_execution_bear
    weight_multiplier = {
        factor = 50
        modifier = {
            factor = 8
            FROM = { trait = hunter }
        }
        modifier = {
            factor = 3
            FROM = { trait = cruel }
        }
    trigger = {
        FROM = {
            capital_scope = {
                NOR = {
                    region = world_india
                    region = world_africa
                }
            }
        }
    }
}

Succession screen

Some flavor text appears on succession screen with:

  • an epitaph of deceased ruler
  • a presentation of the heir

This is configured in common/death_text and common/heir_text respectively.

death_text_proud = {
	weight_multiplier = {
		factor = 10
	
		modifier = {
			factor = 0
			OR = {
				NOT = { trait = proud }
				is_wicked = no
			}
		}
	}
}
heir_text_traits_falconer = {
	weight_multiplier = {
		factor = 25
	
		modifier = {
			factor = 0
			is_adult = no
		}
		modifier = {
			factor = 0
			NOT = {
				trait = falconer
			}
		}
	}
}