|
2 registered members (AndrewAMD, TipmyPip),
6,052
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: particle following an Entity, how?
[Re: Rackscha]
#335370
07/28/10 00:46
07/28/10 00:46
|
Joined: Jul 2010
Posts: 129
bk9iq
Member
|
Member
Joined: Jul 2010
Posts: 129
|
From AUM 78:: Q: Does anyone know how to put a fire particle effect behind the tail of a jet?
A: There you go.
BMAP* fire_tga = "fire.tga";
function fade_fire(PARTICLE *p)
{
p.alpha -= 4 * time_step; // fade out the fire particles
if (p.alpha < 0)
p.lifespan = 0;
}
function fire_effect(PARTICLE *p)
{
p->vel_x = 1 - random(2);
p->vel_y = 1 - random(2);
p->vel_z = 1 + random(1);
p.alpha = 25 + random(50);
p.bmap = fire_tga;
p.size = 25; // gives the size of the fire particles
p.flags |= (BRIGHT | MOVE);
p.event = fade_fire;
}
action my_jet() // attach this action to your plane
{
VECTOR jet_offset;
// put your own code here
// ........................
while (1)
{
// put your own jet flight code here
// the example below simply makes the plane fly in a circle
c_move (my, vector(20 * time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);
my.pan += 2 * time_step; // 2 sets the radius of the circle
// end of the simply flying example code
// the jet particle effect code starts below
// place the particle jet at the proper position, play with these values
vec_set(jet_offset.x, vector(-100, -10, -20));
vec_rotate(jet_offset.x, my.pan);
vec_add(jet_offset.x, my.x);
effect(fire_effect, 5, jet_offset.x, nullvector); // generate 5 fire particles each frame
wait (1);
}
} Hope this is what u want
Last edited by bk9iq; 07/28/10 00:47.
|
|
|
|
Entire Thread
|
particle following an Entity, how?(+beam streak problem)
|
Rackscha
|
07/27/10 17:26
|
Re: particle following an Entity, how?
|
Lukas
|
07/27/10 17:31
|
Re: particle following an Entity, how?
|
Rackscha
|
07/27/10 17:40
|
Re: particle following an Entity, how?
|
Nidhogg
|
07/27/10 22:06
|
Re: particle following an Entity, how?
|
Rackscha
|
07/27/10 22:29
|
Re: particle following an Entity, how?
|
bk9iq
|
07/28/10 00:46
|
Re: particle following an Entity, how?
|
Nidhogg
|
07/28/10 02:18
|
Re: particle following an Entity, how?
|
MrGuest
|
07/28/10 09:54
|
Re: particle following an Entity, how?
|
Rackscha
|
07/28/10 11:11
|
Re: particle following an Entity, how?
|
Rackscha
|
07/28/10 11:22
|
Re: particle following an Entity, how?
|
Petra
|
07/29/10 11:25
|
|
|