首页所有页面

单位模组制作


Basic troops

The stats of basic troops are found in defines.lua as LIGHT_INFANTRY_PHASE_SKIRMISH_ATTACK, etc.

对于地图上使用的3D模型,关于 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 and gfx\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 在这种情况下,通常与其base_type技术相关(这里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

	}

}

  • “天数”指的是战术持续的天数。如果设置为“1”,战术持续一天;设置为“2”,则持续两天,依此类推。
  • “精灵”定义了该战术将拥有的精灵。这个数字对应于战术图标的索引,而这些图标定义在内文中 Crusader Kings II\gfx\interface\combat_tactic_strip.dds. Inside Crusader Kings II\interface\combat.gfx the properties spritetypes are defined.
  • “组”是该战术所属的战术组。在原版中,群体会进行游击、骚扰、蜂群、齐射、防御、蜂群、冲锋、stand_fast和推进。

举个例子,下面是文件中的一个战术示例 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

	}

}



相关页面 (55)

Defines.luaEU4转档器模组制作Steam创意工坊Tactics事件模组制作作用域修正内阁成员模组制作决议模组制作剧本模组制作历史模组制作另类开局模组制作图形模组制作地图外政权模组制作地图模组制作头衔模组制作奇观模组制作宗教模组制作定义宝物模组制作宣战理由模组制作家族模组制作小地图模组制作建筑模组制作指令控制台指令政体模组制作故障排除文化模组制作朝贡国类型模组制作本地化条件模组制作死亡模组制作法律模组制作游戏规则模组制作特质模组制作界面模组制作疾病模组制作目标模组制作盾徽模组制作省份模组制作社团模组制作科技模组制作称号模组制作继承模组制作编辑游戏存档肖像模组制作脚本荣誉头衔模组制作血脉模组制作角色模组制作贸易路线模组制作音乐模组制作验证器