NPC Code:
with (findimg(200))
{
attachtoowner = TRUE;
layer = 3;
with (emitter)
{
emissionoffset = {1,1.5,0};
delaymin = 0.1;
delaymax = 0.3;
nrofparticles = 1;
particletypes = 3;
continueafterdestroy = TRUE;
with (particles[0])
{
lifetime = 200;
speed = 1;
zangle = -3;
image = "light4.png";
zoom = 0.1;
alpha = 0.3;
}
addlocalmodifier("impulse", 0, 0, "zangle", "add", degtorad(-35), degtorad(35));
addlocalmodifier("once", 0, 0, "x", "replace", player.x, player.x);
addlocalmodifier("once", 0, 0, "y", "replace",player.y, player.y);
addlocalmodifier("once", 0, 0, "red", "replace", 0.1, 0.1);
addlocalmodifier("once", 0, 0, "green", "replace", 0.1, 0.1);
addlocalmodifier("once", 0, 0, "blue", "replace", 0.9, 0.1);
addlocalmodifier("once", 0, 0, "speed", "replace", 1, 2);
addlocalmodifier("range", 0, 0.75, "alpha", "add", 0.1, 0.5);
addlocalmodifier("range", 0.75, 400, "alpha", "add", 0, -0.9);
}
}
That's in a timeout function, but it only appears where I set it once, and not actually follow me like I try to. What do I change to make it do that?
EDIT: I have it following me now, but, it does that for all of 5 or so seconds then stops, yet keeps emitting. Why?