Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => JavaScript development => Topic started by: fly77 on November 09, 2019, 06:41:23 am

Title: water paticle spray without light flash ?
Post by: fly77 on November 09, 2019, 06:41:23 am
For my rowboat I'd like to add watersplashes but I found that using the explosions interface create_solid_particle method there allways seem to be associated a light flash. How can I get rid of this light flash ?
I couldn't figure out how to do it  even adding also the float4& hcolor vector whatever values I had set for this last vector. That's quite annoying as you can see in the screenshot   :-[

Code: [Select]
this.explosions.create_solid_particles(
            ecef_water_particles,   //@param pos ECEF world position
            this.norm,             //@param norm smoke ejection direction
            0.15,                    //@param emitter_radius radius
            0.05,                 //@param particle_radius max particle radius
            3,                 //@param speed ejection speed
            0.4,              //@param spread direction dissipation
            1.2,               //@param highlight 0:solid, 1+:water spray
            0,                  //@param age age in seconds at t
            { x: 1.2, y: 1.2, z: 1.2 }, 0);  //@param bcolor base particle color       
 
   

(https://i.postimg.cc/7ZWYSMMR/luminescent-water.jpg) (https://postimg.cc/Bj200Fz5)
Title: Re: water paticle spray without light flash ?
Post by: fly77 on November 10, 2019, 04:04:05 pm
If it is not possible to disable or regulate light intensity in the explosion particle command is there another way (evtl through plugin) to access these particle effects bypassing the light flash ? Of course i could create spawning an throwing myself lots of white sphere "vehicles" and destroy them after a certain age..but that seems too crazy an idea even for me  =|
Title: Re: water paticle spray without light flash ?
Post by: cameni on November 11, 2019, 05:41:46 am
It's not possible, but there may be a stupid workaround - seems the light is not created if the world is paused. So if you call pause(true, false) on the world before creating the explosion and then restore it back with pause(false, false) maybe you get what you need :D
Title: Re: water paticle spray without light flash ?
Post by: fly77 on November 11, 2019, 12:45:09 pm
woaah ! it works ! Thank you so much for this rapid solution !  :)

(https://i.postimg.cc/ZYdsMxd6/fishing-at-night.jpg) (https://postimg.cc/Yjtx4g8S)

 
Code: [Select]
world.pause(true,false);
                this.explosions.create_solid_particles(
                    ecef_tail_wake,   //@param pos ECEF world position
                     direc2,             //@param norm smoke ejection direction
                    0.1*0.05*velocity,                    //@param emitter_radius radius
                    0.03,                 //@param particle_radius max particle radius
                    0.5*Math.pow(velocity,1.2),                 //@param speed ejection speed
                    0.1,              //@param spread direction dissipation
                    1,               //@param highlight 0:solid, 1+:water spray
                    0,                  //@param age age in seconds at t
                    { x: 1, y: 1, z:1 },{ x: 0, y: 0, z: 0, w:0 });  //@param bcolor base particle color
                   
             world.pause(false,false);