社团模组制作

本页面所适用的版本可能已经过时,最后更新于2.7


Societies are part of the free patch 2.7 and do not require the Monks and Mystics expansion, although most societies and their content are part of the expansion.

Societies

Societies are best used to model a profession or lifestyle, since a character may only be a member of one society at a time.

Variable Type Description Example
primary_attribute attribute primary_attribute = intrigue
is_secret bool Whether the society can be joined openly or not, society clothing is visible to non-members, etc. is_secret = yes
criminal bool Used for the is_criminal trigger is_criminal = yes
is_religious bool Whether the society is religion-based or not, used for opinion value
devil_worshipper bool Used for the is_devil_worshipper trigger. Also suppresses the "religious differences" opinion modifiers with other members of the same society
opinion_to_other_members int Opinion modifier applied when both characters are members opinion_to_other_members = +10
opinion_to_pretenders int Opinion modifier from a member towards someone who is perceived to be a member but is not opinion_to_pretenders = -40
opinion_to_perceived_members int Opinion modifier from a non-member toward someone who is perceived to be a member opinion_to_perceived_members = -40
opinion_per_rank_above int Opinion bonus characters in the society get for how much they're outranked by another member. For instance if the bonus is +5, someone at rank 1 will get a +15 bonus with someone at rank 4. opinion_per_rank_above = +5
society_rank_up_decision decision Decision that ranks up a member in the society society_rank_up_decision = request_to_rank_up_within_society
sound sfx Sound effect to play while the society is selected in the societies tab. The sound key is defined in interface/sound.sfx sound = monastic_orders_interface
society_ranks_gfx gfx society_ranks_gfx = generic_ranks
non_interference conditions Non-interfering AI characters will not take any hostile action towards the character. Only characters within the society will be non-interfering. ROOT is the target of diplomatic actions. FROM is the character taking the action
non_interference_tooltip localization Localisation key to be shown under "influence", explaining what characters are non-interfering
active conditions Determine if the society is active. If not met, it will be impossible to see or join the society, and no members will be generated for it at game start, and all existing members will be booted out of it within a month. Note that events and the like that reference the society will continue to act as if the society existed normally. Note that the conditions for this trigger are not shown in the UI anywhere, so you may want a global event or similar if this is something that can happen *during* a campaign. ROOT is the society
indestructible bool Used to determine whether a society is "indestructible". Indestructible societies will use the startup_populate trigger to find an existing character to lead the society. It will choose the character in the world who would get the highest society membership score, with landed characters having their score reduced to 1/100th of what they'd otherwise get, since affecting a landed character is much more disruptive than affecting a courtier. If there's no eligible character, the on_society_failed_to_find_new_leader on-action will fire indestructible = yes
can_join_society conditions Determine which characters can join the society. The condition themselves are often externalized as a scripted trigger.
can_join_society = {
  hidden_trigger = {
    NAND = {
      ai = yes
      is_society_rank_full = { 
        society = the_assassins
        rank = 1
      }
    }
  }
  has_assassins_prerequisites = yes
}
show_society conditions
show_society = {
  religion = catholic
}
potential conditions [Rules that must be true for a character to remain in the society]. This is normally a subset of the rules of can_join_society.
potential = { 
  religion = catholic
}
society_rank clause Definition of ranks
Variable Type Description Example
level int Rank level level = 1
limit int Maximum number of members at that rank. Checked via is_society_rank_full condition. limit = 100
startup_limit int Maximum number of members selected during startup_populate. If omitted, the rank will not be populated automatically. startup_limit = 10
modifier clause
modifier = { 
  is_visible = {
    OR = {
      society_member_of = the_satanists
      FROM = { is_society_discovered = yes }
    }
  }
  intrigue = 1
}
decisions List<decision> List of decisions unlocked at that rank
custom_tooltip localization Localisation key for modifiers in society ranks that is localized and added to the tooltip for rank icons
obedient conditions Define when other (AI) characters in the society will be obedient (roughly equivalent to "debug_yesmen") towards characters of this rank. ROOT is the rank holder, FROM is the potentially obedient character
obedience_tooltip localization The localisation key to be shown for the given rank, explaining what characters are obedient obedience_tooltip = obedience_tooltip
society_rank = {
  level = 1
  limit = 100 
  startup_limit = 10
  decisions = {
    prisoner_dark_sacrifice
  }
}
plots [{{{1}}}]
ambitions [{{{1}}}]
monthly_currency_gain Defines how much power the member gains every month. The "currency" varies depending on the society. Can also be set one-time via events via change_society_currency. See below for more info
member_score_per_attribute float How much member score a character recieves for every point of society attribute member_score_per_attribute = 3
member_score_per_rank float How much member score a character recieves for every rank member_score_per_rank = 100
member_score MTTH Bonus member score based on triggers, ROOT is the member.
member_score = {
  value = 10
  modifier = {
    factor = 2
    trait = diligent
  }
}
startup_populate clause Used at game start to find character to lead and join the society.
associated_religion religion Saves a religion scope to be accessible from script in the same way as character or province religion is.
society_influence bool If set to no, turns off the display of society influence. Defaults to yes. society_influence = no

