i suppose this piece of code would get my defence to keep firing forward but it wont even execute the first attack
void KB_AI_Rep_Turret::Created(GameObject *obj)
{
float Facing = Commands->Get_Facing(obj);
Vector3 PosTar = Commands->Get_Position(obj);
PosTar.Z += 2.0f;
PosTar.X += static_cast<float>(10*cos(Facing*(PI/180)));
PosTar.Y += static_cast<float>(10*sin(Facing*(PI/180)));
Target = Commands->Create_Object("Invisible_Object",PosTar);
ActionParamsStruct params;
Vector3 pos;
params.Set_Basic(this,100,1);
params.Set_Face_Location(Commands->Get_Position(Target),Commands->Get_Facing(Target),1.0f);
Commands->Action_Face_Location(Target,params);
}
void KB_AI_Rep_Turret::Action_Complete(GameObject *obj,int action_id,ActionCompleteReason complete_reason)
{
if (action_id == 1)
{
ActionParamsStruct params;
Vector3 pos;
params.Set_Basic(this,100,2);
params.Set_Attack(Target,40,0,true);
params.AttackCheckBlocked = false;
Commands->Action_Attack(Target,params);
}
}
ive checked at JFW_Engineer_Repair but it seems to be the same what do i miss?