Xplorer4x4 Posted October 7, 2009 Report Share Posted October 7, 2009 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? Quote Link to comment Share on other sites More sharing options...
Guest [SAP]Francis Posted October 7, 2009 Report Share Posted October 7, 2009 With a different command call, let me go through the script.EDIT: Can't find it with the new 1.9 one. Sorry Quote Link to comment Share on other sites More sharing options...
Hoppah Posted October 8, 2009 Report Share Posted October 8, 2009 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. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 8, 2009 Author Report Share Posted October 8, 2009 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 linep.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); }}; Quote Link to comment Share on other sites More sharing options...
Texas_DPS Posted October 8, 2009 Report Share Posted October 8, 2009 when you change the VO for the squad to cover the new unit it will tell the game that is where they are and will spawn them at the appropriate area.- Jon Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 8, 2009 Author Report Share Posted October 8, 2009 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. Quote Link to comment Share on other sites More sharing options...
Texas_DPS Posted October 8, 2009 Report Share Posted October 8, 2009 check this one out. if you need more explanation just let me knowobject 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 Quote Link to comment Share on other sites More sharing options...
SirMoo Posted October 9, 2009 Report Share Posted October 9, 2009 What's the difference in OBJ_FF_CAPTAIN and OBJ_CHIEF? OR did you just create a second object for the same guy? Child 4 and 9. Quote Link to comment Share on other sites More sharing options...
Texas_DPS Posted October 9, 2009 Report Share Posted October 9, 2009 yeah, that is for my personal mod, i have a ff chief and a ff captain. i put capt in with als firetrucks and ladders.- Jon Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 9, 2009 Author Report Share Posted October 9, 2009 Hey Jon the code was actually right. I had named a VO wrong. Thanks all the same. Quote Link to comment Share on other sites More sharing options...
Texas_DPS Posted October 9, 2009 Report Share Posted October 9, 2009 not a prob, glad it worked out.- Jon Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 9, 2009 Author Report Share Posted October 9, 2009 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. Quote Link to comment Share on other sites More sharing options...
Texas_DPS Posted October 9, 2009 Report Share Posted October 9, 2009 could you post a screen so i can see, if you dont mind, im not quite getting it.- Jon Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 14, 2009 Author Report Share Posted October 14, 2009 Ill grab a screen shot later, but basically, the ffs run through the wall in fs2 despite it having physics. Quote Link to comment Share on other sites More sharing options...
Texas_DPS Posted October 14, 2009 Report Share Posted October 14, 2009 you could put the VO right where the door was, maybe that will be ok?- Jon Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 14, 2009 Author Report Share Posted October 14, 2009 Possibly, but it seems as though the building has no physics. Quote Link to comment Share on other sites More sharing options...
Texas_DPS Posted October 14, 2009 Report Share Posted October 14, 2009 you could always cheat and put up some VO barriers so they funnel out the door. just an idea.- Jon Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 14, 2009 Author Report Share Posted October 14, 2009 Barricades dont help, they run through them Quote Link to comment Share on other sites More sharing options...
Texas_DPS Posted October 14, 2009 Report Share Posted October 14, 2009 we are still talking about FS2 right, the new one?- Jon Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 15, 2009 Author Report Share Posted October 15, 2009 yes we are. Quote Link to comment Share on other sites More sharing options...