2 registered members (TipmyPip, 1 invisible),
18,758
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
p.flags |= BEAM;
#286183
08/23/09 19:18
08/23/09 19:18
|
Joined: Apr 2009
Posts: 138 Germany
Toryno
OP
Member
|
OP
Member
Joined: Apr 2009
Posts: 138
Germany
|
How can I make a smoke tail for a rocket? I tried this but you can't see the smoke:
function effect_rocket_tail_fast(PARTICLE* p) {
p.vel_x = you.x - p.x;
p.vel_y = you.y - p.y;
p.vel_z = you.z - p.z;
vec_set(p.x, you.x);
}
function effect_rocket_tail(PARTICLE* p) {
p.flags |= BEAM;
p.bmap = raketen_schweif_tga;
p.alpha = 45 + random(25);
p.size = 50;
p.event = effect_rocket_tail_fast;
}
action rocket() {
effect(effect_rocket_tail, 1, my.x, nullvector);
while (1) {
...
move and do some other stuff
...
}
}
Thanks for reading, thinking, answering
|
|
|
Re: p.flags |= BEAM;
[Re: Xarthor]
#286741
08/26/09 21:03
08/26/09 21:03
|
Joined: Apr 2009
Posts: 138 Germany
Toryno
OP
Member
|
OP
Member
Joined: Apr 2009
Posts: 138
Germany
|
Now I'm using the code at the buttom of the post. It's a smoke trail but see how it looks
function effect_rocket_tail_fast(PARTICLE* p) {
p.flags &= ~MOVE;
}
function effect_rocket_tail(PARTICLE* p) {
p.flags |= (BEAM | MOVE | TRANSLUCENT);
p.bmap = raketen_schweif_tga;
p.alpha = 35 + random(5);
p.size = 50;
p.event = effect_rocket_tail_fast;
}
action rocket() {
ENTITY* victim = NULL;
VECTOR vel_temp;
var temp = 0;
my.TEMPO = 30;
ANGLE ang_temp;
// aim
victim = ptr_for_handle(my.TARGET);
if (victim != NULL) {
vec_set(ang_temp,opfer.x);
vec_sub(ang_temp,my.x);
vec_to_angle(ang_temp,ang_temp);
vec_set(my.pan, vector(ang_temp.pan, ang_temp.tilt, 0));
}
// fly
c_move(my, vector(my.TEMPO * time_step, 0, 0), nullvector, IGNORE_ME | IGNORE_PASSABLE | IGNORE_YOU);
// smoke tail
temp += time_step;
vec_for_angle(vel_temp, my.pan);
vec_normalize(vel_temp, -my.TEMPO);
if (temp >= effect_level) {
effect(effect_rocket_tail, 1, my.x, vel_temp);
temp -= effect_level;
}
}
Please, anyone tell me how to make this ugly holes away.
Last edited by Toryno; 08/27/09 15:32. Reason: I think the word is trail and not tail...
Thanks for reading, thinking, answering
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|