Hey Tompo,
Im trying your code.
I get no error's but also nothing happens with the sentry's >.<
Can you see what im doing wrong ?
Thanks allready,
here is my current code:
//////////////TURRET AI!!!//////////////////////
var my_angle[3];
define _speed, skill1;
function sentry_turnto(angle)
{
angle = ang(angle-my.pan);
if(angle>10){temp=my._speed;}
else
{
if(angle<-10){temp=-my._speed;}
else{temp=my._speed*angle*01;}
}
my.pan+=temp*time_step*2;
}
function sentry_fire()
{
my.light = on; //just a thing so the function isn't empty
//sound
//Shoot
//Boom Particle
//Player Hit
//Flash Screen
//Player Takes Damage or evades it
}
Action Sentry01
{
my.ENABLE_SCAN = on;
while(!player)&&(!me)
{
Sentrygun();
wait(1);
}
}
function Sentrygun()
{
if(c_scan(me,my.pan,vector(120,40,500),ignore_me | SCAN_ENTS)==1)&&(you==player)
{
c_trace(my.x,player.x,ignore_me | ignore_passable);
if(result != 0)&&(you==player)
{
vec_diff(temp,player.pos,my.pos);
result = vec_to_angle(my_angle,temp);
sentry_turnto(my_angle.PAN);
sentry_fire();
}
}
wait(1);
}
/////////////EINDE TURRET AI!!!//////////////////