Particle modding:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.5
无编辑摘要
无编辑摘要
 
第2行: 第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.
Particles are special entities used by other entities to create visual effects such as lightning, snow, etc.


All posteffects are found in {{path|gfx/posteffect_volumes.txt}}.
Particles are defined in '''.asset''' files which are found in {{path|gfx/particles/}}.


== Posteffect Values ==
== Adding a Particle ==
{{SVersion|1.5}}
{{SVersion|1.5}}


A posteffect values entry follows this format:
== 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}}
 
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>
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''' 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.


'''name''' is the name of the volume entry.
=== Animation ===
 
'''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''' is the name of the animation.
 
* '''start''' is the starting position of the curve.
<pre>
* '''duration''' is the duration of the animation.
posteffect_volumes = {
* '''repeat''' determines whether the animation is repeated.
   posteffect_height_volume = {
* '''op''' determines how multiple sources mix. Can be multiply (MUL), additive (ADD) or absolute (ABS).
     name = <name>
* '''minValue''' is the minimum value on the curve.
     posteffect_values_day = <name>
* '''maxValue''' is the maximum value on the curve.
     posteffect_values_night = <name>
* '''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 />
    
     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]]

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".