|
2 registered members (TipmyPip, Quad),
5,145
guests, and 4
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Partical and C_Trace problem ???
#280287
07/22/09 02:04
07/22/09 02:04
|
Joined: Apr 2009
Posts: 39
TrQuocAn
OP
Newbie
|
OP
Newbie
Joined: Apr 2009
Posts: 39
|
Hi Everyone ! i HAD A Partical effect like this :
bmap RapidFireBmap = <laser_red_small.tga>;
VAR RapidFireAnzahlPartikel = 5; //number of particles used for this effect
Function RapidFire_spec_fun()
{
c_trace(vector(my.skill_d,my.skill_y,my.skill_z),my.x,ignore_passable+ignore_me+ignore_sprites);
if(trace_hit == 1)
{
my.vel_x = 0;
my.vel_y = 0;
my.vel_z = 0;
my.lifespan = 0;
you.visible = off;
}
my.skill_d = my.x; my.skill_y = my.y; my.skill_z = my.z;
my.alpha -= 0 *time;
IF(My.alpha < 0) { my.alpha = 0; my.lifespan = 0; }
}
Function RapidFirespezial()
{
my.blue = 128 ;
my.green = 128 ;
my.red = 128 ;
my.bmap = RapidFireBmap; //the effect bitmap
vec_for_angle(temp,vector(you.pan,you.tilt,0));
vec_scale(temp,10);
my.vel_x = temp.x ;
my.vel_y = temp.y ;
my.vel_z = temp.z ;
my.size = 2 ;
my.alpha = 55.795 ;
my.gravity = 0 ;
my.streak = off;
my.flare = on;
my.bright = on;
my.beam = on;
my.move = on;
my.transparent = on;
my.function = RapidFire_spec_fun;
}
In the function "Function RapidFire_spec_fun()", I try to find that does the partical hit any entity ? By C_Trace method ! I read in the 3DGS Manual that if the trace _hit is non-zero ! the you pointer will be set to the entity ! But in that code ! after it hit the entity ! the you pointer is zero ! So how to get the entity being hit by partical ??? thanks !
|
|
|
Re: Partical and C_Trace problem ???
[Re: TrQuocAn]
#280290
07/22/09 03:10
07/22/09 03:10
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
c_trace returns non-zero if "something" is hit. The YOU get set to the entity IF it is an entity.
So if c_trace > zero and YOU=NULL then you hit a WED block.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Partical and C_Trace problem ???
[Re: TrQuocAn]
#280295
07/22/09 04:39
07/22/09 04:39
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Then it isnt hittng entities, its only hitting "geometry" created ny WED.
Try changing your c_trace to this and see it its is still hitting anything. c_trace(vector(my.skill_d,my.skill_y,my.skill_z),my.x,ignore_passable+ignore_me+ignore_sprites+ignore_world);
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|