Jump to content
Xplorer4x4

Setting Spawn Location For Firefighters?

Recommended Posts

How do i choose the spawn locations for firefighters/crews. I have additional units parked outside my stations. In particular I have a brush and ems supervisor parked outside station 2. The EMS supervisor spawns at Fire Station 2 and runs to his car fine, but the FFs for the brush truck spawn at station 1 and run all the way to station 2. So how do I set the spawn location?

Link to comment
Share on other sites

The game recognizes to what station each vehicle belongs by the virtual object it is colliding with.

We're talking about the virtual objects "fs_squad01" and "fs_squad02".

Example: When the HAZMAT squad collides with the virtual object "fs_squad02" (which belongs to the second station), the personnel will spawn in fire station 2.

In your case, the vehicle does not collide with any of the virtual objects, it uses the default spawn location which is fire station 1.

You can do two things, either make the virtual object bigger or change the default spawn location.

The script you need to change is the "DummyCallCrew" commandscript in LAFireStation.script, but you will get the same problem at fire station 1 if you change the default spawn location to fire station 2. So I suggest you make these virtual objects bigger.

Link to comment
Share on other sites

I dont understand how making the VO would make a difference if there spawning at fs1.

Anyways I added a new span point at FS2.

I defined it at the top of the script:

const char VO_SPAWNFS2[] = "fs_spawnFS2";

const char VO_SQUADFS2[] = "fs_squadFS2";

When I use this bit of code below it throws out a script error when I start freeplay. The error references this line

p.SetPosition(Spawn);

And heres the new DummyCallCrew section.

object DummyCallCrew : CommandScript
{
DummyCallCrew()
{
SetGroupID(DummyGroup);
}

bool CheckGroupVisibility(GameObject *Caller)
{
return false;
}

bool CheckPossible(GameObject *Caller)
{
return false;
}

void PushActions(GameObject *Caller, Actor *Target, int ChildID)
{
Vehicle v(Caller);
if(v.IsCollidingWithVirtualObject(VO_SQUAD01))
{
ActorList l1 = Game::GetActors(VO_SPAWN01);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();

GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION);
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);
}
}
}
else if(v.IsCollidingWithVirtualObject(VO_SQUAD02))
{
ActorList l1 = Game::GetActors(VO_SPAWN03);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();

GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION2);
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);
}
}
}
else if(v.IsCollidingWithVirtualObject(VO_SQUADFS2))
{
ActorList l1 = Game::GetActors(VO_SPAWNFS2);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();

GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION2);
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);
}
}
}
else
{
ActorList l1 = Game::GetActors(VO_SPAWN02);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();
}

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_EMS_CAPTAIN, UNNAMED);
else
return;

p.SetUpgradeLevel(3);
Game::FindFreePosition(&p, Spawn, 250);
p.SetPosition(Spawn);
p.PushActionMove(ACTION_NEWLIST, &v, TARGET_ANY);
p.PushActionTurnTo(ACTION_APPEND, &v);
p.PushActionEnterCar(ACTION_APPEND, &v);
}
};

Link to comment
Share on other sites

Hey Jon thanks for the reply, sadly its not that simple. Well it is, but now I have a script error. I have checked the opening and closing of brackets, checked the new lines against similar lines of code from right above it in the script, and everything seems fine. The new SQUAD Vo and spawn VO are in place on the map, but it throws me an error about the line

 p.SetPosition(Spawn);

EDIT: Got it fixed.

Link to comment
Share on other sites

check this one out. if you need more explanation just let me know

object DummyCallCrew : CommandScript

{

DummyCallCrew()

{

SetGroupID(DummyGroup);

}

bool CheckGroupVisibility(GameObject *Caller)

{

return false;

}

bool CheckPossible(GameObject *Caller)

{

return false;

}

void PushActions(GameObject *Caller, Actor *Target, int ChildID)

{

Vehicle v(Caller);

if(v.IsCollidingWithVirtualObject(VO_SQUAD01))

{

ActorList l1 = Game::GetActors(VO_SPAWN01);

if(l1.GetNumActors() > 0)

Vector Spawn = l1.GetActor(0)->GetPosition();

GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION);

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);

}

}

}

else if(v.IsCollidingWithVirtualObject(VO_SQUAD02))

{

ActorList l1 = Game::GetActors(VO_SPAWN03);

if(l1.GetNumActors() > 0)

Vector Spawn = l1.GetActor(0)->GetPosition();

GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION2);

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);

}

}

}

else

{

ActorList l1 = Game::GetActors(VO_SPAWN02);

if(l1.GetNumActors() > 0)

Vector Spawn = l1.GetActor(0)->GetPosition();

}

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_EMS_CAPTAIN, UNNAMED);

else if (ChildID == 9)

Person p = Game::CreatePerson(OBJ_FF_CAPTAIN, UNNAMED);

else

return;

p.SetUpgradeLevel(3);

Game::FindFreePosition(&p, Spawn, 250);

p.SetPosition(Spawn);

p.PushActionMove(ACTION_NEWLIST, &v, TARGET_ANY);

p.PushActionTurnTo(ACTION_APPEND, &v);

p.PushActionEnterCar(ACTION_APPEND, &v);

}

};

- edited because i used the wrong script -

also, how do you put it in the little script boxes?

- Jon

Link to comment
Share on other sites

So everything spawns now, but I have a problem. I removed the door off of the rear of FS2 by the parking spaces. I then placed the spawn point for the additional units inside FS2. I checked the model and it has physics, but yet ffs run through the wall like ghosts rather then the door.

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