Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-08-2011, 09:07 PM
callimuc callimuc is offline
ジ
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
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?
__________________
MEEP!
Reply With Quote
  #2  
Old 07-08-2011, 09:34 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
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?
Reply With Quote
  #3  
Old 07-08-2011, 09:51 PM
callimuc callimuc is offline
ジ
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
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

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 View Post
I'm assuming this winds up making a spiral?
Jea the weapon name from testbed is noted above.
__________________
MEEP!
Reply With Quote
  #4  
Old 07-08-2011, 10:08 PM
callimuc callimuc is offline
ジ
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
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.
__________________
MEEP!
Reply With Quote
  #5  
Old 07-08-2011, 10:15 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
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
Reply With Quote
  #6  
Old 07-08-2011, 10:28 PM
callimuc callimuc is offline
ジ
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Ah ok now I understood thanks
__________________
MEEP!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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