Alright, so I've been trying to learn to use c_scan, but for some reason this just isn't working for me. I've read all the documentation and searched the forums but to no avail. What I'm trying to do is essentially have one model use ProxFinish to detect when another entity comes within 400 quants (in any direction) and then load a specific level. Sounds easy, right? There must be something simple I'm doing wrong or forgetting. Here's what I've got.
Sorry it isn't tabbed, not sure how to do that. Also, camera_follow is just a simple function that does exactly what it sounds like.
action ProxFinish() {
my.emask |= ENABLE_DETECT;
while(1) {
c_scan(my.x,my.pan,vector(0,0,400),SCAN_ENTS);
wait(1);
}
}
action PlayWalk() {
camera_follow(me);
my.emask |= ENABLE_SCAN;
VECTOR vFeet;
vec_for_min(vFeet,me);
while (1) {
my.pan += (key_cul-key_cur)*10*time_step;
var distance = (key_cuu-key_cud)*30*time_step;
c_move(me, vector(distance,0,0), NULL, GLIDE);
c_trace(my.x,vector(my.x,my.y,my.z-1000),IGNORE_ME | IGNORE_PASSABLE);
my.z = hit.z - vFeet.z;
if (event_type == EVENT_SCAN) {
level_load("Level1.wmb");
}
wait(1);
}
}