Localization:

  • <society_name>: name of the society
  • <society_name>_desc: description of the society
  • <society_name>_leader_desc: title of the leader of the society
  • <society_name>_rank_<N>_male: rank <N> title for male members
  • <society_name>_rank_<N>_female: rank <N> title for female members
  • currency_name_<society_name>: name of the society's currency/power

Localization commands need to be updated as well: GetSocietyCurrency, GetSocietyRank, GetSocietyName and GetSocietyNameCap.

Currency gain

The monthly_currency_gain is a block that can take several parameters:

monthly_currency_gain = { # Used for defining how members passively gain currency
	name = loc_key # What the currency is named
	per_attribute = {
		name = stewardship # Takes one of the five attributes
		value = 1 # How much to give per point
	}
	has_trait = {
		trait = monk # Takes any trait
		value = 5 # How much to give if the character has the trait
	}
	society_rank = {
		rank = 4 # Takes a level of rank
		value = 10 # How much to give if the character has the given rank
	}
	triggered_gain = {
		desc = loc_key # What to show in the score gain breakdown. Passed through custom loc with the character as ROOT. The gain is provided as $GAIN$
		trigger = { # When to give the gain. The character is ROOT
			some triggers
		}
		value = 10 # How much to give
	}
}

Quests

Quests are created dynamically via scripting. Quests holders must be member of a society and quest targets may be characters, titles or provinces (or none).

  • To give a quest to the scoped character, without a target:
set_quest = <quest_id>
  • To give a quest to the holder with scoped character as the target:
set_quest_target = {			
	id = <quest_id>
	holder = ROOT
}

This can also be used to set or update the quest target.

The result of a quest can be set to:

  • success using clr_quest = <quest_id>
  • or failure using clr_quest = { id = <quest_id> failure = yes }

Their reward has to be managed via event scripting as well, typically by rewarding the holder some more power within the society, via change_society_currency command.

Localization:

  • <quest_id>: name of the quest
  • <quest_id>_fallback : name of the quest if no target is found. Useful if your loc depends on the target. Needed to ensure it shows up nicely in triggers (E.G., "Evoke the Sympathy of [FromFrom.GetTitledFirstName]" would fail in a trigger if you don't have a quest, so you add a fallback of "Evoke the Sympathy of a Ruler"). Adding "_fallback" will work for the other loc keys too, so can be used if you have different versions of the same quest where not all versions target something
  • <quest_id>_desc : longer description for the quest. It can use $SOCIETY$ for the society (if any), $WHO$ for the character who is doing the quest and $TARGET$ for the target of the quest (if any);;;;;;;;;;;;x
  • <quest_id>_tooltip: tooltip shown for the quest. It can use $SOCIETY$, $WHO$ and $TARGET$ for in the same way as quest_id_DESC;;;;;;;;;;;;x

GFX

Graphics for societies are by default stored under \gfx\interface\societies.

Do not forget to add a reference to any added graphics in \interface. See Interface modding for more.

You can use society icon backgrounds (society_symbol_bg_stone.dds and society_symbol_bg_wood.dds) in gfx\inventory\societies to make societies that follow the style of the vanilla societies.

Putting characters in societies

If you would like to manually place characters in societies when the game starts, you can do so with the following code in the character's definition:

12345 = {
	name = "Sample"
	...
	# Date on which the character should join.
	1066.1.1 = {
		effect = {
			join_society = monastic_order_benedictine
			# Make character the grandmaster of the society.
			set_society_grandmaster = yes
		}
	}
	# Date on which the character should leave.
	1096.1.1 = {
		effect = {
			# Unnecessary to specify which society. Characters can only belong to one at once.
			leave_society = yes
		}
	}
}

For more information on what can be placed in the effect section to influence societies, look at \common\societies\societies.info in the base game.

External links

References