|
Registered User
Join Date: Sep 2011
Location: Germany
Posts: 6,122
|
|
@Callimuc, so it mainly makes the particle movement or ,as it's said, "replace" the alpha to make it 0 smoothly without sudden death? I want more basically the creation of each particle as a sprite. Is that in a Gani editor or something?
|
Yea. Without that the particles would only move to the angle you have setted (if you didnt set any its 0 so it would move to that angle). You can do different stuff with that, like reducing/rising the alpha of the particle after a certain ammount of seconds withing a certain ammount of seconds (like start lowering the alpha after 3 seconds from 1 to 0 within 0.5 seconds). same can be done with the movement (changing the x/y, angle, ...) and more.
An example for your alpha thing would be:
(SCRIPT and SCRIPTEND is because i prefer to do particle effects as gani scripts. simply put that into a gani and save it as something like "john_particletest.gani" and put that into the players/objects attribute/set it as an ani; can be done like player.attr[2] = "ganiname.gani"; or setAni("ganiname", params))
(the script is an old one of mine i practiced with when i first made particles so it might not be perfect. i barely make them  )
PHP Code:
SCRIPT
function onPlayerEnters() {
onTimeOut();
}
function onTimeOut() {
with(findimg(200)) {
x = player.x - 0.25; //starting x
y = player.y - 3.00; //starting y
attachtoowner = true; //follow the object if it moves (like follow the player if you move?
layer = 3; //layer
with(emitter) {
delaymin = 0.3; //the minimum delay when they should spawn
delaymax = 0.3; //the maximum delay when they should spawn
maxparticles = 20; //how many particles will be spawned max. until its recalled (timeout in this case)
nrofparticles = 1; //how many particles will be spawned at once
with(particle) {
speed = 10; //particles movement speed
lifetime = 4; //how many seconds will you be able to see the particle?
image = "g4_particle_bluex.png"; //particles image; works with ani = "walk"; aswell I think (so you can also set ganis)
red = random(0, 1); //red value
green = random(0, 1); //green value
blue = random(0, 1); //blue value
alpha = 1; //alpha value
zoom = random(0.3, 0.5); //the size of the particle (by default its always 1 - original size)
mode = 0; //mode effect of the particle
spin = random(1, 2); //rotation of the particle
angle = random(8, 0); //particles angle (in which direction it will move)
}
continueafterdestroy = true; //if the particle is destroyed/removed from a script, should the particle be removed immediately aswell (false) or have the particles finish their lifetime (true)?
addLocalModifier("range", 2, 4, "alpha", "replace", 1, 0); //lower the alpha after 2 seconds to the 4th second (so within 2 seconds; 4 is also the lifetime so when the particle is alpha=0 it will be destroyed - avoids lag) addLocalModifier("range", 0, 6, "angle", "replace", (pi*2)*4, 0); //rotation angle for the particle (from the second 0 to 6 because it will affect the size of the "ring")
}
}
setTimer(4);
}
SCRIPTEND
|
Posted by Mark Sir Link
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
|
All i can suggest you is to read the source Mark Sir Link posted. can help pretty much
|