Particle Script Examples and Experiments

WIP

Scripts that are working as is

You can edit vanilla .pu scripts to see the code, they are located in the kenshi/data/particles/scripts folder. Please do not save over vanilla scripts.

Click expand to see code

Working Examples
Ridiculously Large Corpse FireFlies
Ridiculously Large Corpse FireFlies
system Firefly
 {
       scale_velocity                              0.03
       scale                                       0.03 0.03 0.03
       technique 
       {
           visual_particle_quota                   1200
           material                                FF_kenshi_light_point
           default_particle_width                  300
           default_particle_height                 300
           default_particle_depth                  300
           renderer                                Billboard
           {
               billboard_rotation_type             vertex
           }
           emitter                                 Circle 
           {
               emission_rate                       dyn_random
               {
                   min                             4
                   max                             6
               }
               velocity                            dyn_random
               {
                   min                             100
                   max                             200
               }
               radius                              1200
           }
           affector                                Vortex Affector
           {
               position                            0 200 0
               rotation_axis                       0 0 1
               rotation_speed                      dyn_oscillate
               {
                   oscillate_frequency             0
                   oscillate_phase                 1
                   oscillate_base                  1
                   oscillate_amplitude             -3
                   oscillate_type                  sine
               }
           }
           affector                                Gravity Affector
           {
               position                            0 200 0
               mass_affector                       0
               gravity                             0
           }
           affector                                Randomiser Affector
           {
               max_deviation_x                     12
               max_deviation_y                     12
               max_deviation_z                     12
           }
           affector                                Colour Affector
           {
               time_colour                         0    0 0 0 0
               time_colour                         0.3 0.6    0.90 0.40 1
               time_colour                         0.4 0.71 1 0.5 1
               time_colour                         1    0 0 0 0
           }
       }
   }


row2 title
Code 2 title
row3 title
Code 3 title

Scripts that have failed

Click expand to see code

Random Experiments
Multiple Flames Per Object
Multiple Flames Per Object
system multi_flame_fire
  {
      category                                     kenshi_particles
      //  Flame Source 1
      technique
      {
          material                                 kenshi_fire_flame1
          // make sure defaults are large enough
          default_particle_width   1600
          default_particle_height  1600
          default_particle_depth   1600
          renderer                                  Billboard { billboard_rotation_type vertex }
          emitter                                 SphereSurface Flame1
          {
              emission_rate       300
              angle               180
              time_to_live        dyn_random { min 0.4 max 1.2 }
              velocity            dyn_random { min 0 max 3 }
              all_particle_dimensions dyn_random { min 4000 max 8000 }
              start_colour_range  0.537255 0.14902 0.054902 1
              end_colour_range    0.9 0.4 0.2 1
              radius              0.2
              position            5 0 5
          }
          affector LinearForce { force_vector 0 50 0 }
      }
      //  Flame Source 2
      technique
      {
          material kenshi_fire_flame1
          default_particle_width   1600
          default_particle_height  1600
          default_particle_depth   1600
          renderer Billboard { billboard_rotation_type vertex }
         emitter                                 SphereSurface Flame2
          {
              emission_rate       300
              angle               180
              time_to_live        dyn_random { min 0.4 max 1.2 }
              velocity            dyn_random { min 0 max 3 }
              all_particle_dimensions dyn_random { min 4000 max 8000 }
              start_colour_range  0.537255 0.14902 0.054902 1
              end_colour_range    0.9 0.4 0.2 1
              radius              0.2
              position            -5 0 5
          }
          affector LinearForce { force_vector 0 50 0 }
      }
      //  Flame Source 3
      technique
      {
          material                                kenshi_fire_flame1
          default_particle_width   1600
          default_particle_height  1600
          default_particle_depth   1600
          renderer Billboard { billboard_rotation_type vertex }
          emitter                                 SphereSurface Flame3
          {
              emission_rate       300
              angle               180
              time_to_live        dyn_random { min 0.4 max 1.2 }
              velocity            dyn_random { min 0 max 3 }
              all_particle_dimensions dyn_random { min 4000 max 8000 }
              start_colour_range  0.537255 0.14902 0.054902 1
              end_colour_range    0.9 0.4 0.2 1
              radius              0.2
              position            5 0 -5
          }
          affector LinearForce { force_vector 0 50 0 }
      }
  }
 
Multiple Flames from single source failed, cause apparently Kenshi does not allow resizing particles when they are far from the source. I tried this even with a circle emitter. In this image I have two effects set to the torch; the vanilla original (center) and my multi-particle flame script. Better result comes just adding multiple building parts to the torch, each having one effect. This way we can reduce physics clutter, but keep the multiple flames.
row2 title
Code 2 title
row3 title
Code 3 title
ā§¼visualeditor-table-captionā§½
Header cellHeader cell
Content cellContent cell
This article is adapted from Particle Script Examples and Experiments on the Kenshi Fandom wiki, written by its contributors and licensed under CC BY-SA 3.0. It has been converted to Markdown, and its images and navigation boxes were left out.