Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Particle Effects (https://forums.graalonline.com/forums/showthread.php?t=134263795)

callimuc 07-08-2011 09:07 PM

Particle Effects
 
Hey there. I was just testing around with Particle Effects and I guess its not that hard but still got this question:

What exactly do this commands do and when/for what/... do I use them?
(These are just out of a Particle Effect script I found)

PHP Code:

emitter.addemitmodifier("impulse", 0.115, 0.115, "angle", "add", degtorad(5), degtorad(5));
emitter.addglobalmodifier("impulse", 0.05, 0.05, "angle", "add", degtorad(-12.5), degtorad(-12.5)); 

And I guess there is also stuff like emitter.removemitmodifier() and so on. Could someone explain how all that works?

Mark Sir Link 07-08-2011 09:34 PM

add emit modifier means the default particle settings defined previously are being modified.

add global modifier means all existing particles will be modified.

add local modifier will modify all of the particles individually.

so something like

emitter.addemitmodifier("impulse", 0.115, 0.115, "angle", "add", degtorad(5), degtorad(5));

would cause the angle the particle launches at to increase by 5 degrees every .115 seconds

emitter.addglobalmodifier("impulse", 0.05, 0.05, "angle", "add", degtorad(-12.5), degtorad(-12.5));

would cause all existing particles to move -12.5 degrees every .05 seconds.

I'm assuming this winds up making a spiral?

callimuc 07-08-2011 09:51 PM

Ah thx. I guess I understand it more now :) The weapon is from (WNPC: Shared/ParticleEffectsHelpByDaisuke) and there have been similar comments added but didn´t really understand :mad:

Just to make sure:
PHP Code:

emitter.addemitmodifier("impulse", 1, 3, "angle", "add", degtorad(2), degtorad(10)); 

Would increase the angle of the particle randomly between 1 and 3 secconds by randomly 2 and 10 degrees?


But one more question I didnt´t really understand:
The "impulse" and the "add" parts what are they good for? At the particle editor someone (I guess it was DrakilorP2P) made once I already messed around but never really saw any differences:\


Quote:

Originally Posted by Mark Sir Link (Post 1657961)
I'm assuming this winds up making a spiral?

Jea the weapon name from testbed is noted above.

callimuc 07-08-2011 10:08 PM

Oh and one more question xD

I saw often some particles where the particles where removed "slowly". Like instead of being destroyed immediately the alpha was like reducing till it was 0. How could I do that? I just know the emitter.particle.lifetime = 2; where they get destroyed immediately.

Mark Sir Link 07-08-2011 10:15 PM

addlocalmodifier("range", 0.05, 2, "alpha", "replace", 0.99, 0); would reduce the alpha of the particle from 1 to 0 in the given timeframe of .05 to 2 seconds of it's lifetime.

Your question about addemitmodifier seems a bit vague - what it would do is change the angle at which particles are launched, but not modify it when it's in flight. addemitmodifier only effects what happens when a particle is initially fired, after it is in flight, global/local modifiers control what the particles do from there.

the parameters for each of the functions are as follows

addlocalmodifier(type, rangemin, rangemax, variable, variable modification, valuemin, valuemax)

Types - once, impulse, range - modifies the particle one time, periodically or only in the given time range
rangemin - seconds, minimum delay until first modification or start of modification range (if modifier is "range")
rangemax - seconds, maximum delay until first modification or end of modification range (if modifier is "range")
variable - x,y,z,movex,movey,movez,angle,zangle,speed,rotatio n,spin,stretchx,stretchy,red,green,blue,alpha or zoom
variable modification type - replace,add or multiply (if modifier type is "range" then only "replace" and "add" are valid)
valuemin - range start of the random value or first value to set/add (if modifier is "range")
valuemax - range end of the random value or last value to set/add (if modifier is "range")

from http://wiki.graal.net/index.php/Part...icle_modifiers

callimuc 07-08-2011 10:28 PM

Ah ok now I understood thanks


All times are GMT +2. The time now is 05:54 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.