Author Message

amilmand

00
Posts: 259

Location: ---
Occupation:
Age:
V$:
#136133   2018-01-22 20:41          
particleRender = new RenderRef(particles:0x00000106r);
particleRender.load();
particleRef = new ParticleSystem(map,particleRender,"scriptParticle");
particleRef.setSource("particle1", new Vector3(0,1.0,0), 0.01, 0.3, new Vector3(0,4.0,0), 0.0, 1.5, 1000.0, null);
particleRef.setFreq(1000.0);

You should stick to the one source/particle system approach.
You can set multiple sources (either with this setSource or the setDirectSource function) but if you want multiple sources for one system you have to take into consideration that there is one default source at the parent-(0,0,0) (this parent must be a GroundRef) which you can not move and if you dont use all the frequency present in the particle system by default, then you will have more sources than intended.
Also if you set the frequency with the setFreq call on the particle system the source structure will collapse and only the first manually set source will spawn particles (but this way you can circumvent the (0,0,0) source problem(I'm fairly sure this is not intended))
You must keep the reference alive (at least one reference in some class so the GC wont delete it)
You must load the particle type with an explicit call to load() or you will need to wait for the engine to load it itself and only after it has been loaded can you create the actual particle system or it will silently fail (all calls will silently fail).
You can stop the particle system by destroying it with a destroy() or finalize() call.

particleRef.setSource("particle1", //the name for the source you can stop a particular source with a delAction( String name ); call on the particle system
                      new Vector3(0,1.0,0), //position of source
                      0.01, //the min radius of spawning (wide or narrow waterfall)
                      0.3, //max radius 
                      new Vector3(0,4.0,0), //velocity vector this will be added to the velocity that is generated from the cfg
                      0.0, //velocity scale minimum the velocity from the cfg will be scaled at least by this amount 
                      1.5, //velocity scale max
                      1000.0, //frequency but this is subject to the particle density defined at the offset 0x00618948 (same as the setting in options)
                      null); //bone name no clue...

This post was edited by amilmand (2018-01-24 03:55, ago)