Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/20/26 15:57
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
ZorroGPT
by TipmyPip. 04/08/26 17:08
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, Quad), 4,536 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
juergenwue, VladMak, Geir, ondrej, mredit
19208 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
C_Trace Result question #374048
06/15/11 01:05
06/15/11 01:05
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Hey everyone.

Is it possible to check to see if only a block was hit with a c_trace result?


This checks to see if an entity was hit:
Code:
trace_mode = ignore_me + ignore_you + use_box + ignore_passable;
trace(player_sword.sword_tip,player_sword.sword_base);
if (result != 0){
     if (you != null) {
          if(you.pain==0){
	     you.health -= sword_power;
	     you.pain = 1;
          }
     }
}



Last edited by DevoN; 06/15/11 01:09.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: C_Trace Result question [Re: DLively] #374050
06/15/11 01:39
06/15/11 01:39
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Does trace set result automatically? I don't think so (?).
You ignore "you" (see trace_mode) but check the you pointer after the trace call, do you do that on purpose?
You can use f.i. the variable trace_hit to check if the trace has hit anything at all and when you remove ignore_you from trace_mode, (you == null) means that you've hit a block.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: C_Trace Result question [Re: DLively] #374054
06/15/11 03:33
06/15/11 03:33
Joined: Sep 2003
Posts: 648
Switzerland
snake67 Offline
User
snake67  Offline
User

Joined: Sep 2003
Posts: 648
Switzerland
Hi
Possibly something like this:

var distance;

distance=c_trace(player_sword.sword_base,player_sword.sword_tip, IGNORE_ME|IGNORE_PASSABLE|IGNORE_PASSENTS|IGNORE_MODELS|IGNORE_SPRITES|IGNORE_MAPS);
if(trace_hit)
{
...
}

Re: C_Trace Result question [Re: snake67] #374055
06/15/11 03:40
06/15/11 03:40
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
hey thanks superku =]
Got it working now, thanks to your brilliance.



Thank you too snake67, but you were to late tongue

Last edited by DevoN; 06/15/11 03:41.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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