|
Particle glitch
#296630
11/02/09 06:05
11/02/09 06:05
|
Joined: Jan 2007
Posts: 25 California, USA
darksmaster923
OP
Newbie
|
OP
Newbie
Joined: Jan 2007
Posts: 25
California, USA
|
For some reason, every time I move further away from my particle emitter, it moves farther away too. I have the tiger use effect_local(p_blood, 200, me.x, normal); but, it comes out like this http://img101.imageshack.us/img101/6803/22294948.pngWhere it looks like it is behind the tiger, and as I go farther away it goes farther behind the tiger
I'm pretty awesome
|
|
|
Re: Particle glitch
[Re: darksmaster923]
#296635
11/02/09 07:50
11/02/09 07:50
|
Joined: Mar 2009
Posts: 88
Walori
Junior Member
|
Junior Member
Joined: Mar 2009
Posts: 88
|
Well do you want it to be below the tiger? Then you should change
effect_local(p_blood, 200, me.x, normal);
to:
effect_local(p_blood, 200,vector( me.x,me.y,me.z), normal);
Because if you take only X the particle is made only to the X coord of entity, and if you'd need it to be below then you'd need at least Y coord (Z is also adviced) hope that made an y senceEDIT: I stand corrected
Last edited by Walori; 11/02/09 15:55.
|
|
|
Re: Particle glitch
[Re: Walori]
#296659
11/02/09 10:42
11/02/09 10:42
|
Joined: Aug 2007
Posts: 1,922 Schweiz
Widi
Serious User
|
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
@Walori: you are false, if the compiler expect a vector and you only whrite my.x,the compiler takes my.y,my.z automatically for the vector!!! (the same if you use my.pan (tilt,roll), my.blue (green,red)...) so effect_local(p_blood, 200, me.x, normal); is right !!!
@darkmaster: you are sure that the me-pointer is pointing to the tiger? If yes, post your particlefunction for more help...
Last edited by Widi; 11/02/09 10:55.
|
|
|
Re: Particle glitch
[Re: Widi]
#296800
11/03/09 03:30
11/03/09 03:30
|
Joined: Jan 2007
Posts: 25 California, USA
darksmaster923
OP
Newbie
|
OP
Newbie
Joined: Jan 2007
Posts: 25
California, USA
|
The particle function
BMAP* blood_particle ="blood.tga";
function vec_randomize (VECTOR* vec, var range)
{
vec_set(vec,vector(random(1)-0.5,random(1)-0.5,random(1)-0.5));
vec_normalize(vec,random(range));
}
function p_alphafade(PARTICLE *p)
{
p.alpha -= p.skill_a*time_step;
if (p.alpha <= 0) p.lifespan = 0;
}
function p_blood(PARTICLE* p)
{
VECTOR vTemp;
vec_randomize(vTemp,2);
vec_add(p.vel_x,vTemp);
vec_set(p.blue,vector(random(255),random(255),255));
set(p, MOVE | BRIGHT | TRANSLUCENT);
p.alpha = 100;
p.size = 2;
p.gravity = 0.2;
p.skill_a = 3; // fade factor
p.event = p_alphafade;
}
The tiger function
function got_shot()
{
effect_local(p_blood, 200, me.x, normal);
//ptr_remove(me);
}
action test()
{
var scale=0.2;
VECTOR temp[3];
var speed=3;
me.material=mat_metal;
me.scale_x=scale;
me.scale_y=scale;
me.scale_z=scale;
me.emask= ENABLE_IMPACT;
my.event=got_shot;
c_setminmax(me);
set(me,POLYGON);
set(me,SHADOW);
while(1)
{
vec_set(temp,camera.x);
vec_sub(temp,my.x);
vec_to_angle(me.pan,temp);
got_shot();
c_move(me,nullvector,vector(0,0,-speed),IGNORE_PASSABLE|GLIDE);
if(vec_dist(me.x,camera.x)<20)
{
c_move(me,vector(-speed,0,0),nullvector,IGNORE_PASSABLE|GLIDE);
}
wait(1);
}
}
I'm pretty awesome
|
|
|
|