Basic troops
The stats of basic troops are found in defines.lua as LIGHT_INFANTRY_PHASE_SKIRMISH_ATTACK, etc.
For the 3D models used on the map, there's a convention on the name of EMFXActorType
or pdxmesh
gfx entries, based on the culturegfx of the units:
- culturegfx_<unit_type>
- culturegfx_<unit_type>_rider (for mounted units)
- culturegfx_<unit_type>_weapon
- culturegfx_<unit_type>_helmet
- culturegfx_<unit_type>_shield
culturegfx is the first matching unit_graphical_cultures
of the culture (if any), otherwise the graphical_cultures
, defaulting to westerngfx.
See interface/avatars.gfx
for the base game units assets.
Special troops
To add a special troops the steps are to:
- Add a unit in
common\special_troops
:
my_special_unit = { morale = 4 maintenance = 3 phase_skirmish_attack = 0.5 phase_melee_attack = 5 phase_pursue_attack = 8 phase_skirmish_defense = 4 phase_melee_defense = 4 phase_pursue_defense = 3 base_type = heavy_infantry }
- Add the unit sprite into
gfx\interface\unitpanel_specialunits_bigstrip.dds
andgfx\interface\unitpanel_specialunits_smallstrip.dds
The noOfFrames in interface\unitpanel.gfx
needs to be increased
spriteType = { name = "GFX_unitpanel_specialtroops_smallstrip" texturefile = "gfx\\interface\\unitpanel_specialunits_smallstrip.dds" noOfFrames = 6 } spriteType = { name = "GFX_unitpanel_specialtroops_bigstrip" texturefile = "gfx\\interface\\unitpanel_specialunits_bigstrip.dds" noOfFrames = 6 }
- Add a modifier definition in
common\modifier_definitions
my_special_unit = { show_as_percent = no is_good = yes is_monthly = no is_hidden = no max_decimals = 0 } my_special_unit_offensive = { show_as_percent = yes is_good = yes is_monthly = no is_hidden = no max_decimals = 2 } my_special_unit_defensive = { show_as_percent = yes is_good = yes is_monthly = no is_hidden = no max_decimals = 2 } my_special_unit_morale = { show_as_percent = yes is_good = yes is_monthly = no is_hidden = no max_decimals = 2 }
- Add the localization:
my_special_unit;Special unit;;;;;;;;;;;;;x my_special_unit_offensive;Special unit Offensive;;;;;;;;;;;;;x my_special_unit_defensive;Special unit Defensive;;;;;;;;;;;;;x my_special_unit_morale;Special unit Morale;;;;;;;;;;;;;x my_special_unit_modifier;Combat Modifier boost to Special unit Troops: $PERC$;;;;;;;;;;;;;x
- Add the new unit in
common\technology
in this case, typically associated to technology of its base_type (here TECH_HEAVY_INFANTRY):
TECH_HEAVY_INFANTRY = { modifier = { (...) my_special_unit_OFFENSIVE = 0.6 my_special_unit_DEFENSIVE = 0.6 } }
Tactics
Tactics are defined in the /common/combat_tactics/
folder. The format is:
<tactic_name> = { days = 1 sprite = 1 group = <tactic_group_name> trigger = { phase = <tactic_phase> } mean_time_to_happen = { days = 3 } }
- "days" refers to the amounts of days a tactic will last. If it is set as "1" the tactic will last for one day, if it is set as "2" it will last for two days etc.
- "sprite" defines the sprite the tactic will have. The number corresponds with the index of a tactics icon, which are defined inside
Crusader Kings II\gfx\interface\combat_tactic_strip.dds
. InsideCrusader Kings II\interface\combat.gfx
the properties spritetypes are defined. - "group" is the tactic group that the tactic belongs to. In vanilla, the groups skirmish, harass, swarm, volley, defensive, swarm, charge, stand_fast and advance are used.
To illustrate, here is an example of a tactic from the the file 00_combat_tactics.txt
in vanilla:
stand_fast_tactic = { days = 18 sprite = 3 group = stand_fast trigger = { phase = melee pikemen = 0.01 location = { terrain = forest } } mean_time_to_happen = { days = 3 modifier = { factor = 1.5 flank_has_leader = yes leader = { martial = 8 } heavy_troops = { who = pikemen value = 0.7 } } modifier = { factor = 1.5 flank_has_leader = yes leader = { martial = 12 } heavy_troops = { who = pikemen value = 0.6 } } modifier = { factor = 1.5 flank_has_leader = yes leader = { martial = 16 } heavy_troops = { who = pikemen value = 0.5 } } } knights_offensive = -1.5 heavy_infantry_offensive = -1.5 pikemen_offensive = 3 enemy = { group = charge factor = 3 } }
這是一篇小作品。你可以通過編輯或修訂擴充其內容。 如果可以請盡你所能的去協助完善這篇文章。 |
模組製作
歷史 | 角色 • 家族 • 省份 • 頭銜 • 劇本 |
腳本 | 指令 • 條件 • 作用域 • 修正 • 事件 • 決議 |
常規 | 定義 • 遊戲規則 • 另類開局 • 宗教 • 文化 • 政體 • 特質 • 血脈 • 科技 • 法律 • 建築 • 宣戰理由 • 朝貢國 • 單位 • 目標 • 疾病 • 死亡 • 榮譽頭銜 • 社團 • 寶物 • 地圖外政權 • 內閣成員 • 貿易路線 • 繼承 • 奇觀 • 稱號 |
圖像/音效/本地化 | 地圖 • 圖形 • 盾徽 • 肖像 • 介面 • 小地圖 • 音樂 • 本地化 |
其他 | 故障排除 • 驗證器 • 控制台指令 • 編輯遊戲存檔 • Steam創意工坊 • EU4轉檔器模組製作 |