Equipment modding:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.10
(文本替换 - 替换“[[Category:”为“[[分类:”)
无编辑摘要
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
{{version|1.4}}
{{version|1.10}}
{{需要翻译|译者=霜泽图书馆}}
== Equipment ==
== Equipment ==
{{SVersion|1.4}}
{{SVersion|1.4}}
第5行: 第6行:


Archetype equipment follows the following format:
Archetype equipment follows the following format:
<pre>
<pre>equipments = {
equipments = {
<equipment> = {
   <equipment> = {
year = <int> # Limits the equipment from appearing before the specified year. Optional
     year = <int>     # Limits the equipment from appearing before the specified year. Optional
picture = <name> # GFX reference used to define equipment picture in lend-lease
     picture = <name>   # GFX reference used to define equipment picture in land-lease
    
can_be_produced = { # Optional, specifies when equipment of this category can be produced.
     is_archetype = yes # Specifies an entry as an archetype entry. All non-archetype entries inherit 
<triggers>
     is_buildable = no   # Prevents this equipment from being built.
}
     active = yes     # Determines if this equipment is available without unlocking from a technology.
    
is_archetype = yes # Specifies an entry as an archetype entry. All non-archetype entries inherit 
     type = <type>     # Internal type: what kind of unit can use this equipment
is_buildable = no # Prevents this equipment from being built.
active = yes # Determines if this equipment is available without unlocking from a technology.
type = <type>   # Internal type: what kind of unit can use this equipment


     group_by = <group>        # How the equipment is grouped in the production screen
group_by = <group>   # How the equipment is grouped in the production screen
     interface_category = <type>    # Which category the equipment appears in the production screen
interface_category = <type> # Which category the equipment appears in the production screen
    
     # Resources used to build this equipment
# Resources used to build this equipment
     resources = {
resources = {
       <resource> = <amount>
<resource> = <amount>
     }
}
    
     # Modifiers the equipment uses
# Modifiers the equipment uses
     <modifiers> 
<modifiers> 
   }
}
}
}</pre>
</pre>


Regular equipment follows the following format:
Regular equipment follows the following format:
第56行: 第59行:


=== Internal Types ===
=== Internal Types ===
==== Land ====
* anti-air
* anti-tank
* armor
* artillery
* infantry
* infantry
* support
* artillery
* anti_tank
* anti_air
* motorized
* motorized
* mechanized
* mechanized
* armor
* rocket
* support
 
==== Naval ====
 
* capital_ship
* carrier
* convoy
* naval_transport
* screen_ship
* submarine
 
==== Air ====
 
* air_transport
* cas
* fighter
* fighter
* cas
* naval_bomber
* interceptor
* interceptor
* suicide
* tactical_bomber
* tactical_bomber
* missile
* naval_bomber
* strategic_bomber
* strategic_bomber
* air_transport
* suicide
* missile
* submarine
* screen_ship
* capital_ship
* carrier


=== Group By types ===
=== Group By types ===
第83行: 第98行:


=== Interface Categories ===
=== Interface Categories ===
* interface_category_land
* interface_category_land
* interface_category_armor
* interface_category_armor
第91行: 第107行:


== Stats ==
== Stats ==
Equipment uses modifiers to determine which stats it confers to its assigned unit.
Equipment uses modifiers to determine which stats it confers to its assigned unit.


第114行: 第131行:
The following list is all the valid modifiers for use in equipment (and units):
The following list is all the valid modifiers for use in equipment (and units):


=== Base ===
=== All ===
<pre>
max_organisation = 20      # Organization - Organization indicates combat readiness and how organized a unit is. A unit with no organisation can't fight or move effectively.
reliability = 0.9        # Reliability - The lower the reliability, the more likely the equipment will suffer random failure
weight = 0.1           # Weight - How much the unit will weigh. Heavier units will require more transports to ship and perform invasions effectively.
maximum_speed = 4        # Max Speed - How quickly this unit can traverse terrain under optimal circumtances, in kilometres per hour
supply_consumption = 0.02    # Supply use - How much supply a unit consumes per day
default_morale = 0.3       # Recovery Rate - How much extra organisation can be regained hourly when not in combat
combat_width = 0.5
</pre>


=== Costs ===
<pre>
<pre>
lend_lease_cost = 1       # Space taken up in convoy
lend_lease_cost = 1       # Space taken up in convoy
build_cost_ic = 0.4       # Production Cost - How much factory output this piece of equipment needs
build_cost_ic = 0.4       # Production Cost - How much factory output this piece of equipment needs
manpower = 300          # Manpower - Cost in manpower to produce
manpower = 300          # Manpower - Cost in manpower to produce
training_time = 120       # Training time - Time in days to train this unit
can_license = no         # Can be licensed
is_convertable = yes       # Can be converted
</pre>
</pre>


=== Offensive ===
=== Land ===
 
==== Base ====
 
<pre>
reliability = 0.9        # Reliability - The lower the reliability, the more likely the equipment will suffer random failure
maximum_speed = 4        # Max Speed - How quickly this unit can traverse terrain under optimal circumtances, in kilometres per hour
</pre>
 
==== Offensive ====
 
<pre>
<pre>
# Offensive
# Offensive
attack = 0.1           # Firepower - Amount of damage done per attack
soft_attack = -0.1        # Soft Attack - How many attacks the unit can make versus enemies with low hardness
soft_attack = -0.1        # Soft Attack - How many attacks the unit can make versus enemies with low hardness
hard_attack = -0.5        # Hard Attack - How many attacks the unit can make versus enemies with high hardness
hard_attack = -0.5        # Hard Attack - How many attacks the unit can make versus enemies with high hardness
第144行: 第161行:
</pre>
</pre>


=== Defensive ===
==== Defensive ====
 
<pre>
<pre>
# Defensive
# Defensive
第154行: 第172行:
</pre>
</pre>


=== Unique ===
==== Unique ====
 
<pre>
<pre>
movement = 0.1          # Movement - Changes the unit's speed
experience_loss_factor = 0.1   # Exp. Loss - How much experience is lost in a division when they take casualities and have to replace them
casualty_trickleback = 0.2    # Trickleback - The proportion of losses in combat that can be saved and returned to the manpower pool
suppression_factor = 0.1     # Suppression bonus - Ability to supress local resistance
equipment_capture_factor = 0.1     # Ratio of equipment to be captured from an enemy division after battle win
reliability_factor = 0.05    # Reliability - Applies to an equipment type's reliability and reduces the chance of breakdowns and accidents
recon = 1            # Reconnaissance - Increases the chance that this unit can pick better tactics in battle
recon = 1            # Reconnaissance - Increases the chance that this unit can pick better tactics in battle
initiative = 0.2         # Initiative - The higher the initiative, the quicker it can reinforce into battle, and the quick is completes its planning
</pre>
</pre>


=== Boolean ===
=== Navy-specific ===
<pre>
can_be_parachuted = yes     # May be parachuted into battle
can_license = no         # Can be licesed
is_convertable = yes       # Can be converted
carrier_capable = yes      # Is usable in carriers (air only)
</pre>


=== Navy-specific ===
<pre>
<pre>
naval_speed = 28             # Max Speed - maximum speed in kilometres per hour of the ship, higher means faster in combat too
naval_speed = 28             # Max Speed - maximum speed in kilometres per hour of the ship, higher means faster in combat and contributes to evasion
fire_range = 32             # Fire Range - The range of the ship's main guns
fire_range = 32             # Fire Range - The range of the ship's main guns (OBSOLETE)
torpedo_attack = 1            # Torpedo attack - How much damage we can do when using the ship's torpedos
lg_armor_piercing = 12          # Light gun armor piercing - Determines how much armor ship's light gun attack can pierce
lg_attack = 18              # Light gun attack - How much damage the ship does with light guns (more effective against screens)
hg_armor_piercing = 25          # Heavy gun armor piercing - Determines how much armor ship's heavy gun attack can pierce
hg_attack = 12              # Heavy gun attack - How much damage the ship does with heavy guns (more effective against capitals and carriers)
torpedo_attack = 1            # Torpedo attack - How much damage we can do when using the ship's torpedos (more effective against capitals and carriers)
anti_air_attack = 5           # Anti-air - How much anti-air firepower the ship carries for shooting down enemy planes
anti_air_attack = 5           # Anti-air - How much anti-air firepower the ship carries for shooting down enemy planes
shore_bombardment = 8          # Shore Bombard - A unit's ability to do shore bombardment to help out in land battles neighbouring its sea province when on Hold mission
shore_bombardment = 8          # Shore Bombard - Ship's ability to help out in land battles neighbouring its sea province when on Hold mission (OBSOLETE, lg_attack and hg_attack determine shore bombardment)
evasion = 15               # Evasion - Ability for ships to evade enemy fire through maneuvering. Evasion is checked against enemy evasion, so high evasion improves hits against high evasion targets
evasion = 15               # Evasion - Ship's ability to evade enemy fire through maneuvering. (OBSOLETE, naval_speed contributes to evasion instead)
surface_detection = 12          # Surface detection - Ability to detect surface vessels
surface_detection = 12          # Surface detection - Ability to detect surface vessels
sub_attack = 10             # Anti-submarine attack - How much damage this ship deals to enemy submarines using depth charges
sub_detection = 5            # Sub detection - Ability to detect submarines
sub_detection = 5            # Sub detection - Ability to detect submarines
surface_visibility = 25         # Surface Visibility - How hard to find this ship is
surface_visibility = 25         # Surface Visibility - How easy to find this ship is (lower is better)
sub_visibility = 20           # Sub Visibility - How easy it is to detect this submarine
sub_visibility = 20           # Sub Visibility - How easy it is to detect this submarine (lower is better)
naval_range = 3000            # Naval Range - max distance in kilometres the ship can travel from it's nearest Naval Base
naval_range = 3000            # Naval Range - max distance in kilometres the ship can travel from it's nearest Naval Base
port_capacity_usage = 1         # Port capacity usage - How much room the ship requires in port
port_capacity_usage = 1         # Port capacity usage - How much room the ship requires in port
第198行: 第208行:
air_range = 500             # Range - How far away missions the plane can perform
air_range = 500             # Range - How far away missions the plane can perform
air_agility = 10             # Agility - How agile a plane is. Agility effects how easy it is to hit another plane, and avoid being hit
air_agility = 10             # Agility - How agile a plane is. Agility effects how easy it is to hit another plane, and avoid being hit
air_ground_attack = 100         # Ground Attack - damage done to ground forces during CAS missions
air_bombing = 300            # Strategic Bombing - how good the plane is at bombing
air_bombing = 300            # Strategic Bombing - how good the plane is at bombing
air_superiority = 1           # Air Superiority - How much the plane helps the overall air superiority of a strategic area
air_superiority = 1           # Air Superiority - How much the plane helps the overall air superiority of a strategic area
第204行: 第215行:
carrier_size = 0.05
carrier_size = 0.05
default_carrier_composition_weight = 1
default_carrier_composition_weight = 1
carrier_capable = yes      # Is usable in carriers (air only)
</pre>
</pre>



2024年8月9日 (五) 17:05的最新版本

Equipment

Equipment is found in /Hearts of Iron IV/common/units/equipment/*.txt. Equipment is split into two types, archetype and regular. Archetype equipment is used to assign more general attributes that regular equipment then inherits via the archetype attribute.

Archetype equipment follows the following format:

equipments = {
	<equipment> = {
		year = <int>		# Limits the equipment from appearing before the specified year. Optional
		picture = <name>	# GFX reference used to define equipment picture in lend-lease
		
		can_be_produced = {	# Optional, specifies when equipment of this category can be produced.
			<triggers>
		}
		
		is_archetype = yes	# Specifies an entry as an archetype entry. All non-archetype entries inherit 
		is_buildable = no	# Prevents this equipment from being built.
		active = yes		# Determines if this equipment is available without unlocking from a technology.
		
		type = <type>	   	# Internal type: what kind of unit can use this equipment

		group_by = <group>			  # How the equipment is grouped in the production screen
		interface_category = <type>	 # Which category the equipment appears in the production screen
		
		# Resources used to build this equipment
		resources = {
			<resource> = <amount>
		}
		
		# Modifiers the equipment uses
		<modifiers> 
	}
}

Regular equipment follows the following format:

equipments = {
    <equipment> = {
        year = <int>        # Limits the equipment from appearing before the specified year. Optional
        
        active = yes            # Determines if this equipment is available without unlocking from a technology.
        
        archetype = <equipment> # Which archetype equipment this equipment inherits from.
        parent = <equipment>    # Which equipment is parent to this equipment (i.e. which does it supercede)
        priority = <int>        # Priority for usage over other equipment.
        visual_level = <int>    # Image priority in production screen
        
        # Resources used to build this equipment
        resources = {
            <resource> = <amount>
        }
        
        # Modifiers the equipment uses
        <modifiers> 
    }
}

Internal Types

Land

  • anti-air
  • anti-tank
  • armor
  • artillery
  • infantry
  • motorized
  • mechanized
  • rocket
  • support

Naval

  • capital_ship
  • carrier
  • convoy
  • naval_transport
  • screen_ship
  • submarine

Air

  • air_transport
  • cas
  • fighter
  • interceptor
  • tactical_bomber
  • missile
  • naval_bomber
  • strategic_bomber
  • suicide

Group By types

  • archetype
  • type

Interface Categories

  • interface_category_land
  • interface_category_armor
  • interface_category_capital_ships
  • interface_category_screen_ships
  • interface_category_other_ships
  • interface_category_air

Stats

Equipment uses modifiers to determine which stats it confers to its assigned unit.

Typically an equipment will include the following:

build_cost_ic = <float>
lend_lease_cost = <float>
reliability = <float>
maximum_speed = <float>
defense = <float>
breakthrough = <float>
hardness = <float>
armor_value = <float>
soft_attack = <float>
hard_attack = <float>
ap_attack = <float>
air_attack = <float>

Note that the default maximum_speed is 4, so you don't need to include it when you want equipment to confer the default maximum_speed.

Modifiers

The following list is all the valid modifiers for use in equipment (and units):

All

lend_lease_cost = 1             # Space taken up in convoy
build_cost_ic = 0.4             # Production Cost - How much factory output this piece of equipment needs
manpower = 300                  # Manpower - Cost in manpower to produce
can_license = no                # Can be licensed
is_convertable = yes            # Can be converted

Land

Base

reliability = 0.9               # Reliability - The lower the reliability, the more likely the equipment will suffer random failure
maximum_speed = 4               # Max Speed - How quickly this unit can traverse terrain under optimal circumtances, in kilometres per hour

Offensive

# Offensive
soft_attack = -0.1              # Soft Attack - How many attacks the unit can make versus enemies with low hardness
hard_attack = -0.5              # Hard Attack - How many attacks the unit can make versus enemies with high hardness
air_attack = 1                  # Air Attack - How much damage we can do against airplanes. High Air Attack also helps to counter enemy Air Superiority effects
ap_attack = 1                   # Piercing - Having equal or greater Piercing to the targets Armor value allows you to do more damage.
breakthrough = 0.5              # Breakthrough - How many enemy attacks a unit can attempt to avoid while on the offensive, effectively allowing it to stay on the offense longer.

Defensive

# Defensive
defense = 0.1                   # Defense - How many enemy attacks a unit can avoid whilst on the defensive, effectively allowing it to stay on the defensive longer.
max_strength = 2                # HP - Strength represents how much damage this unit can suffer before it is destroyed
armor_value = 0                 # Armor - Armor that is higher than the opponents Piercing value reduces damage taken and allows more attacks to occur
hardness = 0.5                  # Hardness - Represents how much of your divsion is made up of armoured vehicles. High Hardness = High Hard Attacks, Low Soft Attack
entrenchment = 5                # Entrenchment - The ability to make proper defensive entrenchments before a hostile attack

Unique

recon = 1                       # Reconnaissance - Increases the chance that this unit can pick better tactics in battle

Navy-specific

naval_speed = 28                        # Max Speed - maximum speed in kilometres per hour of the ship, higher means faster in combat and contributes to evasion
fire_range = 32                         # Fire Range - The range of the ship's main guns (OBSOLETE)
lg_armor_piercing = 12                  # Light gun armor piercing - Determines how much armor ship's light gun attack can pierce
lg_attack = 18                          # Light gun attack - How much damage the ship does with light guns (more effective against screens)
hg_armor_piercing = 25                  # Heavy gun armor piercing - Determines how much armor ship's heavy gun attack can pierce
hg_attack = 12                          # Heavy gun attack - How much damage the ship does with heavy guns (more effective against capitals and carriers)
torpedo_attack = 1                      # Torpedo attack - How much damage we can do when using the ship's torpedos (more effective against capitals and carriers)
anti_air_attack = 5                     # Anti-air - How much anti-air firepower the ship carries for shooting down enemy planes
shore_bombardment = 8                   # Shore Bombard - Ship's ability to help out in land battles neighbouring its sea province when on Hold mission (OBSOLETE, lg_attack and hg_attack determine shore bombardment)
evasion = 15                            # Evasion - Ship's ability to evade enemy fire through maneuvering. (OBSOLETE, naval_speed contributes to evasion instead)
surface_detection = 12                  # Surface detection - Ability to detect surface vessels
sub_attack = 10                         # Anti-submarine attack - How much damage this ship deals to enemy submarines using depth charges
sub_detection = 5                       # Sub detection - Ability to detect submarines
surface_visibility = 25                 # Surface Visibility - How easy to find this ship is (lower is better)
sub_visibility = 20                     # Sub Visibility - How easy it is to detect this submarine (lower is better)
naval_range = 3000                      # Naval Range - max distance in kilometres the ship can travel from it's nearest Naval Base
port_capacity_usage = 1                 # Port capacity usage - How much room the ship requires in port
search_and_destroy_coordination = 0.1
convoy_raiding_coordination = 0.1

Air-specific

air_attack = 50                         # Air Attack - amount of damage done against other planes
air_defence = 50                        # Air Defence - how many hits a plane takes before being shot down
air_range = 500                         # Range - How far away missions the plane can perform
air_agility = 10                        # Agility - How agile a plane is. Agility effects how easy it is to hit another plane, and avoid being hit
air_ground_attack = 100                 # Ground Attack - damage done to ground forces during CAS missions
air_bombing = 300                       # Strategic Bombing - how good the plane is at bombing
air_superiority = 1                     # Air Superiority - How much the plane helps the overall air superiority of a strategic area
naval_strike_attack = 1.5               # Naval Attack - how much damage the plane does against ships
naval_strike_targetting = 0.5           # Naval Targeting - how likely the plane is to hit a ship
carrier_size = 0.05
default_carrier_composition_weight = 1
carrier_capable = yes           # Is usable in carriers (air only)

Localization

Each equipment must be localized in a .yml file in the localisation folder within your mod.

<equipment>: ""
<equipment>_desc: ""
<equipment>_short: ""

For country-specific localization, prefix with the tag:

<tag>_<equipment>: ""
<tag>_<equipment>_desc: ""
<tag>_<equipment>_short: ""