Thanks for your help.
ok, I try it again: The particle should move itself, but not in worldposition but in a relativ position to a defined vertex of a model (for example, every particle have to circle around his defined vertex).
MasterQ32 helped me and gave me some code, too.
It workes now; that way: The particle fades in and stay on the vertex.
So if the entity is animated, the entity is covered with the particles. After fading in, the particle fades out and is not attached on the vertex any more, so if the animation goes on and the entity is moving, it leaves a cloud behind it.
So it's okay, not perfect, but ok and it works .-D
Thansk for helping, the effect looks nice and that's fits for me.
Here the code, if somebody needs it, too:
//////////////////////////////
// Zustand: Brennen
//////////////////////////////
BMAP* pct_p_fire01 = "pct_p_fire01.tga";
BMAP* pct_p_fire02 = "pct_p_fire02.tga";
BMAP* pct_p_fire03 = "pct_p_fire03.tga";
function p_flammen_out(PARTICLE *p) // fading out and if entity moves, it leaves the flame behing
{
p.alpha -= p.skill_c*time_step;
if (p.alpha <= 30) p.bmap = pct_p_fire02;
if (p.alpha <= 15) p.bmap = pct_p_fire03;
if (p.alpha <= 0) p.lifespan = 0;
}
function p_flammen_in(PARTICLE *p) // fading in and stay at position
{
p.alpha += p.skill_c*time_step;
if (p.alpha >= 15) p.bmap = pct_p_fire02;
if (p.alpha >= 30) p.bmap = pct_p_fire01;
if (p.alpha >= 50) p.event = p_flammen_out;
you = p.skill_a;
if(!you) {p.lifespan = 0; return;}
vec_for_vertex(p.x, you, p.skill_b);
}
function p_condition_burning(PARTICLE* p)
{
p.skill_a = p.vel_x; // pointer auf brennende Entity
p.skill_b = p.vel_y; // Nummer des Vertex
p.skill_c = 8+random(4); // Fadefaktor
set(p, BRIGHT | TRANSLUCENT);
p.alpha = random(10);
p.bmap = pct_p_fire03;
p.size = 16+random(5);
p.event = p_flammen_in;
}
function eff_test_burning()
{
VECTOR vel;
int gesamt_vertices = ent_status(my, 0);
while(1)
{
vel.x = me;
vel.y = integer(random(gesamt_vertices));
vel.z = 0;
effect(p_condition_burning,1,my.x,vel); //pointer and vertex stored in vel
wait(1);
}
}
Thanks!!! :-D