Particle modding: Difference between revisions

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


Particles are special entities used by other entities to create visual effects such as lightning, snow, etc.
粒子是特殊的实体模型,被其他实体模型用来创建诸如闪电、雪等视觉效果。


Particles are defined in '''.asset''' files which are found in {{path|gfx/particles/}}.
粒子效果定义在 '''.asset''' 文件中,这些文件位于 {{path|gfx/particles/}}.


== Adding a Particle ==
== 添加粒子效果 ==
{{SVersion|1.5}}
{{SVersion|1.5}}


== Particle Editor ==
== 粒子效果编辑器 ==
{{SVersion|1.5}}
{{SVersion|1.5}}


The particle editor can be accessed by adding ''exclusively'' '''-editor''' to your launch options in Steam and '''reverting to 1.11'''; anything earlier will result in a non functional launcher, anything later will result in a crash upon trying to access the editor. '''Since the particle editor can't access new particles made by the mod, it is necessary to overwrite vanilla particles, move the edited particles to your mod files, and then verify integrity after you've finished.''' The particle editor can access any vanilla entity, mesh, or particle; once accessed, the vanilla particle can then be edited to fit your needs.
可以通过在 Steam 的启动选项中添加 '''-editor''' ''' 回退到 1.11 版本''' 来访问粒子编辑器;使用任何更早的版本将导致启动器无法运行,使用任何更晚的版本将在尝试使用编辑器时导致崩溃。由于粒子编辑器无法访问由模组创建的新粒子,''' 因此有必要覆盖原版粒子,将编辑后的粒子移动到你的模组文件中,然后在完成后验证完整性。''' 粒子编辑器可以访问任何原版实体、网格或粒子效果;一旦访问后,可以根据需要编辑原版粒子效果。
== Adding a Light==
== 添加光效==
{{SVersion|1.5}}
{{SVersion|1.5}}


Lights are special types of particles that are referred to in entities, for example the muzzle flash of the gun during the combat animation.
光效是在实体模型中被引用的特殊类型粒子效果,例如在战斗动画中的枪口闪光。


Here is a generic example:
以下是一个通用的例子:
<pre>
<pre>
light = {
light = {
Line 54: Line 54:
}
}
</pre>
</pre>
* '''name''' is the name of the light.
* '''name''' 是光效的名称。
* '''color''' is the color of the light. The values take decimal RGB.
* '''color''' 是光效的颜色。取值为十进制 RGB
* '''intensity''' is the intensity of the light, and the second value is whether it fades.
* '''intensity''' 是光效的强度,第二个值表示它是否会渐隐。
* '''radius''' is the radius of the light.
* '''radius''' 是光效的半径。
* '''falloff''' is the falloff gradient of the light.
* '''falloff''' 是光效的衰减梯度。
* '''position''' is the position of the light relative to the entity using it.
* '''position''' 是光效相对于使用它的实体的位置。
* '''animation''' is animation to play for the light.
* '''animation''' 是光效要播放的动画。


=== Animation ===
=== 动画 ===
{{SVersion|1.5}}
{{SVersion|1.5}}
* '''name''' is the name of the animation.
* '''name''' 是动画的名称。
* '''start''' is the starting position of the curve.
* '''start''' 是曲线的起始位置。
* '''duration''' is the duration of the animation.
* '''duration''' 是动画的持续时间。
* '''repeat''' determines whether the animation is repeated.
* '''repeat''' 决定动画是否重复播放。
* '''op''' determines how multiple sources mix. Can be multiply (MUL), additive (ADD) or absolute (ABS).
* '''op''' 决定多个源如何混合。可以是乘法 (MUL) 、加法 (ADD) 或绝对值 (ABS)
* '''minValue''' is the minimum value on the curve.
* '''minValue''' 是曲线上的最小值。
* '''maxValue''' is the maximum value on the curve.
* '''maxValue''' 是曲线上的最大值。
* '''curve''' is the curve used for the light; each set of two decimals denote an x and y position on the curve graph, the game uses these points to calculate a change in whatever the animation is interacting with. The amount of decimals should always be even; the max y value is determined by "maxValue" argument, the min y value is determined by the "minValue" argument, the max x value is determined by "duration" and the min x value is determined by "start". You can have as many sets of decimals as you want but the last x coordinate must match with the duration and the first must match with "start".<br />
* '''curve''' 是用于光效的曲线;每组有两个小数表示曲线图上的 x y 位置,游戏使用这些点来计算动画所交互的变化。小数的数量应始终为偶数;最大 y 值由 "maxValue" 参数确定,最小 y 值由 "minValue" 参数确定,最大 x 值由 "duration" 确定,最小 x 值由 "start" 确定。你可以有任意数量的小数组,但最后一个 x 坐标必须与 duration 匹配,第一个必须与 start 匹配。
<br />
{{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 匹配。