Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (fogman, Grant, AndrewAMD, juanex), 989 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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 | chip programmers | 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