Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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 | 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