Posted By: RyuShinji
Basic Trace/Scan Noob question? - 02/15/09 00:18
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?)
Posted By: GamerX
Re: Basic Trace/Scan Noob question? - 02/15/09 01:25
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).
Posted By: George
Re: Basic Trace/Scan Noob question? - 02/15/09 11:53
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.
Posted By: Darkyyes
Re: Basic Trace/Scan Noob question? - 02/15/09 12:08
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? :- )
Posted By: MrGuest
Re: Basic Trace/Scan Noob question? - 02/15/09 12:22
hey, set their FLAG2, then make sure you IGNORE_FLAG2 when using c_trace or c_move
hope this helps
Posted By: George
Re: Basic Trace/Scan Noob question? - 02/16/09 06:24
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.