Ghost Graphic Designs Posted April 30, 2014 Report Share Posted April 30, 2014 Hi. I've been working on my modification and I need to find a way for the vehicles to spawn at a certain VO without lights and crew. I've tried to take a look into Copenhagen's start-up script (and mG3 city mod) and I don't really understand what to do. I just need a simple script to make 30 vehicles spawn in their respective Virtual Objects with no lights and with space for the fire fighters, paramedics and police officers (and transports) to get in. If someone could help me out, it would be extremely appreciated! Quote Link to comment Share on other sites More sharing options...
bma Posted April 30, 2014 Report Share Posted April 30, 2014 Then you are looking the right place I know the script can be confusing, but line line 3 -> 72 can be deleted because it is only in Copenhagen it is needed. But what you are looking at is vl=Game::GetGameObjects("P_P1"); // * if(vl.GetNumObjects() > 0) { Mission::PlayHint("P1 er allerede på mappet"); // * } else { l1=Game::GetActors("P_P1"); // * if(l1.GetNumActors() > 0) { parkobj = *l1.GetActor(0); parkplatz = parkobj.GetPosition(); v = Game::CreateVehicle("mod:Prototypes/Vehicles/Fire Department/P1.e4p","P1"); // ** v.SetMaxPassengers(2); // * v.SetMaxTransports(0); // * v.EnableBlueLights(false); v.EnableBreakLights(false); v.EnableSpecialLights(false); v.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]); Math::EulerToMatrix(180.f, 0.f, 0.f, childRot); // * Math::MultiplyMatrices(childRot, rot); v.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]); v.SetPosition(parkplatz); v.SetCommandable(false); v.RemoveCommand("GoHome"); v.AssignCommand("ParkAtBase"); v.AssignCommand("Dummy_Free"); v.AssignCommand("Dummy_Parked"); v.AssignCommand("Dummy_OMC"); } else { Mission::PlayHint("P pladsen kan ikke findes"); // * } }It can be confusing, but it really isn't lets walk threw it: vl=Game::GetGameObjects("P_P1"); // * <- Is the virtuel objectif(vl.GetNumObjects() > 0){Mission::PlayHint("P1 er allerede på mappet"); // *}else{l1=Game::GetActors("P_P1"); // * <- Is the virtuel objectif(l1.GetNumActors() > 0){parkobj = *l1.GetActor(0);parkplatz = parkobj.GetPosition();v = Game::CreateVehicle("mod:Prototypes/Vehicles/Fire Department/P1.e4p","P1"); // ** <- Is creating the vehicle(the place of the prototype and the name)v.SetMaxPassengers(2); // * <- Amount of passengersv.SetMaxTransports(0); // * <- Amount of transports(for ambulances or police cars)v.EnableBlueLights(false); <- Turn off blue lightv.EnableBreakLights(false); <- Turn off break lightv.EnableSpecialLights(false); <- Turn off special lightsv.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);Math::EulerToMatrix(180.f, 0.f, 0.f, childRot); // * <- Rotates the car(360 is all the way around, 180 is half the way around ect)Math::MultiplyMatrices(childRot, rot);v.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);v.SetPosition(parkplatz);v.SetCommandable(false); <- Make the car not controlablev.RemoveCommand("GoHome"); <- Remove random commandv.AssignCommand("ParkAtBase"); <- Assign random commandv.AssignCommand("Dummy_Free"); <- Assign random commandv.AssignCommand("Dummy_Parked"); <- Assign random commandv.AssignCommand("Dummy_OMC"); <- Assign random command}else{Mission::PlayHint("P pladsen kan ikke findes"); // *}} All you need to focus on is the lines i have marked with red and described This describes 1 car, look at the script and you will see that it is just theese lines repeated over and over again with different cars Quote Link to comment Share on other sites More sharing options...
Ghost Graphic Designs Posted April 30, 2014 Author Report Share Posted April 30, 2014 Thanks alot, bro! That was really helpful. Gonna see if I can do it. I'll try to bring news on the next days. Quote Link to comment Share on other sites More sharing options...
bma Posted April 30, 2014 Report Share Posted April 30, 2014 Have fun, just dont copy paste the one with all the arrows. You will get a ton of errors then Look at the already excisting script and use it Quote Link to comment Share on other sites More sharing options...
Ghost Graphic Designs Posted April 30, 2014 Author Report Share Posted April 30, 2014 Will do! Thanks for the support. Quote Link to comment Share on other sites More sharing options...