Particle modding: Difference between revisions

本页面所适用的版本可能已经过时,最后更新于1.5
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{需要翻译|译者=霜泽图书馆}}
{{需要翻译|译者=霜泽图书馆}}


Posteffects are color correction effects that are applied to the lighting in certain areas (volumes) on the map map. They are used to tint the lighting for areas where the lighting would be noticable different, i.e. deserts.
粒子是特殊的实体模型,被其他实体模型用来创建诸如闪电、雪等视觉效果。


All posteffects are found in {{path|gfx/posteffect_volumes.txt}}.
粒子效果定义在 '''.asset''' 文件中,这些文件位于 {{path|gfx/particles/}}.


== Posteffect Values ==
== 添加粒子效果 ==
{{SVersion|1.5}}
{{SVersion|1.5}}


A posteffect values entry follows this format:
== 粒子效果编辑器 ==
{{SVersion|1.5}}
 
可以通过在 Steam 的启动选项中添加 '''-editor''' 并'''回退到 1.11 版本'''来访问粒子编辑器;使用任何更早的版本将导致启动器无法运行,使用任何更晚的版本将在尝试使用编辑器时导致崩溃。由于粒子编辑器无法访问由模组创建的新粒子,'''因此有必要覆盖原版粒子,将编辑后的粒子移动到你的模组文件中,然后在完成后验证完整性。'''粒子编辑器可以访问任何原版实体、网格或粒子效果;一旦访问后,可以根据需要编辑原版粒子效果。
== 添加光效==
{{SVersion|1.5}}
 
光效是在实体模型中被引用的特殊类型粒子效果,例如在战斗动画中的枪口闪光。


以下是一个通用的例子:
<pre>
<pre>
posteffect_values = {
light = {
    name = <name>
    name = "name_of_light"
   inherit = <name>
    
    
    lut = <path>
    color = {
     r = { <float> }
     g = { <float> }
     b = { <float> }
   }
    
    
    hdr_min_adjustment = <float>
    intensity = <float>, fade
    hdr_max_adjustment = <float>
    radius = <float>
   falloff = <float>
    
    
    BLOOM_WIDTH = <float>
    position = {
   BLOOM_SCALE = <float>
     x = <float>
   BRIGHT_THRESHOLD = <float>
     y = <float>
    
     z = <float>
   tonemap_middlegrey = <float>
    }
    
    
}
   animation = {
</pre>
     name = "name_of_animation"
 
     start = <float>
'''name''' is the name of the posteffect values entry.
      duration = <float>
 
      repeat = yes
'''inherit''' causes the values for the current posteffect to be inherited from the specified posteffect.
      op = <type>
 
      minValue = <float>
'''lut''' is the path for the tone map used for this entry.
      maxValue = <float>
 
      curve = {
'''hdr_min_adjustment''' defines the minimum adjustment used in the HDR effect.
        <decimal> <decimal> <decimal> <decimal> <decimal> <decimal>
 
        #example: 0.000 0.000 0.250 1.000 0.500 0.500 0.750 0.000 1.000 1.000
'''hdr_max_adjustment''' defines the maximum adjustment used in the HDR effect.
 
'''BLOOM_WIDTH''' defines the width of the bloom effect.
 
'''BLOOM_SCALE''' defines the scale of the bloom effect.
 
'''BRIGHT_THRESHOLD''' defines the threshold of the bloom effect.
 
'''tonemap_middlegrey''' defines the middle grey used in the tone map.
 
== Volumes ==
{{SVersion|1.5}}
 
=== Position Volume ===
A volume entry specifies an area on the map in which posteffect values are applied. It follows this format:
 
<pre>
posteffect_volumes = {
   posteffect_volume = {
      name = <name>
      posteffect_values_day = <name>
      posteffect_values_night = <name>
      posteffect_values_day_winter = <name>
      posteffect_values_night_winter = <name>
      
     position = {
        <x>
       <y>
        <z>
      }
      }
     size = {
       <width>
       <height>
       <depth>
     }
     fade_distance = <float>
    }
    }
}
}
</pre>
</pre>
* '''name''' 是光效的名称。
* '''color''' 是光效的颜色。取值为十进制 RGB。
* '''intensity''' 是光效的强度,第二个值表示它是否会渐隐。
* '''radius''' 是光效的半径。
* '''falloff''' 是光效的衰减梯度。
* '''position'''是光效相对于使用它的实体的位置。
* '''animation'''是光效要播放的动画。


'''name''' is the name of the volume entry.
=== 动画 ===
 
'''posteffect_values_day''' is the posteffect values entry to use during the day.
 
'''posteffect_values_night''' is the posteffect values entry to use during the night.
 
'''posteffect_values_day_winter''' is the posteffect values entry to use during the day during winter months.
 
'''posteffect_values_night_winter''' is the posteffect values entry to use during the night during winter months.
 
'''position''' defines the location of the volume center.
 
'''size''' defines the size of the volume box.
 
