Particle modding:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.5
(汉化)
无编辑摘要
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
{{version|1.5}}
{{version|1.5}}
{{需要翻译|译者=霜泽图书馆}}


粒子是一种用来创造闪电、雪等视觉效果的特殊实体。
Particles are special entities used by other entities to create visual effects such as lightning, snow, etc.


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


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


== Particle Editor ==
{{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.
== 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 = {
第44行: 第48行:
      maxValue = <float>
      maxValue = <float>
      curve = {
      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
      }
      }
    }
    }
}
}
</pre>
</pre>
* '''name''' 是你所要定义闪光效果的名字。
* '''name''' is the name of the light.
* '''color''' 定义了光的颜色,通过十进制的RGB取值。
* '''color''' is the color of the light. The values take decimal RGB.
* '''intensity''' 决定了光的强度,而第二个值则决定了光是否会渐渐消失。
* '''intensity''' is the intensity of the light, and the second value is whether it fades.
* '''radius''' 是光的半径。
* '''radius''' is the radius of the light.
* '''falloff''' 是光的衰减梯度。
* '''falloff''' is the falloff gradient of the light.
* '''position''' 是相对于发生光的实体的位置。
* '''position''' is the position of the light relative to the entity using it.
* '''animation''' 闪光发生时的动画。
* '''animation''' is animation to play for the light.


=== 动画 ===
=== Animation ===
{{SVersion|1.5}}
{{SVersion|1.5}}
* '''name''' 是你要定义的动画的名字。
* '''name''' is the name of the animation.
* '''start''' 是曲线的起始位置。
* '''start''' is the starting position of the curve.
* '''duration''' 是动画的持续时间。
* '''duration''' is the duration of the animation.
* '''repeat''' 决定了动画是否重复。
* '''repeat''' determines whether the animation is repeated.
* '''op''' 决定了多个源如何混合。可以是乘法(MUL) ,加法(ADD) 或绝对值(ABS)
* '''op''' determines how multiple sources mix. Can be multiply (MUL), additive (ADD) or absolute (ABS).
* '''minValue''' 是曲线上的最小值。
* '''minValue''' is the minimum value on the curve.
* '''maxValue''' 是曲线上的最大值。
* '''maxValue''' is the maximum value on the curve.
* '''curve''' 是使用在光上的曲线。
* '''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 />
 
 
{{Modding navbox}}
{{Modding navbox}}
[[分类:Modding]]
[[分类:Modding]]

2024年10月27日 (日) 15:46的最新版本

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 /Hearts of Iron IV/gfx/particles/.

Adding a Particle

Particle Editor

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.

Adding a Light

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:

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 is the name of the light.
  • color is the color of the light. The values take decimal RGB.
  • intensity is the intensity of the light, and the second value is whether it fades.
  • radius is the radius of the light.
  • falloff is the falloff gradient of the light.
  • position is the position of the light relative to the entity using it.
  • animation is animation to play for the light.

Animation

  • name is the name of the animation.
  • start is the starting position of the curve.
  • duration is the duration of the animation.
  • repeat determines whether the animation is repeated.
  • op determines how multiple sources mix. Can be multiply (MUL), additive (ADD) or absolute (ABS).
  • minValue is the minimum value on the curve.
  • maxValue is the maximum value on the curve.
  • 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".