Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 12,420 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Partical and C_Trace problem ??? #280287
07/22/09 02:04
07/22/09 02:04
Joined: Apr 2009
Posts: 39
T
TrQuocAn Offline OP
Newbie
TrQuocAn  Offline OP
Newbie
T

Joined: Apr 2009
Posts: 39
Hi Everyone !

i HAD A Partical effect like this :

Code:
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 Offline
Expert
EvilSOB  Offline
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: EvilSOB] #280294
07/22/09 04:08
07/22/09 04:08
Joined: Apr 2009
Posts: 39
T
TrQuocAn Offline OP
Newbie
TrQuocAn  Offline OP
Newbie
T

Joined: Apr 2009
Posts: 39
Yes I know it !
but in that code the you pointer is all way null :((

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 Offline
Expert
EvilSOB  Offline
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
Re: Partical and C_Trace problem ??? [Re: EvilSOB] #280747
07/24/09 02:36
07/24/09 02:36
Joined: Apr 2009
Posts: 39
T
TrQuocAn Offline OP
Newbie
TrQuocAn  Offline OP
Newbie
T

Joined: Apr 2009
Posts: 39
thanks !
I fixed this problem !


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1