Jump to content
killednemo65

how to make vehicles spawn in with siren from menu? LA MOD

Recommended Posts

i know if you hold shift while spawning vehicles, they will come into map without siren and lights. But how do i make them spawn in with sirens and lights IN CAMPAIGN? currently they spawn in with just lights. Is there something i must edit in parameters? Also, what does the Vehicle - Introduction mean in game settings? i can check it ON/OFF

 

-Thanks

Link to comment
Share on other sites

First...the vehicle introduction is simply that side menu that introduces each vehicle when you select them in the send vehicle menu.

Second...for your main problem of making the sirens work in campaign, that would require a change to EACH mission script which would probably involve something like this. (DON'T MODIFY YOUR SCRIPTS UNLESS YOU KNOW WHAT YOU ARE DOING!)

void OnSquadVehicleArrived(Vehicle *v)
{
    if (v->HasCommand("VcmdSiren"))
    {
        Vehicle veh = *v;
        Game::ExecuteCommand("VcmdSiren", &veh, &veh);
    }
}

Link to comment
Share on other sites

Nope....only works in mission scripts.

For freeplay, you would have to create a looping script that checks the spawnpoints for any emergency vehicles with siren commands and then activates the siren command in these vehicles. It would have to check a group of VO's that are positioned where the vehicles spawn so that it will only activate their commands and not the sirens of every emergency car in the whole map.

I actually have a "partially" working version. PM for information.

Link to comment
Share on other sites

Could be useful, though I'm in the process of completely eliminating the vehicle menus in my freeplay and relying on the call scripts for both replacement and additional vehicles. That way I can limit it to one of each vehicle, and have spawn delays.

I like the sound of this! Is this really complicated to get working?

Link to comment
Share on other sites

Here's the "buy" section of my ALS RA script. If you are missing one of the on-map vehicles, it will replace those instead of off-map ones.

Vector Spawn;Vector Rotate;ActorList l1 = Game::GetActors(VO_SPAWN_ALL);ActorList l2 = Game::GetActors(VO_SPAWN_AMB);ActorList l3 = Game::GetActors(VO_SPAWN_ALLR);ActorList l4 = Game::GetActors(VO_SPAWN_AMBR);if(l1.GetNumActors() > 0){    Spawn = l1.GetActor(0)->GetPosition();    Rotate = l3.GetActor(0)->GetPosition();}else if(l2.GetNumActors() > 0){    Spawn = l2.GetActor(0)->GetPosition();    Rotate = l4.GetActor(0)->GetPosition();}else{    Mission::PlayHint(HINT_NO);    return;}        int Money = Mission::GetMoneyLeft();System::Log("Dispatch off-map ALS Ambulance");bool amb2a = true;            bool amb2d = true;            bool amb2e = true;        bool amb2f = true;        bool amb2g = true;            bool amb5 = true;        bool amb5a = true;        bool amb5b = true;        GameObjectList l5 = Game::GetGameObjects("amb2a");GameObjectList l6 = Game::GetGameObjects("amb2d");GameObjectList l7 = Game::GetGameObjects("amb2e");GameObjectList l8 = Game::GetGameObjects("amb2f");GameObjectList l9 = Game::GetGameObjects("amb2g");GameObjectList l10 = Game::GetGameObjects("amb5");GameObjectList l11 = Game::GetGameObjects("amb5a");GameObjectList l12 = Game::GetGameObjects("amb5b");if(l5.GetNumObjects() > 0)    amb2a = false;if(l6.GetNumObjects() > 0)    amb2d = false;if(l7.GetNumObjects() > 0)    amb2e = false;if(l8.GetNumObjects() > 0)    amb2f = false;if(l9.GetNumObjects() > 0)    amb2g = false;if(l10.GetNumObjects() > 0)    amb5 = false;if(l11.GetNumObjects() > 0)    amb5a = false;if(l12.GetNumObjects() > 0)    amb5b = false;if (Money <= 850 || (!amb2a && !amb2d && !amb2e && !amb2f && !amb2g && !amb5 && !amb5a && !amb5b )){    Mission::PlayHint(HINT_NO);    return;}            Vehicle n;Person p1;Person p2;if (amb5){    amb2e = false;    amb5a = false;    amb2f = false;    amb5b = false;    amb2g = false;    amb2a = false;    amb2d = false;    Mission::PlayHint("Replacement unit responding!");    n = Game::CreateVehicle(VEH_AMB5, "amb5");}else if (amb2e){    amb5a = false;    amb2f = false;    amb5b = false;    amb2g = false;    amb2a = false;    amb2d = false;    Mission::PlayHint("Replacement unit responding!");    n = Game::CreateVehicle(VEH_AMB2E, "amb2e");}else if (amb2d){    amb5a = false;    amb2f = false;    amb5b = false;    amb2g = false;    amb2a = false;    Mission::PlayHint("RA112 responding!");    n = Game::CreateVehicle(VEH_AMB2D, "amb2d");}else if (amb5a){    amb2f = false;    amb5b = false;    amb2g = false;    amb2a = false;    Mission::PlayHint("RA36 responding!");    n = Game::CreateVehicle(VEH_AMB5A, "amb5a");}else if (amb2f){    amb5b = false;    amb2g = false;    amb2a = false;    Mission::PlayHint("RA40 responding!");    n = Game::CreateVehicle(VEH_AMB2F, "amb2f");}else if (amb2a){    amb5b = false;    amb2g = false;    Mission::PlayHint("RA38 responding!");    n = Game::CreateVehicle(VEH_AMB2A, "amb2a");}else if (amb2g){    amb5b = false;    Mission::PlayHint("RA49 responding!");    n = Game::CreateVehicle(VEH_AMB2G, "amb2g");}else if (amb5b){    Mission::PlayHint("RA85 responding!");    n = Game::CreateVehicle(VEH_AMB5B, "amb5b");                }int NewMoney = Money - 850;Mission::SetMoney(NewMoney);p1 = Game::CreatePerson(PER_PM2, "Unnamed");p2 = Game::CreatePerson(PER_PM2, "Unnamed");p1.SetEquipment(EQUIP_EMERGENCY_CASE);p2.SetEquipment(EQUIP_EMERGENCY_CASE);p1.SetPlayerMP(Caller->GetPlayerMP());p2.SetPlayerMP(Caller->GetPlayerMP());p1.SetUpgradeLevel(3);p2.SetUpgradeLevel(3);n.SetMaxPassengers(2);n.SetMaxTransports(1);n.SetSpeed(12.0f);            n.SetPlayerMP(Caller->GetPlayerMP());n.AddPassenger(&p1);n.AddPassenger(&p2);Game::FindFreePosition(&n, Spawn);n.SetPosition(Spawn);n.UpdatePlacement();n.Hide();n.PushActionTurnTo(ACTION_NEWLIST, Rotate);if (amb2d)    n.PushActionWait(ACTION_APPEND, 23.0f);else if (amb5a)    n.PushActionWait(ACTION_APPEND, 24.0f);else if (amb2f)    n.PushActionWait(ACTION_APPEND, 26.0f);else if (amb2a)    n.PushActionWait(ACTION_APPEND, 28.0f);else if (amb2g)    n.PushActionWait(ACTION_APPEND, 29.0f);else if (amb5b)    n.PushActionWait(ACTION_APPEND, 31.0f);else    n.PushActionWait(ACTION_APPEND, 10.0f);n.PushActionShowHide(ACTION_APPEND, false);n.PushActionExecuteCommand(ACTION_APPEND, "VcmdFlashingLights", Caller, 0, false);if (!n.HasCommand("DummyHasSiren") && n.HasCommand("VcmdAutoSirenOff") && !Input::LShiftPressed() && !Input::RShiftPressed())    n.PushActionExecuteCommand(ACTION_APPEND, "VcmdSiren", Caller, 0, false);n.PushActionMove(ACTION_APPEND, CmdPos);

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