First the story. I'm trying to make a new effect on Zodiac using the Blessing of Stamina gani as a template, since it makes an image float around behind, and in front of the player. I made a particle with a trail effect, and I'm trying to figure out how to move the emitter along the path that blessing of stamina uses. The problem is, I can't for the life of me figure out how to move it. And I
have to move the emitter in order to retain the trailing effect. So moving the particle isn't an option here. Does anyone know how to do this?
This is the one that I had figured would work:
(I've also tried with(findimg(200)){emitter.x += stuff;emitter.y += stuff;} with no success.)
PHP Code:
GANI0001
CONTINUOUS
DEFAULTHEAD head19.png
DEFAULTBODY body.png
SCRIPT
function onPlayerenters(){
this.max = 1;
this.r = 0;
this.g = 1;
this.b = .2;
if (this.max <= 0) this.max = 1;
setarray(this.angle,this.max);
setarray(this.zed,this.max);
setarray(this.zmove,this.max);
setarray(this.zgoto,this.max);
for(a=0;a<this.max;a++) {
this.angle[a] = 4.78;
this.zed[a] = random(0,1.25);
this.zmove[a] = 0;
this.zgoto[a] = random(0,1.5);
}
setTimer(.05);
}
function onTimeout(){
setTimer(.05);
for(a=0;a<this.max;a++) {
this.angle[a] = (this.angle[a]+.1)%6.28;
if (this.zgoto[a] > this.zed[a]) {
if (this.zmove[a] < .1) this.zmove[a] += .05;
}
if (this.zgoto[a] < this.zed[a]) {
if (this.zmove[a] > -.1) this.zmove[a] -= .05;
}
if (this.zed[a] in |this.zgoto[a]-.1,this.zgoto[a]+.1|) this.zgoto[a] = random(0,1.5);
this.zed[a] += this.zmove[a];
findimg(200).x+=.75+sin(this.angle[a]);
findimg(200).y+=.5+cos(this.angle[a])*.5;
findimg(200).z = this.zed[a]-1;
if (this.angle[a] in |1.57,4.71|) findimg(200).layer = 1;
else findimg(200).layer = 2;
}
}
function onCreated()
{
with (findimg(200))
{
spin = degtorad(0);
rotation = degtorad(0);
with (emitter)
{
delaymin = 0;
delaymax = 0;
nrofparticles = 1;
emitautomatically = true;
autorotation = false;
firstinfront = true;
emissionoffset = {0,0,0};
attachposition = true;
attachtoowner = true;
checkbelowterrain = false;
continueafterdestroy = true;
maxparticles = 100000;
particleTypes = 1;
// Curse
with (particles[0])
{
image = "light4.png";
zoom = 0.2;
red = 0.5;
green = 1;
blue = 0;
alpha = 1;
mode = 2;
lifetime = 1;
angle = degtorad(270);
zangle = degtorad(0);
speed = 0;
rotation = degtorad(0);
spin = degtorad(0);
partx = 0;
party = 0;
partw = 0;
parth = 0;
stretchx = 1;
stretchy = 1;
sound = "";
layer = 2;
}
addlocalmodifier("range", 0.25, 1, "zoom", "replace", 0.2, 0); // Zoom Out
addlocalmodifier("range", 0.25, 1, "alpha", "replace", 0.99, 0); // Fade Out
addlocalmodifier("range", 0, 0.5, "red", "replace", 0.5, 1); // Red
addlocalmodifier("range", 0, 0.5, "blue", "replace", 0, 1); // Blue
}
}
}
SCRIPTEND
ANI
ANIEND