saxguitar Posted August 2, 2009 Report Share Posted August 2, 2009 I've been trying to replace the hazmat vehicle in station 2 with a ladder truck, and I think I've done a good portion of it right. But when i go to start the game this is what comes up...look at the attached picture if it works. He is the LAFireStationStart script//******************************************************************************************// #Version 1.0#//// Includes: Start command de spawn vehicles.//// - VcmdStart//// Script by Hoppah// // Usage of this script in other mods is NOT allowed without permission of Hoppah////******************************************************************************************const char NAME_FIRESTATION[] = "fire_station";const char NAME_FIRESTATION_ROOF[] = "fire_station_roof";const char NAME_FIRESTATION2[] = "fire_station2";const char NAME_FIRESTATION2_ROOF[] = "fire_station2_roof";const char NAME_CONTROLPANEL[] = "fire_station_controlpanel";const char NAME_CONTROLPANEL2[] = "fire_station_controlpanel2";const char OBJ_AMBULANCE01[] = "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance01.e4p";const char OBJ_AMBULANCE02[] = "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance02.e4p";const char OBJ_BATTALION[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p";const char OBJ_BRUSH[] = "mod:Prototypes/Vehicles/02 LA Fire Department/brush_truck.e4p";const char OBJ_HES[] = "mod:Prototypes/Vehicles/02 LA Fire Department/heavy_equipment_squad.e4p";const char OBJ_USAR[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";const char OBJ_LADDER[] = "mod:Prototypes/Vehicles/02 LA Fire Department/aerial_ladder.e4p";const char OBJ_ENGINE01[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine1.e4p";const char OBJ_ENGINE02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine2.e4p";const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p";const char DUMMY_GATES[] = "DummyGates";const char DUMMY_ALARM[] = "DummyDisableAlarm";const char DUMMY_CALLCREW[] = "DummyCallCrew";const char VO_BATTALION[] = "fs_battalion";const char VO_BRUSH[] = "fs_brush";const char VO_HES[] = "fs_hes";const char VO_AMBULANCE01[] = "fs_ambulance01";const char VO_AMBULANCE02[] = "fs_ambulance02";const char VO_AMBULANCE04[] = "fs_ambulance04";const char VO_USAR[] = "fs_usar";const char VO_LADDER[] = "fs_ladder";const char VO_ENGINE01[] = "fs_engine01";const char VO_ENGINE02[] = "fs_engine02";const char VO_ENGINE05[] = "fs_engine05";const char VO_HAZMAT[] = "fs_hazmat";const char NAME_GATE06A[] = "fs_gate06a";const char NAME_GATE07A[] = "fs_gate07a";const char NAME_GATE08A[] = "fs_gate08a";const char SND_ALARM[] = "mod:Audio/FX/Misc/fire_alarm.wav";const char UNNAMED[] = "Unnamed";object VcmdStart : CommandScript{ VcmdStart() { } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION); for(int i=0; i < l1.GetNumObjects(); i++) { GameObject *obj = l1.GetObject(i); if (!obj->IsSpecialLightEnabled()) { obj->EnableSpecialLights(true); Vector AlarmSnd = obj->GetPosition(); int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true); obj->SetUserData(soundID); obj->AttachSound(soundID); } } 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); Vector AlarmSnd = obj->GetPosition(); int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true); obj->SetUserData(soundID); obj->AttachSound(soundID); } } GameObjectList l3 = Game::GetGameObjects(NAME_CONTROLPANEL); for(int i=0; i < l3.GetNumObjects(); i++) { GameObject *obj = l3.GetObject(i); obj->AssignCommand(DUMMY_ALARM); obj->PushActionWait(ACTION_NEWLIST, 1.5f); obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 1, false); obj->PushActionWait(ACTION_APPEND, 16.0f); obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false); } GameObjectList l4 = Game::GetGameObjects(NAME_CONTROLPANEL2); for(int i=0; i < l4.GetNumObjects(); i++) { GameObject *obj = l4.GetObject(i); obj->AssignCommand(DUMMY_ALARM); obj->PushActionWait(ACTION_NEWLIST, 1.5f); obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false); obj->PushActionWait(ACTION_APPEND, 16.0f); obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false); } GameObjectList l5 = Game::GetGameObjects(NAME_FIRESTATION_ROOF); for(int i=0; i < l5.GetNumObjects(); i++) { GameObject *obj = l5.GetObject(i); if(obj->GetUserData() == 0) { obj->Hide(); obj->SetUserData(1); } } GameObjectList l51 = Game::GetGameObjects(NAME_FIRESTATION2_ROOF); for(int i=0; i < l51.GetNumObjects(); i++) { GameObject *obj = l51.GetObject(i); if(obj->GetUserData() == 0) { obj->Hide(); obj->SetUserData(1); } } ActorList l6 = Game::GetActors(VO_BATTALION); for(int i=0; i < l6.GetNumActors(); i++) { Vector Battalion = l6.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_BATTALION, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Battalion); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l7 = Game::GetActors(VO_AMBULANCE01); for(int i=0; i < l7.GetNumActors(); i++) { Vector Ambulance01 = l7.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ambulance01); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetMaxTransports(1); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false); } ActorList l8 = Game::GetActors(VO_AMBULANCE02); for(int i=0; i < l8.GetNumActors(); i++) { Vector Ambulance02 = l8.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ambulance02); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetMaxTransports(1); m.SetSpeed(12.0f); m.PushActionWait(ACTION_NEWLIST, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false); } ActorList l9 = Game::GetActors(VO_LADDER); for(int i=0; i < l9.GetNumActors(); i++) { Vector Ladder = l9.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_LADDER, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ladder); m.UpdatePlacement(); m.SetMaxPassengers(6); m.SetSpeed(9.0f); m.PushActionWait(ACTION_NEWLIST, 1.4f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); } ActorList l10 = Game::GetActors(VO_ENGINE01); for(int i=0; i < l10.GetNumActors(); i++) { Vector Engine01 = l10.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_ENGINE01, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Engine01); m.UpdatePlacement(); m.SetMaxPassengers(6); m.SetSpeed(9.0f); m.PushActionWait(ACTION_NEWLIST, 3.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 1.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l11 = Game::GetActors(VO_ENGINE02); for(int i=0; i < l11.GetNumActors(); i++) { Vector Engine02 = l11.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_ENGINE02, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Engine02); m.UpdatePlacement(); m.SetMaxPassengers(6); m.SetSpeed(9.0f); m.PushActionWait(ACTION_NEWLIST, 3.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 1.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l12 = Game::GetActors(VO_USAR); for(int i=0; i < l12.GetNumActors(); i++) { Vector Usar = l12.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_USAR, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Usar); m.UpdatePlacement(); m.SetMaxPassengers(4); m.SetSpeed(9.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 6, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false); } ActorList l13 = Game::GetActors(VO_AMBULANCE04); for(int i=0; i < l13.GetNumActors(); i++) { GameObjectList gate08a = Game::GetGameObjects(NAME_GATE08A); for(int i=0; i < gate08a.GetNumObjects(); i++) GameObject *gate = gate08a.GetObject(i); Vector Ambulance04 = l13.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE01, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ambulance04); m.SetRotation(gate); 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); } ActorList l14 = Game::GetActors(VO_ENGINE05); for(int i=0; i < l14.GetNumActors(); i++) { GameObjectList gate07a = Game::GetGameObjects(NAME_GATE07A); for(int i=0; i < gate07a.GetNumObjects(); i++) GameObject *gate = gate07a.GetObject(i); Vector Engine04 = l14.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_ENGINE01, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Engine04); m.SetRotation(gate); m.UpdatePlacement(); m.SetMaxPassengers(6); m.SetSpeed(9.0f); m.PushActionWait(ACTION_NEWLIST, 4.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l15 = Game::GetActors(VO_LADDER); 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 LADDER = l15.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_LADDER, UNNAMED); m.EnableBlueLights(false); m.SetPosition(LADDER); m.SetRotation(gate); m.UpdatePlacement(); m.SetMaxPassengers(4); m.SetSpeed(8.0f); m.PushActionWait(ACTION_NEWLIST, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 1.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); } ActorList l16 = Game::GetActors(VO_BRUSH); for(int i=0; i < l16.GetNumActors(); i++) { Vector Brush = l16.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_BRUSH, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Brush); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l17 = Game::GetActors(VO_HES); for(int i=0; i < l17.GetNumActors(); i++) { Vector Hes = l17.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_HES, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Hes); m.UpdatePlacement(); m.SetMaxPassengers(4); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); } System::Log("Fire stations activated!"); }}; Quote Link to comment Share on other sites More sharing options...
randomperson139 Posted August 2, 2009 Report Share Posted August 2, 2009 Does the Ladder actually fit in Fire Station 2? Quote Link to comment Share on other sites More sharing options...
saxguitar Posted August 2, 2009 Author Report Share Posted August 2, 2009 It should it is the same size as the hazmat vehicle..how do i put the script into a code box thing? Quote Link to comment Share on other sites More sharing options...
Hoppah Posted August 2, 2009 Report Share Posted August 2, 2009 Please use the code tags next time. It's hard to read a script without the tabs.But looking at the picture I didn't even had to look at the script. You have put the aerial for FS2 on the same virtual object as the aerial ladder for FS1.You should NOT change the virtual objects, so change VO_LADDER back to VO_HAZMAT. These are only constants. The only thing you have to change is the path to the prototype of the aerial ladder which has to spawn on the HAZMAT virtual object in FS2. Quote Link to comment Share on other sites More sharing options...
saxguitar Posted August 2, 2009 Author Report Share Posted August 2, 2009 Please use the code tags next time. It's hard to read a script without the tabs.But looking at the picture I didn't even had to look at the script. You have put the aerial for FS2 on the same virtual object as the aerial ladder for FS1.You should NOT change the virtual objects and change VO_LADDER back to VO_HAZMAT. These are only constants.How do I put it in the script box????and specifically what should i change? Quote Link to comment Share on other sites More sharing options...
Hoppah Posted August 2, 2009 Report Share Posted August 2, 2009 There is that little button above the text window where you type the text. Quote Link to comment Share on other sites More sharing options...
saxguitar Posted August 2, 2009 Author Report Share Posted August 2, 2009 There, I'm trying to get better at scripting and such so excuse my many questions and mistakes. Now what specifically are the virtual objects I should change back?In the picture you can notice that the second ladder is there, and gets staffed as i set it, but station 2 has the empty bay where the ladder should be Quote Link to comment Share on other sites More sharing options...
Hoppah Posted August 2, 2009 Report Share Posted August 2, 2009 ActorList l15 = Game::GetActors(VO_LADDER);you have VO_LADDER twice, what means a vehicle gets spawned in that virtual object twice.Change the second VO_LADDER back to how to how it was; VO_HAZMAT.Names of certain codes mean nothing, it's the logic you need to try to understand. VO_HAZMAT and VO_LADDER refer to ingame virtual objects which are used to find positions of the spawned vehicles.That's what I also wrote in my unfinished tutorial, don't change the things which are not even mentioned.If you try to analyse the script you'll find the code "CreateVehicle". I think it's pretty clear what it does. That's only thing you need to change... Quote Link to comment Share on other sites More sharing options...
saxguitar Posted August 2, 2009 Author Report Share Posted August 2, 2009 Heres what I tried const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p"; toconst char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/aerial_ladder.e4p";I also added to FF/Paramedic guys to the ladder which worked fine, but I dont think thats interferring or anything//******************************************************************************************// #Version 1.0#//// Includes: Start command de spawn vehicles.//// - VcmdStart//// Script by Hoppah// // Usage of this script in other mods is NOT allowed without permission of Hoppah////******************************************************************************************const char NAME_FIRESTATION[] = "fire_station";const char NAME_FIRESTATION_ROOF[] = "fire_station_roof";const char NAME_FIRESTATION2[] = "fire_station2";const char NAME_FIRESTATION2_ROOF[] = "fire_station2_roof";const char NAME_CONTROLPANEL[] = "fire_station_controlpanel";const char NAME_CONTROLPANEL2[] = "fire_station_controlpanel2";const char OBJ_AMBULANCE01[] = "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance01.e4p";const char OBJ_AMBULANCE02[] = "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance02.e4p";const char OBJ_BATTALION[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p";const char OBJ_BRUSH[] = "mod:Prototypes/Vehicles/02 LA Fire Department/brush_truck.e4p";const char OBJ_HES[] = "mod:Prototypes/Vehicles/02 LA Fire Department/heavy_equipment_squad.e4p";const char OBJ_USAR[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";const char OBJ_LADDER[] = "mod:Prototypes/Vehicles/02 LA Fire Department/aerial_ladder.e4p";const char OBJ_ENGINE01[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine1.e4p";const char OBJ_ENGINE02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine2.e4p";const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p";const char DUMMY_GATES[] = "DummyGates";const char DUMMY_ALARM[] = "DummyDisableAlarm";const char DUMMY_CALLCREW[] = "DummyCallCrew";const char VO_BATTALION[] = "fs_battalion";const char VO_BRUSH[] = "fs_brush";const char VO_HES[] = "fs_hes";const char VO_AMBULANCE01[] = "fs_ambulance01";const char VO_AMBULANCE02[] = "fs_ambulance02";const char VO_AMBULANCE04[] = "fs_ambulance04";const char VO_USAR[] = "fs_usar";const char VO_LADDER[] = "fs_ladder";const char VO_ENGINE01[] = "fs_engine01";const char VO_ENGINE02[] = "fs_engine02";const char VO_ENGINE05[] = "fs_engine05";const char VO_HAZMAT[] = "fs_hazmat";const char NAME_GATE06A[] = "fs_gate06a";const char NAME_GATE07A[] = "fs_gate07a";const char NAME_GATE08A[] = "fs_gate08a";const char SND_ALARM[] = "mod:Audio/FX/Misc/fire_alarm.wav";const char UNNAMED[] = "Unnamed";object VcmdStart : CommandScript{ VcmdStart() { } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION); for(int i=0; i < l1.GetNumObjects(); i++) { GameObject *obj = l1.GetObject(i); if (!obj->IsSpecialLightEnabled()) { obj->EnableSpecialLights(true); Vector AlarmSnd = obj->GetPosition(); int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true); obj->SetUserData(soundID); obj->AttachSound(soundID); } } 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); Vector AlarmSnd = obj->GetPosition(); int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true); obj->SetUserData(soundID); obj->AttachSound(soundID); } } GameObjectList l3 = Game::GetGameObjects(NAME_CONTROLPANEL); for(int i=0; i < l3.GetNumObjects(); i++) { GameObject *obj = l3.GetObject(i); obj->AssignCommand(DUMMY_ALARM); obj->PushActionWait(ACTION_NEWLIST, 1.5f); obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 1, false); obj->PushActionWait(ACTION_APPEND, 16.0f); obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false); } GameObjectList l4 = Game::GetGameObjects(NAME_CONTROLPANEL2); for(int i=0; i < l4.GetNumObjects(); i++) { GameObject *obj = l4.GetObject(i); obj->AssignCommand(DUMMY_ALARM); obj->PushActionWait(ACTION_NEWLIST, 1.5f); obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false); obj->PushActionWait(ACTION_APPEND, 16.0f); obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false); } GameObjectList l5 = Game::GetGameObjects(NAME_FIRESTATION_ROOF); for(int i=0; i < l5.GetNumObjects(); i++) { GameObject *obj = l5.GetObject(i); if(obj->GetUserData() == 0) { obj->Hide(); obj->SetUserData(1); } } GameObjectList l51 = Game::GetGameObjects(NAME_FIRESTATION2_ROOF); for(int i=0; i < l51.GetNumObjects(); i++) { GameObject *obj = l51.GetObject(i); if(obj->GetUserData() == 0) { obj->Hide(); obj->SetUserData(1); } } ActorList l6 = Game::GetActors(VO_BATTALION); for(int i=0; i < l6.GetNumActors(); i++) { Vector Battalion = l6.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_BATTALION, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Battalion); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l7 = Game::GetActors(VO_AMBULANCE01); for(int i=0; i < l7.GetNumActors(); i++) { Vector Ambulance01 = l7.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ambulance01); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetMaxTransports(1); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false); } ActorList l8 = Game::GetActors(VO_AMBULANCE02); for(int i=0; i < l8.GetNumActors(); i++) { Vector Ambulance02 = l8.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ambulance02); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetMaxTransports(1); m.SetSpeed(12.0f); m.PushActionWait(ACTION_NEWLIST, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false); } ActorList l9 = Game::GetActors(VO_LADDER); for(int i=0; i < l9.GetNumActors(); i++) { Vector Ladder = l9.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_LADDER, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ladder); m.UpdatePlacement(); m.SetMaxPassengers(6); m.SetSpeed(9.0f); m.PushActionWait(ACTION_NEWLIST, 1.4f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); } ActorList l10 = Game::GetActors(VO_ENGINE01); for(int i=0; i < l10.GetNumActors(); i++) { Vector Engine01 = l10.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_ENGINE01, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Engine01); m.UpdatePlacement(); m.SetMaxPassengers(6); m.SetSpeed(9.0f); m.PushActionWait(ACTION_NEWLIST, 3.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 1.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l11 = Game::GetActors(VO_ENGINE02); for(int i=0; i < l11.GetNumActors(); i++) { Vector Engine02 = l11.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_ENGINE02, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Engine02); m.UpdatePlacement(); m.SetMaxPassengers(6); m.SetSpeed(9.0f); m.PushActionWait(ACTION_NEWLIST, 3.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 1.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l12 = Game::GetActors(VO_USAR); for(int i=0; i < l12.GetNumActors(); i++) { Vector Usar = l12.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_USAR, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Usar); m.UpdatePlacement(); m.SetMaxPassengers(4); m.SetSpeed(9.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 6, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false); } ActorList l13 = Game::GetActors(VO_AMBULANCE04); for(int i=0; i < l13.GetNumActors(); i++) { GameObjectList gate08a = Game::GetGameObjects(NAME_GATE08A); for(int i=0; i < gate08a.GetNumObjects(); i++) GameObject *gate = gate08a.GetObject(i); Vector Ambulance04 = l13.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE01, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ambulance04); m.SetRotation(gate); 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); } ActorList l14 = Game::GetActors(VO_ENGINE05); for(int i=0; i < l14.GetNumActors(); i++) { GameObjectList gate07a = Game::GetGameObjects(NAME_GATE07A); for(int i=0; i < gate07a.GetNumObjects(); i++) GameObject *gate = gate07a.GetObject(i); Vector Engine04 = l14.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_ENGINE01, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Engine04); m.SetRotation(gate); m.UpdatePlacement(); m.SetMaxPassengers(6); m.SetSpeed(9.0f); m.PushActionWait(ACTION_NEWLIST, 4.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 1.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } 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); } ActorList l16 = Game::GetActors(VO_BRUSH); for(int i=0; i < l16.GetNumActors(); i++) { Vector Brush = l16.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_BRUSH, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Brush); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false); } ActorList l17 = Game::GetActors(VO_HES); for(int i=0; i < l17.GetNumActors(); i++) { Vector Hes = l17.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_HES, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Hes); m.UpdatePlacement(); m.SetMaxPassengers(4); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false); } System::Log("Fire stations activated!"); }}; Quote Link to comment Share on other sites More sharing options...
Hoppah Posted August 2, 2009 Report Share Posted August 2, 2009 Looks good. Quote Link to comment Share on other sites More sharing options...
saxguitar Posted August 2, 2009 Author Report Share Posted August 2, 2009 Finally it works, it only hangs out a little bit, but it shouldn't cause any issues...will it??How would I change where vehicles start though, like say I wanted engine 2 in FS1 to be where USAR is and USAR to be where it is, but not change it in FS 2?? Quote Link to comment Share on other sites More sharing options...
pyrothijs Posted August 3, 2009 Report Share Posted August 3, 2009 How would I change where vehicles start though, like say I wanted engine 2 in FS1 to be where USAR is and USAR to be where it is, but not change it in FS 2??I'm not sure I understand, what you mean by that, can you try to explain it again? It looks like you want to switch engine 2 and the USAR, correct?moved to the alterations subforum Quote Link to comment Share on other sites More sharing options...
Hoppah Posted August 3, 2009 Report Share Posted August 3, 2009 Unless you have alot of scripting experience I wouldn't advise to change the spots of the engine's. They have a far more extensive script than the other vehicles. For example, finding the closest station and parking 2 engine's behind each other. You would need to rip that script apart. Quote Link to comment Share on other sites More sharing options...
Guest RES6CUE Posted March 1, 2010 Report Share Posted March 1, 2010 Yo Hoppah I am new to this and was wonder how u can replace the tower/ladder in FS1 to the Tiller. And another question is there a way to assign guys u want to each truck. like 4 on the E and 5 on the ladder. thanks for your help, you did a good job on the game. Quote Link to comment Share on other sites More sharing options...
Hoppah Posted March 2, 2010 Report Share Posted March 2, 2010 Yo Hoppah I am new to this and was wonder how u can replace the tower/ladder in FS1 to the Tiller. And another question is there a way to assign guys u want to each truck. like 4 on the E and 5 on the ladder. thanks for your help, you did a good job on the game.There already is a sticky topic about that:You can find information about the staffing here: Quote Link to comment Share on other sites More sharing options...