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
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 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
Basic Trace/Scan Noob question? #251800
02/15/09 00:18
02/15/09 00:18
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
Hi how do I get my enemy to scan/trace for a player in a cone shape infront of it like the enemys eye view? (like metal gear solid?)

Re: Basic Trace/Scan Noob question? [Re: RyuShinji] #251806
02/15/09 01:25
02/15/09 01:25
Joined: Aug 2008
Posts: 218
U.S.
GamerX Offline
Member
GamerX  Offline
Member

Joined: Aug 2008
Posts: 218
U.S.
Look in the manual under c_scan, then just have it check if an entity enters the scanning area and make a conditional to test if it is the player.
c_scan will return you as the pointer to the entity that came into the area, you can then check if(you == player).

Last edited by GamerX; 02/15/09 01:25.

"You may never know what results come of your action, but if you do nothing there will be no result."
-Mahatma Gandhi
Re: Basic Trace/Scan Noob question? [Re: RyuShinji] #251867
02/15/09 11:53
02/15/09 11:53
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
Use something like this in the while loop that's used by the enemy's action:

c_scan(my.x, my.pan, vector(120, 60, 1000), IGNORE_ME | SCAN_ENTS);
if (you == player)
{
// do what's needed here; the enemy has detected the player
}

The player would have to be made sensitive to scanning. 120, 60, 1000 give the angles and the scanning range - check the manual.

Re: Basic Trace/Scan Noob question? [Re: George] #251875
02/15/09 12:08
02/15/09 12:08
Joined: Jun 2007
Posts: 152
Norway
D
Darkyyes Offline
Member
Darkyyes  Offline
Member
D

Joined: Jun 2007
Posts: 152
Norway
This is related to his problem, how can I make my enemies see themselves and if they collide with eachother they will go through eachother? and only eachother? :- )


New to lite-c and gamestudio in general, thank you for reading.
Com, A7 v7.7
Re: Basic Trace/Scan Noob question? [Re: Darkyyes] #251878
02/15/09 12:22
02/15/09 12:22
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
hey, set their FLAG2, then make sure you IGNORE_FLAG2 when using c_trace or c_move

hope this helps

Re: Basic Trace/Scan Noob question? [Re: Darkyyes] #252036
02/16/09 06:24
02/16/09 06:24
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
MrGuest is right. Do what he says and don't forget to add SCAN_FLAG2 in the c_scan instruction; otherwise, it won't work.


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