Scritps question Action_Attack [message #394009] |
Sun, 05 July 2009 19:08 |
|
zunnie
Messages: 2959 Registered: September 2003 Location: Netherlands
Karma: 0
|
General (2 Stars) |
|
|
void z_Cinematic_Attack::Created(GameObject *obj)
{
GameObject *GotoObject = Commands->Find_Object(Get_Int_Parameter("ID"));
ActionParamsStruct paramd;
paramd.Set_Basic(this,100,100);
paramd.Set_Goto_Following(GotoObject,10.0f,50.0f,true);
Commands->Action_Goto(obj,paramd);
ActionParamsStruct params;
int priority = Get_Int_Parameter("Priority");
float range = Get_Float_Parameter("Range");
float deviation = Get_Float_Parameter("Deviation");
int primary = Get_Int_Parameter("Primary");
params.Set_Basic(this,priority,40016);
params.Set_Attack_Hold(Commands->Find_Object(Get_Int_Parameter("ID")),range,deviation,primary,false);
Commands->Action_Attack(obj,params);
}
void z_Cinematic_Attack::Action_Complete(GameObject *obj,int action,ActionCompleteReason reason)
{
Commands->Action_Reset(obj,100);
}
Is what i am using to get the tank to move into position and attack the object.
But it sits still at the position it is created, it does fire at the object but it doesn't drive over there.
Anyone know a way to get it to move over there?
|
|
|
Re: Scritps question Action_Attack [message #394014 is a reply to message #394009] |
Sun, 05 July 2009 20:06 |
|
zunnie
Messages: 2959 Registered: September 2003 Location: Netherlands
Karma: 0
|
General (2 Stars) |
|
|
Nevermind, i got it to work now.
void z_Cinematic_Attack::Created(GameObject *obj)
{
ActionParamsStruct params;
int priority = Get_Int_Parameter("Priority");
float range = Get_Float_Parameter("Range");
float deviation = Get_Float_Parameter("Deviation");
int primary = Get_Int_Parameter("Primary");
GameObject *GotoObject = Commands->Find_Object(Get_Int_Parameter("ID"));
params.Set_Goto_Following(GotoObject,10.0f,50.0f,true);
Commands->Action_Goto(obj,params);
params.Set_Basic(this,priority,40016);
params.Set_Attack_Hold(Commands->Find_Object(Get_Int_Parameter("ID")),range,deviation,primary,false);
Commands->Action_Attack(obj,params);
}
void z_Cinematic_Attack::Action_Complete(GameObject *obj,int action,ActionCompleteReason reason)
{
Commands->Action_Reset(obj,100);
}
|
|
|