Jump to content
andrew2007

Additional Parking + Units - Help Required

Recommended Posts

Hey Everyone,

Over the past few days i've been looking at adding parking and additional units at various locations.

Below is where the units are (or are to be) located, and they are in the parking spaces.

FS1: HES, Water Tender, Brush Patrol

FS2: LES, Brush Patrol, Large Ambulance

Police Station: Bomb Squad, Motorbikes, Unmarked Car, SUV (Plus 3 Extra Parking Spots - 06,07,08 - Which are working)

Hospital: EMS Supervisor, Coroners

The VOs are as follows:

[i]FS1[/i]
vo_hesa - HES
vo_watertender - Water Tender
fs_brusha - Brush Patrol

[i]FS2[/i]
fs_lesb - LES
fs_brushb - Brush Patrol
fs_lgamba - Lg. Ambulance

I'm yet to add the VOs for the other things, but they will be as follows:

[i]Police[/i]
policestation_mbike1 - motorbike
policestation_mbike2 - motorbike
policestation_suv - suv
policestation_umkd - unmarked car
policestation_bomb - bomb squad

[i]Hospital[/i]
hopsital_emscap - ems supervisor
hospital_coroners - coroners

The problem i am encountering is spawning, and having crews actually enter the vehicles.

The LES at FS2 spawns, but the units come from FS1, and the Brush Batrol at FS1 works fine, but everything else i am having issues with.

I've edited some of the scripts:

LAFireStation.script - http://andrew2007.pastebin.com/f57668cd1

LAFireStationStart.script - http://andrew2007.pastebin.com/m51cafc82

LAToPoliceStation.script - http://andrew2007.pastebin.com/m4ec93726

I would be appreciative of any assistance that you can offer, and if you have any questions for me, please ask!

Thanks again!

Link to comment
Share on other sites

Hello all. This thread has long been inactive, but for anyone esle who may have this problem, You need to create another Squad VO. This is the virtual object that contains the vehicles and spawn and moveto VOs. And then in the LAFireStation script in the DummyCallCrew command, you need to add the code in. Also make sure you specify the new spawn and moveto AND the squad VOs at the top of the page with


const char VO_SPAWN04[] = "fs_spawn04";
const char VO_MOVETO03[] = "fs_moveto03";
const char VO_SQUAD03[] = "fs_squad03";

and DON'T forget about the OBJs


const char OBJ_PO[] = "mod:Prototypes/Persons/03 LA Police/lapd_officer_m.e4p";
const char OBJ_SWATOFFICER[] = "mod:Prototypes/Persons/03 LA Police/lapd_swat.e4p";
const char OBJ_SCOUTOFFICER[] = "mod:Prototypes/Persons/03 LA Police/scout.e4p";
const char OBJ_BOMBSQUAD[] = "mod:Prototypes/Persons/03 LA Police/lapd_bomb_squad.e4p";

ETC. ETC.

Then you want to make sure you specify your ChildIDs so that when you go to Auto Staff the vehicles, you AND the game know which person is associated with what number.

IE


PersonList passengers = v.GetPassengers();
if (ChildID == 1)
{
Person p = Game::CreatePerson(OBJ_PM, UNNAMED);
p.SetEquipment(EQUIP_EMERGENCY_CASE);
}
else if (ChildID == 2)
Person p = Game::CreatePerson(OBJ_PM_STRETCHER, UNNAMED);
else if (ChildID == 3)
Person p = Game::CreatePerson(OBJ_EMT, UNNAMED);
else if (ChildID == 4)
Person p = Game::CreatePerson(OBJ_CHIEF, UNNAMED);
else if (ChildID == 5)
Person p = Game::CreatePerson(OBJ_HAZMAT, UNNAMED);
else if (ChildID == 6)
Person p = Game::CreatePerson(OBJ_USARFF, UNNAMED);
else if (ChildID == 7)
Person p = Game::CreatePerson(OBJ_EMT_STRETCHER, UNNAMED);
else if (ChildID == 8)
Person p = Game::CreatePerson(OBJ_PO, UNNAMED);
else if (ChildID == 9)
Person p = Game::CreatePerson(OBJ_SWATOFFICER, UNNAMED);
else if (ChildID == 10)
Person p = Game::CreatePerson(OBJ_SCOUTOFFICER, UNNAMED);
else if (ChildID == 11)
Person p = Game::CreatePerson(OBJ_BOMBSQUAD);
else
return;

Ok so NOOOWWW you can go back up to your DummyCallCrew command and add in your code:

(mine is for the police station)


else if(v.IsCollidingWithVirtualObject(VO_SQUAD03))
{
ActorList l1 = Game::GetActors(VO_SPAWN04);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();

GameObjectList l2 = Game::GetGameObjects(NAME_POLICESTATION);
for(int i=0; i < l2.GetNumObjects(); i++)
{
GameObject *obj = l2.GetObject(i);
if (!obj->IsSpecialLightEnabled())
{
obj->EnableSpecialLights(true);
obj->PushActionWait(ACTION_NEWLIST, 16.0f);
obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
Vector AlarmSnd = obj->GetPosition();
int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);
obj->SetUserData(soundID);
obj->AttachSound(soundID);
}
}
}

And voila! now all you have to do is edit the LAFireStationStart script to auto staff whatever vehicles you may have over there and it works perfectly!

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...