Jump to content
CFDDIVE11

Replacing vehicles in station

Recommended Posts

Tell me if it works! I just edited something. Just give me a call for a backup if needed haha.

 

If you want to edit the cars that are placed, you'll need the 'LAFireStationStart.script' that is located in Platform:\Emergency 4 folder\Mods\Los Angeles Mod v2.1\Scripts\Game\Command. 

 

Example:

FirestationStart.script -

const char VO_AMBULANCE04[] = "fs_ambulance04"; TO const char VO_AMBULANCE04[] = "fs_battalion";

 

ActorList l13 = Game::GetActors(VO_AMBULANCE04);
for(int i=0; i < l13.GetNumActors(); i++)
{
Vector Ambulance04 = l13.GetActor(0)->GetPosition();
Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE01, UNNAMED);
m.EnableBlueLights(false);
m.SetPosition(Ambulance04);
m.SetRotation(gate8);
m.UpdatePlacement();
m.SetMaxPassengers(2);
m.SetMaxTransports(1);
m.SetSpeed(12.0f);
m.PushActionWait(ACTION_NEWLIST, 4.5f);
//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
//m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 7, false);
}
 
To:

ActorList l13 = Game::GetActors(VO_AMBULANCE04);
for(int i=0; i < l13.GetNumActors(); i++)
{
Vector Ambulance04 = l13.GetActor(0)->GetPosition();
Vehicle m = Game::CreateVehicle(OBJ_BATTALION, UNNAMED);
m.EnableBlueLights(false);
m.SetPosition(Ambulance04);         Not sure about this one, tho.
m.SetRotation(gate8);
m.UpdatePlacement();
m.SetMaxPassengers(2);
m.SetMaxTransports(0);
m.SetSpeed(12.0f);
m.PushActionWait(ACTION_NEWLIST, 4.5f);
//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
//m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 7, false);

}

 

Firestation.script - 

const char VO_AMBULANCE04[] = "fs_ambulance04"; to: const char VO_AMBULANCE04[] = "fs_battalion";

 

GameObjectList l2;
  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE04, l2, ACTOR_VEHICLE);
if(l2.GetNumObjects() > 0)
{
Vehicle m = l2.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 7, false);
//m.PushActionWait(ACTION_APPEND, 0.5f);
//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
} else
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
}
}

}

 

TO:

 

GameObjectList l2;
  Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE04, l2, ACTOR_VEHICLE);
if(l2.GetNumObjects() > 0)
{
Vehicle m = l2.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
if(StrCompare(m.GetPrototypeFileName(), OBJ_BATTALION) == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 7, false);
//m.PushActionWait(ACTION_APPEND, 0.5f);
//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
} else
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
}
}

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...