Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » attack script ai
attack script ai [message #466482] Sun, 22 April 2012 15:39 Go to previous message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma:
Recruit
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?


Owner of kambot TT server

kambot.freeforums.org
 
Read Message
Read Message
Read Message
Previous Topic: cant get animations to work
Next Topic: create a building
Goto Forum:
  


Current Time: Sun Oct 06 20:21:48 MST 2024

Total time taken to generate the page: 0.00631 seconds