Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Particle Effects: Following the player/object? (https://forums.graalonline.com/forums/showthread.php?t=65295)

Raeiphon 04-10-2006 02:39 PM

Particle Effects: Following the player/object?
 
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?

ApothiX 04-11-2006 02:46 PM

Quote:

attachtoowner = TRUE;
true is case sensative, is it not?

Edit:
Also noticed that you may want to add 'attachposition = true;' to the emitter.

xAndrewx 04-11-2006 05:53 PM

Wouldn't it be better if you used a gani?

Prozac 04-12-2006 12:02 AM

placing an emitter in a gani has worked for me,
then just replaceani(walk,whateveryouaniis)
and set it back when you want the emitter off.

also when you do replaceani, then you do not need to use a timeout.
you just turn if off after you use up your ammo/fuel/whatever contition sets the gani back to normal.
in my experience, timeouts that call emitters tend to make the emitters break.

Raeiphon 04-15-2006 01:39 PM

Good point, I'll gani it and see. Post results in a few.

ApothiX 04-15-2006 07:16 PM

If he doesn't want other people to see the particles, then a gani wouldn't be a good thing.

all he has to do is set attachposition to true x_x


All times are GMT +2. The time now is 07:18 PM.

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