Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by rayp. 07/11/26 18:10
Z9 getting Error 058
by madpower2000. 07/09/26 18:09
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 07/09/26 13:16
New Zorro version 3.11
by jcl. 07/06/26 06:56
Synthetic test data in Zorro
by jcl. 07/06/26 06:54
Parameter filename BUG
by walt_Schwarz. 07/02/26 15:36
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 12,021 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Checking if the enemy can see the player? #453798
08/14/15 00:54
08/14/15 00:54
Joined: Jul 2015
Posts: 26
M
Mark430SR Offline OP
Newbie
Mark430SR  Offline OP
Newbie
M

Joined: Jul 2015
Posts: 26
Hi,

I know c_trace instruction is used for that. The problem is that c_trace always returns positive number even if there are no obstacles between the player and the enemy, so how come I know if the enemy can see the player?

Re: Checking if the enemy can see the player? [Re: Mark430SR] #453799
08/14/15 03:55
08/14/15 03:55
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
code?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Checking if the enemy can see the player? [Re: DLively] #453800
08/14/15 06:58
08/14/15 06:58
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Don't use the distance but the
if(trace_hit) ...
variable (or the hit macro, manual: hit and c_trace obviously).
Obviously you want to either c_ignore both player and enemy (or IGNORE_ME and IGNORE_PASSABLE and let's say set the player to passable immediately before the trace and reset the flag after).


"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

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