Posted 18 February 2010 - 01:04 PM
looks like I am to stupid to get this whole thing .
first I wanted to replace the " hazmat " by the " ems-suv " but that did not get me anywhere , except for an empty parking bay at firestation 2 and here and there a crash - seems something about the file names - so I figured I try it with a different approach and use a vehicle where I am certain about the file names .
my first task was to get the spawning of the desired vehicle done , just as hoppah advised to do so at the beginning of the post .
i decided to put another battalion chief into FS2 as a replacement for the hazmat
I changed the following lines , so that they look like this
const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p";
const char OBJ_BATTALION[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p";
const char VO_HAZMAT[] = "fs_hazmat";
const char VO_BATTALION[] = "fs_battalion";
ActorList l15 = Game::GetActors(VO_HAZMAT);
for(int i=0; i < l15.GetNumActors(); i++)
{
GameObjectList gate06a = Game::GetGameObjects(NAME_GATE06A);
for(int i=0; i < gate06a.GetNumObjects(); i++)
GameObject *gate = gate06a.GetObject(i);
Vector Hazmat = l15.GetActor(0)->GetPosition();
Vehicle m = Game::CreateVehicle(OBJ_HAZMATSQUAD, UNNAMED);
m.EnableBlueLights(false);
m.SetPosition(Hazmat);
m.SetRotation(gate);
m.UpdatePlacement();
m.SetMaxPassengers(4);
m.SetMaxTransports(2);
m.SetSpeed(8.0f);
m.PushActionWait(ACTION_NEWLIST, 1.0f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
m.PushActionWait(ACTION_APPEND, 1.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
against
ActorList l15 = Game::GetActors(VO_BATTALION);
for(int i=0; i < l15.GetNumActors(); i++)
{
GameObjectList gate06a = Game::GetGameObjects(NAME_GATE06A);
for(int i=0; i < gate06a.GetNumObjects(); i++)
GameObject *gate = gate06a.GetObject(i);
Vector BATTALION = l15.GetActor(0)->GetPosition();
Vehicle m = Game::CreateVehicle(OBJ_BATTALION, UNNAMED);
m.EnableBlueLights(false);
m.SetPosition(BATTALION);
m.SetRotation(gate);
m.UpdatePlacement();
m.SetMaxPassengers(4);
m.SetMaxTransports(0);
m.SetSpeed(12.0f);
m.PushActionWait(ACTION_NEWLIST, 1.0f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
m.PushActionWait(ACTION_APPEND, 1.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 5, false);
the only result I get with this is , that I have an empty bay at the FS2 and a second BTC sitting on top of the original BTC at the parking lot ......