Jump to content
jab16

Changing a vehicle

Recommended Posts

Ok guys, Im trying to change ambulance 1 for the LA mod into a police vehicle, I already deleted the virtual object at station 1 cause there is no point of it being there for me. I changed the vehicle type to a STW and changed the personel that spawn in it to police officers, but when I get about 15 seconds ingame it crashes. I have a feeling it has to do with the unit file, so if someone could show me what it should look like that would be great.

Thanks,

Jab16

Link to comment
Share on other sites

<unit id="APD Transport "Paddy Wagon" ">
<campaign>
<missions value="1 2 3 4 13 15 9 8 5 17 12 14 7 19 10 6 18 16 11 20 21 25 26 27 28 29 30 31 32 33 34 35">
<prototype name="mod:Prototypes/Vehicles/01 LA Ambulance/ambulance01.e4p" />
<price value="600" />
<speed value="120" />
<space value="2" />
<loadspace value="1" />
<personnel>
<unit id="LAPD_OFFICER" />
<unit id="LAPD_SWAT">
<defaultcount value="1" />
</unit>
</personnel>
<equipment>
<unit id="AXE" />
</equipment>
</missions>
</campaign>

<freeplay>
<missions value="22">
<prototype name="mod:Prototypes/Vehicles/01 LA Ambulance/ambulance01.e4p" />
<price value="600" />
<speed value="120" />
<space value="3" />
<space value="2" />
<loadspace value="1" />
<personnel>
<unit id="LAPD_OFFICER" />
<unit id="LAPD_SWAT">
<defaultcount value="1" />
</unit>
</personnel>
<equipment>
<unit id="AXE" />
</equipment>
</missions>
</freeplay>
</unit>

here you go, hope it helps :)

Link to comment
Share on other sites

mod:Prototypes/Vehicles/01 LA Ambulance/ambulance01.e4p

Ensure that A. it is no longer associated w/ any ambulance commands... It probrably still has ambulance commands associated to the prototype, hence why you're crashing..

Link to comment
Share on other sites

Into the Editor you want to remove the commands from the vehicle and also check the scripts to ensure that the ambulance prototype is not referenced in them (pay special attention to the commands you know are on the ambo by default like standby and any other medical commands). Also make sure that the scripts for the guy(s) who can call ambulances does not directly speak to the prototype name it's self... In the end imo it would have been easier to just "clone" the ambulance prototype and rename it something else and place it into the game as a new vehicle.

EDIT:

I went through the scripts and there are the ones I am guessing are causing you problems are most likely the "LAFireStation" and "LAFireStationStart" scripts, which probrably take about 15 seconds to "setup" the initial loadout the game runs when you start it... So that's probrably what is going on, the script is probrably pushing the action to put ems into the ambulance when it is no longer permitted to carry them.

Link to comment
Share on other sites

Yes I believe you have to remove the references to the ambulance.

From LAFireStationStart:

const char VO_AMBULANCE01[]				= "fs_ambulance01";
OR
const char VO_AMBULANCE04[] = "fs_ambulance04";

Which if I recall you already removed that VO so there is one problem

		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.SetRotation(gate1);
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);
}

That VO does not exist anymore, so it can't do those commands.

IF it is VO 4 you removed, obviously its the code for VO-O4 you have to pull.

		ActorList l13 = Game::GetActors(VO_AMBULANCE04);
for(int i=0; i < l13.GetNumActors(); i++)
{
Vector Ambulance04 = l13.GetActor(0)->GetPosition();
Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE01, UNNAMED);
m.EnableBlueLights(false);
m.SetPosition(Ambulance04);
m.SetRotation(gate8);
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);
}

This code references Ambulance01, so it either has to become ambulance02 or be removed entirely.

			Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED);

Anywhere you see Ambulance01 referenced must either be removed or changed to ambulance 02.

You must do the same thing to the LaFireStation.script removing/replacing all references to Ambulance01

const char OBJ_AMBULANCE01[]			= "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance01.e4p";

Like I said in the end it would probrably have been easier to just clone the prototype of the ambulance and make it a new prototype entirely.

Link to comment
Share on other sites

okay I think I fixed it by making a clone, all I need to know is how to place a VO in the editor where VO4 is supposed to be. Also I made a clone called ambulance 070Ambulance011, so How do I make it so that I can call it in. I already made the prototypes, model, and unit files.

Link to comment
Share on other sites

Guest Francis

okay I think I fixed it by making a clone, all I need to know is how to place a VO in the editor where VO4 is supposed to be. Also I made a clone called ambulance 070Ambulance011, so How do I make it so that I can call it in. I already made the prototypes, model, and unit files.

For the editor, there is a very useful guide available here, look at the Virtual Objects area in the document.

http://forum.emergen...-editor-manual/

To make the vehicle "spawnable", you must edit the Specs\freeplaybase.xml file to include the new prototype. Also make sure the unit file allows to have the unit in freeplay (id 22).

Link to comment
Share on other sites

Adding vehicles to the game Tutorial

Just follow down the page to around where it starts into UNIT ID: and follow the rest of the steps on down to add it to the User-Interface, thus making it available for use (most of this data you can "borrow" from an already existing vehicle in the police group, just duplicate their data and add your prototype instead of the one that was already there.

Link to comment
Share on other sites

Nadda problem, good luck getting your "new" ambulance faker into the UI without any incident... Replacing the VO shouldn't be too hard, plus it saves you a great deal of script modding that is not really necessary.

Link to comment
Share on other sites

Guest Francis

Nadda problem, good luck getting your "new" ambulance faker into the UI without any incident... Replacing the VO shouldn't be too hard, plus it saves you a great deal of script modding that is not really necessary.

That kind of script edit is that hard for anybody dude. :P

Link to comment
Share on other sites

If the model shows up white, that means the texture file associated with it is no longer in the folder, or alternatively you renamed the texture file to something else such as

070Ambulance011.dds

The texture file for the ambulance is called ambulance01.dds and is associated to the vehicle in the model file, so if you rename the dds file without changing the reference to it in the model file (v3o) it will cause your skin to not appear on the model. I have made that mistake a few times in my run at this game.. Easy to fix, simply open the V3O in notepad and find the following lines

SRF, Body, 0, 0, 0, ambulance-01.dds, 517, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

This is just an example code, the one you are dealing with will say something different simply change the ambulance01.dds to whatever you are calling it now (if you copied the model file and dds anyway) If you are using the original ambulance without a duplicate of the model file I would simply rename it back to what it originally was.

Edit: probrably no longer useful to you.

Link to comment
Share on other sites

Guest Francis

nope, if its too much trouble dont worry about it, I wont die.

We can help as long as we know what really happens. Can you provide pictures so we can clearly see? Also look at the other page. And try to send me your .dds. Thanks.

Link to comment
Share on other sites

My only guess would be that chances are something in the prototype isnt setup right for it to be a cop car, or alternatively you might have incorrectly entered it into the freeplaybase.xml or one of the other docs you had to change... check to ensure that all references to the vehicle you added are spelled correctly because it's possible one of them has something incorrect that is making the vehicle disappear all together. Usually if it's a model problem IE file missing the door children and wheels will still appear.

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