(merge from offical wiki) |
小 (RemixMe移动页面Unit modding至单位模组制作) |
(没有差异)
|
2019年3月3日 (日) 21:01的版本
Basic troops
The stats of basic troops are found in defines.lua as LIGHT_INFANTRY_PHASE_SKIRMISH_ATTACK, etc.
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转档器模组制作 |