'''fade_distance''' defines the fade distance for the posteffect values.
 
=== Height Volume ===
{{SVersion|1.5}}
{{SVersion|1.5}}
A height volume entry specifies a height at which to apply posteffect values. It follows this format:
* '''name'''是动画的名称。
 
* '''start''' 是曲线的起始位置。
<pre>
* '''duration'''是动画的持续时间。
posteffect_volumes = {
* '''repeat''' 决定动画是否重复播放。
   posteffect_height_volume = {
* '''op''' 决定多个源如何混合。可以是乘法 (MUL)、加法 (ADD) 或绝对值 (ABS)。
     name = <name>
* '''minValue''' 是曲线上的最小值。
     posteffect_values_day = <name>
* '''maxValue''' 是曲线上的最大值。
     posteffect_values_night = <name>
* '''curve''' 是用于光效的曲线;每组有两个小数表示曲线图上的 x 和 y 位置,游戏使用这些点来计算动画所交互的变化。小数的数量应始终为偶数;最大 y 值由 "maxValue" 参数确定,最小 y 值由 "minValue" 参数确定,最大 x 值由 "duration" 确定,最小 x 值由 "start" 确定。你可以有任意数量的小数组,但最后一个 x 坐标必须与 duration 匹配,第一个必须与 start 匹配。
    
<br />
     height = <float>
     fade_distance = <float>
   }
}
</pre>
 
'''name''' is the name of the volume entry.
 
'''posteffect_values_day''' is the posteffect values entry to use during the day.
 
'''posteffect_values_night''' is the posteffect values entry to use during the night.
 
'''height''' defines at which height the values are applied.
 
'''fade_distance''' defines the fade distance for the posteffect values.
 
== Tips ==
{{SVersion|1.5}}
Make use of the console commands: <code>PostEffectVolumes.Enabled</code> and <code>PostEffectVolumes.Draw</code> when working with posteffects. Currently developer-only.
 
You can reload posteffects by using <code>reload posteffectvolumes</code> in the console.
 
 
{{Modding navbox}}
{{Modding navbox}}
[[分类:Modding]]
[[分类:Modding]]

Latest revision as of 20:04, 4 February 2025

粒子是特殊的实体模型,被其他实体模型用来创建诸如闪电、雪等视觉效果。

粒子效果定义在 .asset 文件中,这些文件位于 /Hearts of Iron IV/gfx/particles/.

添加粒子效果

粒子效果编辑器

可以通过在 Steam 的启动选项中添加 -editor回退到 1.11 版本来访问粒子编辑器;使用任何更早的版本将导致启动器无法运行,使用任何更晚的版本将在尝试使用编辑器时导致崩溃。由于粒子编辑器无法访问由模组创建的新粒子,因此有必要覆盖原版粒子,将编辑后的粒子移动到你的模组文件中,然后在完成后验证完整性。粒子编辑器可以访问任何原版实体、网格或粒子效果;一旦访问后,可以根据需要编辑原版粒子效果。

添加光效

光效是在实体模型中被引用的特殊类型粒子效果,例如在战斗动画中的枪口闪光。

以下是一个通用的例子:

light = {
    name = "name_of_light"
    
    color = {
        r = { <float> }
        g = { <float> }
        b = { <float> }
    }
    
    intensity = <float>, fade
    radius = <float>
    falloff = <float>
    
    position = {
        x = <float>
        y = <float>
        z = <float>
    }
    
    animation = {
        name = "name_of_animation"
        start = <float>
        duration = <float>
        repeat = yes
        op = <type>
        minValue = <float>
        maxValue = <float>
        curve = {
            <decimal> <decimal> <decimal> <decimal> <decimal> <decimal>
            #example: 0.000 0.000 0.250 1.000 0.500 0.500 0.750 0.000 1.000 1.000
        }
    }
}
  • name 是光效的名称。
  • color 是光效的颜色。取值为十进制 RGB。
  • intensity 是光效的强度,第二个值表示它是否会渐隐。
  • radius 是光效的半径。
  • falloff 是光效的衰减梯度。
  • position是光效相对于使用它的实体的位置。
  • animation是光效要播放的动画。

动画

  • name是动画的名称。
  • start 是曲线的起始位置。
  • duration是动画的持续时间。
  • repeat决定动画是否重复播放。
  • op决定多个源如何混合。可以是乘法 (MUL)、加法 (ADD) 或绝对值 (ABS)。
  • minValue是曲线上的最小值。
  • maxValue是曲线上的最大值。
  • curve是用于光效的曲线;每组有两个小数表示曲线图上的 x 和 y 位置,游戏使用这些点来计算动画所交互的变化。小数的数量应始终为偶数;最大 y 值由 "maxValue" 参数确定,最小 y 值由 "minValue" 参数确定,最大 x 值由 "duration" 确定,最小 x 值由 "start" 确定。你可以有任意数量的小数组,但最后一个 x 坐标必须与 duration 匹配,第一个必须与 start 匹配。