Jump to content
dunwell99D

Adding vehicles to the Menu

Recommended Posts

In this post I will detail how you go about adding your police, fire and ambulance units into the menu without just changing the prototype of an existing unit.

 

For this tutorial I will be using my private edit of the Kent Mod by TACRFan and PottyScotty  all unit credit goes to them.

STEP 1. 

First you need to open up the editor under the vehicles tab create a new directory for each unit type (police, fire, ambulance), once you have set up these directories you can then add your units under their respective directories. Like you would with adding a model to the game you need to set up the lights, commands, traits etc. separately once you have one unit set up you can then start the process of  adding the unit into the menu.

 

STEP 2.

Once you have set up one unit or prototype in the editor, close the editor and go to your game files. For myself I have the Steam edition but its the same file Go To 911  First Responders\Mods\Hampshire sub mod v0.1.65 (KM)\Units\Vehicles\Fire Department

Inside the Fire Department vehicle folder you will see the units from the base game or if like myself your making a private edit the mod which you are basing your mod off of. Inside this folder you will want to create a folder and call it 001_................. Once you have done this come out of the file you just created and go into one of the preexisting files, if your mod is based off of the LA mod by Hoppah or mods based on top of that go into the file of the 110fireengine1. In there you will find 8 DDS files which show the unit and a unit.xml file.

Drag and drop these into the file you have just created.

STEP 4.

Editing the images, if you wish to have  custom image displayed for your unit I would recommend downloading and using paint.net as it can open these .DDS files, when creating your custom image try to use the original as a guide for size.

Once you have edited the image MAKE SURE to save it as a .DDS file. Next open up the Unit.xml file in a program like Notepad++ or Windows notepad. At the top you will see  

<unit id="....."> you can change this to display what the unit will be called when hovering the mouse over it in the menu.

The next thing you will need to change is the prototype

<prototype name="mod:Prototypes/Vehicles/........./.......   .e4p" />

In the first gap you want to put the directory name of the Fire department or Ambulance etc. the next gap is the unit you put in that directory in the editor YOU MUST type every character correctly or it won't work, to help I would recommend opening '911  First Responders\Mods\YOUR MOD\Prototypes\Vehicles\Fire Department\Firetruck.e4p'

Once you have put the name of the vehicle prototype in you will see the <space value="X"> this is how many personnel the vehicle carries. You will also see <loadspace value="X"> this only needs to be changed on an ambulance or police car as this is how many injured people or prisoners that can be carried by the unit.

 

STILL READING WELL DONE :-P

 

The next part says  

<personnel>
                <unit id="EMS_CAPTAIN" />
                <unit id="FF_PARAMEDIC">
                    <defaultcount value="1" />
                </unit>
            </personnel>

If you are building on top of LA mod or ones built on top of this leave the personnel as they are and leave the equipment.

The code should be exactly the same for the Campaign unit code and the Freeplay.

STEP 5.

a) Now you need to locate 4 things first locate the portraits.xml file in the Lang folder  '911  First Responders\Mods\YOUR MOD\Lang\en\portraits open that in Notepad++ or Notepad.

What you need to do is type out:

<string name="ID_PORTRAIT_.............."> Firetruck 1</string>

In the gap for this example you would put FIRETRUCK1 it is important that you remember how you typed this.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

 

b) In the Scripts file open the command folder and find the Siren command script in my case its is LASiren and again open it in your code editor.

You will need to type out the following code:

const char CAR_xx[] ="mod:Prototypes/Vehicles/Firetruck/Firetruck1.e4p";

DON'T forget the semi colon at the end, where the X's are you replace with the number next number in the sequence eg 'const char CAR_01[]' you would put 'const char CAR_02[]'

You then need to add your vehicle to the Javascript if statement

if (StrCompare(v.GetPrototypeFileName(), CAR_XX) == 0)
                soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/XXXXXXXXXX.wav", CarPos, true);    

The 'soundID will vary all you would need to do is replace the siren with another in the aduio files or keep it the same.

---------------------------------------------------------------------------------------------------------------------------------------------------------------

c) The last two are in the same file this time you need to open the Specs file and find freeplaybase.xml and portraits.xml.

Next go to the other portrait.xml (not the one above the other one)

It should look something like this 

Remember the name you put in the ID_PORTRAIT_ in the other .xml document you need need to drop that in where the X's are below.

<portrait prototype="mod:Prototypes/Vehicles/Firetruck/Firetruck1.e4p" text="XXXX" unit"XXXX"/>

This defines the unit in the menu the last thing you need to do is open the freeplay.xml file and add your unit.

The last piece of code is as follows:

<vehicle prototype="mod:Prototypes/Vehicles/Firetruck/Firetruck1.e4p" count="X" />

This tells the game that in the menu that you have X number of this vehicle. 

 

If you understood the tutorial and followed it to the pixel hopefully this should happen when you load you mod up and start a new freeplay map

 

1.jpg

3.jpg

4.jpg

5.jpg

6.jpg

20160714134048_1.jpg

  • Upvote 1
Link to comment
Share on other sites

On 14 July 2016 at 2:46 PM, dunwell99D said:

In this post I will detail how you go about adding your police, fire and ambulance units into the menu without just changing the prototype of an existing unit.

 

For this tutorial I will be using my private edit of the Kent Mod by TACRFan and PottyScotty  all unit credit goes to them.

