決議模組製作

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

CK3可以自行製作決議。決議是伯爵及以上統治者的可選行動。

位置[編輯 | 編輯原始碼]

決議代碼需寫在mod目錄中,common\decisions文件夾的.txt文件里。每個文本文件可包含多個決議。

結構[編輯 | 編輯原始碼]

決議結構如下所示:

my_decision = {

	# 把键值等放在这里

}

鍵值/區塊[編輯 | 編輯原始碼]

下表列舉出可以使用的鍵值和區塊。布爾值可以是yes或no。

鍵值/區塊 數據類型 描述 示例
title 覆蓋標題,默認值:「 <key>」; 支持事件中的動態描述(first_valid,...); 範圍:字符
title = <key> 
title = { ... }
picture 字符串(文件名稱) 設置決議的圖像
picture = "image_name.dds"
major 布爾值(yes/no) 重要;默認值為no。當設置為yes時,該決議將視為重要決議
major = yes/no
ai_goal 布爾值 如果設置,則AI將把此決議視為「目標」,並將其與例如頭銜創建和地產建設之類的主要花銷放同等地位考慮。

此項會忽略ai_check_interval。

此項只能用於預算十分重要,需要大宗花費的事務。原因是,與設置為高的ai_check_interval相比,其性能較低。

ai_goal = yes/no 
ai_check_frequency 整數 設置ai檢查此項決議的間隔,以月數表示。

除非決議里已寫入ai_goal=yes,否則必須設置。

間隔為0意味著AI永遠不會檢查此決議。

ai_check_frequency = 42
selection_tooltip 從決策列表中選擇決策時,覆蓋工具提示,默認值:「 <key> _tooltip」; 支持事件中的動態描述(first_valid,...); 範圍:字符
selection_tooltip = <key> 
selection_tooltip = { .. }
desc 覆蓋描述,默認值:「 <key> _desc」; 支持事件中的動態描述(first_valid,...); 範圍:字符
desc = <key> 
desc = { ... }
confirm_text 覆蓋確認文本,默認值:「 <key> _confirm」; 支持事件中的動態描述(first_valid,...); 範圍:字符
confirm_text = <key> 
confirm_text = { ... }
is_shown 此項確定決議顯示在決議欄中所需的條件。
is_shown = { ... }
is_valid_showing_failures_only 可以執行決定; 如果它們失敗,這些將顯示在確認按鈕工具提示中; 範圍:字符; 默認值:{always = yes}
is_valid_showing_failures_only = { ... }
is_valid 可以執行決定; 這些將顯示在「需求」下的詳細視圖中; 範圍:字符; 默認值:{always = yes}
is_valid = { ... }
cost 區塊 設置決議花費的金錢、虔誠和威望。

每項資源的默認值為零。

不用將每項資源都定義出來。

cost = {
	gold = 42
	piety = 42
	prestige = 42
}
effect 區塊 作出決定時執行的效果; 範圍:字符
effect = { ... }
ai_potential AI執行決議的意願。
ai_potential = { ... }
ai_will_do 返回執行決策的機會百分比。 0將永遠不會執行它,100將永遠執行它
ai_will_do = { ... }
widget 指定最多一個Custom Widgets以嵌入到決策中。 請參閱下面有關Custom Widgets的部分。

基本示例[編輯 | 編輯原始碼]

custom_decision = {
	picture = "custom_decision.dds"
	
	desc = custom_decision_desc
	selection_tooltip = custom_decision_tooltip

	is_shown = {

		# Put conditions for the decision to show up here.

	}

	effect = {

		# Add effects of the decision here.

	}

	ai_check_frequency = 0 # Change this value if you want the AI to consider this decision.
}

決議ID[編輯 | 編輯原始碼]

Each decision uses an internal ID for reference within the game's files. The internal name of a decision in the game's files can be found by following these steps:

每個決議都使用遊戲文件中的內部ID來引用。遊戲文件中決議ID可用以下步驟確定:

  • 寫出決議名稱。
  • 把所有字母都改為小寫形式(A...Z->a...z)。
  • 用下劃線(_)代替空格 ( ) 。
  • 在名字末尾添加 _decision。

Decisions with in-game names that do not match their internal name are included in the table below:

遊戲內決議名稱同內部ID不一致的決議如下表所示:

