I am now working on the enemies in my side scroller game. Currently, I am trying to get them to patrol a certain area of the level, and when they spot the player, they go after him (and some, shoot him) until a certain point.

-Skip until questions if you want-

Now, I'm not going to start coding tons of things to make this AI work. This is my first 3D game using Gamestudio, and first 3D game using any code. My plan is to have each enemy between 2 "patrol points." Simple white boxes that are passable and invisible in-game. The enemy is always moving, but whenever it reaches a patrol point, it turns around (with a simple pan function).

The enemy will have 3 modes (or more depending on it's type). Patrol, Caution, and Return. Patrolling is just that. Caution, is when the player enters a certain range, and the enemy begins chasing him. When in this mode, the enemy does not notice the patrol points. It will go after the player until reaching a Caution Point (another box). If it reaches a Caution Point, it will go in to Return mode.

Return mode is when the enemy loses interest in the player and begins returning to its Origin Point, the place it spawned (in between the Patrol Points). It will not notice Patrol Points until it reaches the Origin Point, where it will go back to Patrol mode.

Now, I've been trying to get one part of this working (patrolling), through Flags and other ways which don't work well. With this, I realized I needed to use Skills, but I need some help with them.

-Questions-

First, I want to make the Patrol Points a certain Skill. Does it matter what Skill I choose for this? Is there some rule where Skill22 has to be the player? Should I go about setting the skill in WED or SED?

Next, how should I have the enemy's check for touching a Patrol Point? C_trace and c_scan are slow, is there any other way?

Once the enemy knows something is nearby it, how do I have it check if the thing it's touching has a certain Skill set to a certain number? I tried using c_trace and then
if(you.skill22 == 1)
but that brought up an error in the enemy's action.

I'm sure I'm missing something, but currently those are the questions I can think of that I need help with. Sorry for the long post, and thanks in advance (I apologize if I don't understand certain things that people explain, I'm not too great with C-lite yet :P).