Home » Renegade Discussions » Mod Forum » server crash (in tt.dll) after dead of ai
server crash (in tt.dll) after dead of ai [message #467138] |
Mon, 07 May 2012 14:46 |
robbyke
Messages: 348 Registered: September 2010 Location: Belgium
Karma:
|
Recruit |
|
|
full details :
Toggle Spoiler
character with a script attached so it can place a custom bot
the bot just fires a repgun in a straight line no other functions
when the char dies the bot dies to (this makes server crash sometimes)
i track the bot with an ID
the bot aims at a spot (used to be an object if this is a previous version it might still be)
the bot is killed (commands->apply_damage(....)) not destroyed
if more details needed i will add
bot code :
Toggle Spoiler
void KB_AI_Rep_Turret::Created(GameObject *obj)
{
Commands->Enable_Vehicle_Transitions(obj,false);
Commands->Innate_Enable(obj);
float Facing = Commands->Get_Facing(obj);
PosTar = Commands->Get_Position(obj);
PosTar.Z += 1.20f;
PosTar.X += static_cast<float>(30*cos(Facing*(PI/180)));
PosTar.Y += static_cast<float>(30*sin(Facing*(PI/180)));
ActionParamsStruct params;
params.AttackWanderAllowed = false;
params.Set_Basic(this,100,100);
params.Set_Attack(PosTar,40,0,true);
params.AttackCheckBlocked = false;
Commands->Action_Attack(obj,params);
}
void KB_AI_Rep_Turret::Action_Complete(GameObject *obj,int action_id,ActionCompleteReason complete_reason)
{
if (action_id == 100)
{
ActionParamsStruct params;
params.Set_Basic(this,100,100);
params.Set_Attack(PosTar,40,0,true);
params.AttackCheckBlocked = false;
Commands->Action_Attack(obj,params);
}
}
void KB_AI_Rep_Turret::Killed(GameObject *obj,GameObject *shooter)
{
int ID = Get_Int_Parameter("Owner");
StringClass Msg;
Msg.Format("CMSGP %d 0,255,0 your turret has been killed",ID);
Console_Input(Msg);
}
ScriptRegistrant<KB_AI_Rep_Turret> KB_AI_Rep_Turret_Registrant("KB_AI_Rep_Turret","Owner:int");
char script code
Toggle Spoiler
void KB_Char_Engineer::Created(GameObject *obj)
{
TurretID = NULL;
StringClass Msg;
Msg.Format("CMSGP %d 0,255,0 you can place 1 repair turret with !repturret or !rt",Get_Player_ID(obj));
Console_Input(Msg);
}
void KB_Char_Engineer::Detach(GameObject* obj)
{
GameObject *Turret = Commands->Find_Object(TurretID);
if(Turret)
{
Commands->Apply_Damage(Turret,99999,"Laser_NoBuilding",0);
}
}
void KB_Char_Engineer::Custom(GameObject *obj,int type,int param,GameObject *sender)
{
if(type == KB_Create_Rep_Turret)
{
GameObject *Turret = Commands->Find_Object(TurretID);
if(Turret){Commands->Destroy_Object(Turret);}
Vector3 Position = Commands->Get_Position(obj);
float Facing = Commands->Get_Facing(obj);
Position.X += static_cast<float>(-1.3*cos(Facing*(PI/180)));
Position.Y += static_cast<float>(-1.3*sin(Facing*(PI/180)));
Position.Z += 0.1f;
Turret = Commands->Create_Object("Nun",Position);
Commands->Set_Facing(Turret,Facing);
Remove_All_Scripts(Turret);
//Commands->Disable_Physical_Collisions(Turret);
Set_Skin(Turret,"CNCVehicleLight");
Commands->Set_Shield_Type(Turret,"CNCVehicleLight");
float FloatHP = 100;
float FloatAP = 0;
Set_Max_Health(Turret,FloatHP);
Set_Max_Shield_Strength(Turret,FloatAP);
Commands->Set_Health(Turret,FloatHP);
Commands->Set_Shield_Strength(Turret,FloatAP);
int TEAM = Commands->Get_Player_Type(obj);
Commands->Set_Player_Type(Turret,TEAM);
Commands->Clear_Weapons(Turret);
Commands->Give_PowerUp(Turret,"CnC_POW_RepairGun_Player",false);
Commands->Select_Weapon(Turret,Get_Powerup_Weapon("CnC_POW_RepairGun_Player"));
StringClass Param;
Param.Format("%d",Get_Player_ID(obj));
Commands->Attach_Script(Turret,"KB_AI_Rep_Turret",Param);
Set_Death_Points(Turret,20.0f);
TurretID = Commands->Get_ID(Turret);
StringClass Msg;
Msg.Format("CMSGP %d 0,255,0 if you place another turret this one will be destroyed",Get_Player_ID(obj));
Console_Input(Msg);
}
}
ScriptRegistrant<KB_Char_Engineer> KB_Char_Engineer_Registrant("KB_Char_Engineer","");
i hope this crashdump is correct its a bit older but its in tt.dll to
stealtheye said the bot tries to move while its dead however i dont understand how i can fix that
Owner of kambot TT server
kambot.freeforums.org
[Updated on: Tue, 08 May 2012 06:39] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Dec 22 16:05:34 MST 2024
Total time taken to generate the page: 0.00975 seconds
|