決議名稱 決議ID
Call Hunt start_hunt
Search for Physician hire_physician
Borrow Gold from Holy Order borrow_from_holy_order
Challenge the Ruler tribal_challenge_ruler
Stop Gaining Weight stop_gain_weight
Stop Losing Weight stop_lose_weight
Attempt Suicide commit_suicide
Return Roma return_rome
Determine Bhakti select_personal_deity
Give Your Ancestor a Sky Burial give_sky_burial
Raise a Runestone raise_runestone
Found Holy Order create_holy_order
Revoke Holy Order Lease cancel_holy_order_lease
Go on a Pilgrimage go_on_pilgrimage
Undertake the Hajj go_on_hajj
Restore the Kingdom of Cornwall restore_dumnonia
Reclaim Constantinople set_capital_constantinople
Reclaim Rome set_capital_rome
Restore the Papacy restore_papacy
Form the Swiss Confederation form_switzerland_kingdom
Form Archduchy of Austria form_austria_kingdom
Dismantle the Papacy dismantle_papacy
Restore Carolingian Borders reform_carolingian_empire
Unify the Burgundies unify_burgundy_kingdom
Unify Italy unify_italian_empire
Adopt Feudalism (unused) convert_to_feudalism
Adopt Feudal / Clan Ways through Liege convert_to_feudalism_liege_converted
Adopt Feudal / Clan Ways convert_whole_realm_to_feudalism
Form the Outremer Empire create_outremer_empire
Sell Minor Titles sale_of_titles
Restore the Ash'ari Caliphate restore_sunni_caliphate
Restore Israel create_israel_kingdom
Restore the Faith High Priesthood jewish_restore_high_priesthood
Restore the Faith High Priesthood zoroastrian_restore_high_priesthood
Become the Saoshyant become_saoshyant
Dismantle German Pretenders dismantle_holy_pretender
Dismantle Greek Pretenders dismantle_byz_pretender
Form the Sultanate of Rum form_rum_sultanate
Revive Greater Armenia create_armenian_empire
Consecrate Bloodline declare_bloodline_holy
Build a Grand Church build_grand_church
Faith Cannibalism accept_cannibalism
Request Claim on Ireland england_request_laudabiliter
Inspire Opus Francigenum promote_gothic_innovations
Build a Glass Monument lunatic_building
Promote Christian Settlements promote_hungarian_settlement
Revive Táltosism revive_magyar_paganism
Unite the West Slavs unite_the_western_slavs
Unite the South Slavs unite_the_southern_slavs
Defenders of High God defenders_of_highgod
Found a New Kingdom found_kingdom
Found a New Empire found_empire
Amnesty for False Conversions encourage_confession_of_false_conversions
Restore the Holy Roman Empire restore_holy_roman_empire
Adopt Special Succession Type adopt_special_succession
Found the Kingdom of Aragon form_the_kingdom_of_aragon
Indulge in Drink stress_loss_drunkard
Consume Hashish Cakes stress_loss_hashishiyah
Visit a Brothel stress_loss_rakish
Seclude Yourself stress_loss_reclusive
Lash Out stress_loss_irritable
Flagellate stress_loss_flagellant
Visit the Market stress_loss_profligate
Donate to Charity stress_loss_improvident
Confess stress_loss_contrite
Indulge in Food stress_loss_comfort_eater
Shun Food stress_loss_inappetetic
Write Thoughts Down stress_loss_journaller
Talk to Confidant stress_loss_confider
Work off Some Stress stress_loss_athletic
Accuse the Krstjani of Heresy accuse_krstjani_of_heresy
Prepare to Cross the Carpathians launch_hungarian_migration
Restore the Roman Empire restore_roman_empire (as Byzantine Emperor)
restore_roman_empire_holy (as Holy Roman Emperor)
restore_roman_empire_italian (as Emperor of Italia)
Host Grand Rite host_witch_ritual_decision

Custom Widgets[編輯 | 編輯原始碼]

A custom widget can be embedded into a decision.

GUI files must be placed at the decision_view_widgets path (see paths.settings). The name of the file must match the widget name.

Usually these widgets require a custom controller. This should be documented in the widget's GUI file.

The data context type available in the GUI depends on the controller type.

Available controllers:

Controller Type | Data Context Name   | Notes

-------------------+------------------------------------+-----------------------------------------------------------

default | EventWindowWidget | Default controller, no special behavior

create_holy_order  | DecisionViewWidgetCreateHolyOrder  | Show GUI to customize the new holy order.