I'm sure, one day someone will ask me how to improve the world. I'll look at him, smile and say, well, it's easy, one would just have to USE THE SEARCHFUNCTION. I'd then become really angry and probably wouldn't be able to control myself anymore, only to wake up in the middle of lots of lots of blood.
Oh, yeah, heres your script.
Code:
function main() {
//Load the level
level_load("Whateveritsnameis"); //i.e. "mylevel.wmb"
//now, cam!
WHILE(1) {
temp.x = (key_w-key_s+key_cuu-key_cud)*15*time_step;
temp.y = (key_d-key_a)*15*time_step; //"strafing"
temp.z = 0; //no gravity
camera.pan -= (mouse_force.x+key_cur-key_cul)*15*time_Step;
camera.tilt += mouse_force.y*15*time_Step;
vec_rotate(temp,camera.pan);
vec_add(camera.x,temp);
wait(1);
}
}
To add collision, trace between the cameraposition (i.e. camera.x) and the target position (temp.x+camera.x-> vec_add(temp,camera.x)). Thats it, I guess.
Maybe I mixed up + and - somewhere. Or maybe somewhere the key is wrong. To make it move/rotate slower/faster, change the 15 to a smaller/higher number.
I haven't had much time to script lately, so maybe there are typos and what-have-you. Let me know if it works.