STEP 1. 

First you need to open up the editor under the vehicles tab create a new directory for each unit type (police, fire, ambulance), once you have set up these directories you can then add your units under their respective directories. Like you would with adding a model to the game you need to set up the lights, commands, traits etc. separately once you have one unit set up you can then start the process of  adding the unit into the menu.

 

STEP 2.

Once you have set up one unit or prototype in the editor, close the editor and go to your game files. For myself I have the Steam edition but its the same file Go To 911  First Responders\Mods\Hampshire sub mod v0.1.65 (KM)\Units\Vehicles\Fire Department

Inside the Fire Department vehicle folder you will see the units from the base game or if like myself your making a private edit the mod which you are basing your mod off of. Inside this folder you will want to create a folder and call it 001_................. Once you have done this come out of the file you just created and go into one of the preexisting files, if your mod is based off of the LA mod by Hoppah or mods based on top of that go into the file of the 110fireengine1. In there you will find 8 DDS files which show the unit and a unit.xml file.

Drag and drop these into the file you have just created.

STEP 4.

Editing the images, if you wish to have  custom image displayed for your unit I would recommend downloading and using paint.net as it can open these .DDS files, when creating your custom image try to use the original as a guide for size.

Once you have edited the image MAKE SURE to save it as a .DDS file. Next open up the Unit.xml file in a program like Notepad++ or Windows notepad. At the top you will see  

<unit id="....."> you can change this to display what the unit will be called when hovering the mouse over it in the menu.

The next thing you will need to change is the prototype

<prototype name="mod:Prototypes/Vehicles/........./.......   .e4p" />

In the first gap you want to put the directory name of the Fire department or Ambulance etc. the next gap is the unit you put in that directory in the editor YOU MUST type every character correctly or it won't work, to help I would recommend opening '911  First Responders\Mods\YOUR MOD\Prototypes\Vehicles\Fire Department\Firetruck.e4p'

Once you have put the name of the vehicle prototype in you will see the <space value="X"> this is how many personnel the vehicle carries. You will also see <loadspace value="X"> this only needs to be changed on an ambulance or police car as this is how many injured people or prisoners that can be carried by the unit.

 

STILL READING WELL DONE :-P

 

The next part says  

<personnel>
                <unit id="EMS_CAPTAIN" />
                <unit id="FF_PARAMEDIC">
                    <defaultcount value="1" />
                </unit>
            </personnel>

If you are building on top of LA mod or ones built on top of this leave the personnel as they are and leave the equipment.

The code should be exactly the same for the Campaign unit code and the Freeplay.

STEP 5.

a) Now you need to locate 4 things first locate the portraits.xml file in the Lang folder  '911  First Responders\Mods\YOUR MOD\Lang\en\portraits open that in Notepad++ or Notepad.

What you need to do is type out:

<string name="ID_PORTRAIT_.............."> Firetruck 1</string>

In the gap for this example you would put FIRETRUCK1 it is important that you remember how you typed this.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

 

b) In the Scripts file open the command folder and find the Siren command script in my case its is LASiren and again open it in your code editor.

You will need to type out the following code:

const char CAR_xx[] ="mod:Prototypes/Vehicles/Firetruck/Firetruck1.e4p";

DON'T forget the semi colon at the end, where the X's are you replace with the number next number in the sequence eg 'const char CAR_01[]' you would put 'const char CAR_02[]'

You then need to add your vehicle to the Javascript if statement

if (StrCompare(v.GetPrototypeFileName(), CAR_XX) == 0)
                soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/XXXXXXXXXX.wav", CarPos, true);    

The 'soundID will vary all you would need to do is replace the siren with another in the aduio files or keep it the same.

---------------------------------------------------------------------------------------------------------------------------------------------------------------

c) The last two are in the same file this time you need to open the Specs file and find freeplaybase.xml and portraits.xml.

Next go to the other portrait.xml (not the one above the other one)

It should look something like this 

Remember the name you put in the ID_PORTRAIT_ in the other .xml document you need need to drop that in where the X's are below.

<portrait prototype="mod:Prototypes/Vehicles/Firetruck/Firetruck1.e4p" text="XXXX" unit"XXXX"/>

This defines the unit in the menu the last thing you need to do is open the freeplay.xml file and add your unit.

The last piece of code is as follows:

<vehicle prototype="mod:Prototypes/Vehicles/Firetruck/Firetruck1.e4p" count="X" />

This tells the game that in the menu that you have X number of this vehicle. 

 

If you understood the tutorial and followed it to the pixel hopefully this should happen when you load you mod up and start a new freeplay map

 

After studying this for about an hour I don't understand, where do I drag the 8 Dds images prototype files or units confused!

Link to comment
Share on other sites

23 minutes ago, chivvy147 said:

After studying this for about an hour I don't understand, where do I drag the 8 Dds images prototype files or units confused!

Are you trying to add it to your mod. And btw I would have done a video but my pc wasn't able to cope. Also it is worth looking at the images attached which I think can only be viewed using PC/laptop

Link to comment
Share on other sites

1 hour ago, dunwell99D said:

Are you trying to add it to your mod. And btw I would have done a video but my pc wasn't able to cope. Also it is worth looking at the images attached which I think can only be viewed using PC/laptop

I sure am trying to add it to my isle of Wight mod. I will have a look

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