Jump to content


Tutorial info

  • Added on: Aug 01 2007 12:41 AM
  • Date Updated: Nov 05 2013 07:57 AM
  • Views: 34476
 


* * * * *
8 Ratings

Emergency 4: Adding vehicles

by Hoppah

Posted by Hoppah on Aug 01 2007 12:41 AM
Emergency 4 - Adding Vehicles

Difficulty: Moderate

Programs used:
Emergency 4 (v1.3) Editor
WordPad or Notepad


This tuturial will teach you how to add a new vehicle to your mod step by step.
You should already have a model and texture file.
Besides this tutorial, it can be VERY useful to compare your files with other mods or original files.

In this tutorial, the following vehicle will be added to a mod:
Image 01: Vehicle


==========================

NEW FOLDERS:

1. Adding new vehicles requires the following folders in your mod if you don't have them already:
Lang, Models, Prototypes, Specs and Units.

Image 02: Add new folders

2. All files in your mod are sorted in subfolders. You need to create those folders too.
3. In case you want to add a police vehicle you need to make the following folders in your mod folder:
.../Models/Vehicles/Police/
.../Prototypes/Vehicles/Police/
4. Now, move all model- and texture files from your vehicle to your .../Models/Vehicles/Police/ folder.

Image 03: Subfolders and the model- and texture files

In case you are renaming your model- and texture files:
5. You need to make sure the texture files are linked to their model files, otherwise each model is missing their textures.
6. Open each model file (.V3O) with WordPad and look for the texture name. Change it to your new texture name and save the file.

NOTE: If you're seeing a lot of weird symbols, the model is locked/packed (all Emergency 4 model files are). You can unpack the model file in the Emergency 4 editor.
Start the editor. Go to Modifications -> Unpack file...
It doesn't matter if your file is packed or not. Emergency 4 can read both.

Image 04: Change texture name in model files

==========================

CREATING AND EDITING BODY PROTOTYPE FILES:

7. When you have moved your model- and texture files to your mod you need to make prototype files.
Each object of your vehicle has its own prototype file (body, doors, wheels etc...). Lets start with the body of the new vehicle.
8. Start the editor and always load your mod (Modifications -> My mod) first, otherwise the changes won't be made in your modfolder, but inside the Data folder of Emergency 4.
9. If you're not seeing the object window, go to Edit -> Scene.
10. Click on Vehicles -> Police (just like those subfolders in step 9) and click on NEW.
11. A new window will appear. The first thing you have to do is linking your model file to the prototype file.
12. Click on Browse behind Modelfile: and search the model file of the body of your new vehicle. Click OK.
Your model is linked to the prototype file and can be viewed in the editor if you click on OK in the prototype window.
13. Each object in Emergency 4 has some options which need to be checked or not. For vehicles check the following options in the bottom of the prototype window:
A black dot in: Physics, Children, Lights, Traits and General.
A little cross in: Fire
Use 'Custom' as Placement.
14. Now, you have to edit the Traits of your object. Click on Edit Traits. A new window will appear.
Change the Flags first. Usually, most Emergency vehicles use Shootable, Coolable, Transportable - ASF and Recoverable - FGrR.
If you want to have equipment inside the car, check some flags under Contained Equipment too (not more than 6).
Voice/Sound is for the type of voice for your vehicle. Emergency 4 has 3 different voices (0, 1 and 2).
Set the gender (for vehicles: Male or Female).
Choose your type of vehicle under TaskForce Vehicle Type. Because our vehicle is a simple police vehicle we choose Police StW this time.
Setting the Explosion Settings: Effect means which particle is used when your car explodes. Wreck Prototype is the wreck of the car after the explosion.
Setting the Passenger and Transports: Those two values are only used when you place vehicles on maps in the editor.
Setting the Material: Each object in Emergency 4 has a material. Normal vehicles usually have Car as Material.
15. When you're done with the Traits, click OK.
16. You need to assign commands to the vehicle. Click on Edit Commands.
Required commands for most vehicles are: MoveTo, EmptyCar and GoHome. It is not very difficult to understand what those commands mean.
17. If you want to add lights to your car use the Light Editor function (Edit Lights).
It is not very difficult to learn to add new lights. Comparing with other cars works most of the time.

Image 05: Create a prototype file
Image 06: Link prototype file to model
Image 07: Check options
Image 08: Edit Traits
Image 09: Add commands

==========================

CREATING AND EDITING WHEEL AND DOOR PROTOTYPE FILES:

18. The prototype files of the wheels and doors are basicly the same as body prototypes, except that you don't have to edit the General, Traits and Lights options.
19. Just like the body prototype file, create a new prototype file in the same folder as the body prototype file.
20. All door prototype files have to end with "_door##" and wheels with "_wheel##" (## stands for 2 numbers), so in this tutorial the first wheel prototype file name could be "new_car_door01".
This is very important, because otherwise Emergency 4 won't reconize the wheels and doors.
21. When you've created a wheel or door, assign a door- or wheel model to the prototype file (step 18) and you're done.
When you restart the editor, the door- and wheel prototypes can be found in Objects -> _VehicleParts_doors and _VehicleParts_wheels.

Image 10: All prototype files ready

==========================

ADDING DOORS AND WHEELS TO YOUR CAR:

22. Before you are going to add the doors and wheels to the body, make sure all prototype files are correct and that the models show up with the right texture.
Addings wheels to your car is very easy. Go to your new car in the object window, then Edit -> Edit Children -> Edit Wheels.
23. Look for the wheel you've made in the list and press Add. If you can't find your wheel, the file name propably didn't end with "_wheel" and a number.
24. Use the Preview window to position the first wheel. Use ALT and your mouse to change the height. You might want to use Snap angles or Snap to objects to make it easier to position the wheel.
25. Use Copy Wheel to make the three others wheels which have the same height as the first wheel. Position them too.
26. Now, go to Edit Doors and add all doors to your vehicle and position them. Snap to object and Snap angles can be very useful.
27. On the right side of the Children window you can change some things. Change Axis to change the way the door opens. Change Door Action for which action the door will be opened.
28. You also want to add other objects (childs) to your vehicle like a lightbar. Use the Edit Children -> Edit Childs function then.

Image 11: Adding wheels
Image 12: Adding doors

==========================

UNIT ID:

29. Each vehicle or person has its own ID (Identification) name. This ID is used to reconize the vehicle. The name of each vehicle is attached to their ID.
Each vehicle has its own unit.xml file. All those files must be placed in a new folder.
30. So, we are going to change the Units folder. Our vehicle is a Police type vehicle so you need to create the following folders in the Units folder.
.../Vehicles/Police/
31. Create another folder in the Police folder. The name doesn't really matter. But the way how the vehicles are sorted ingame is based on the names of the folders.
In this tutorial we create a folder called "001newcar".
32. Besides unit.xml, all menu pictures are also placed in that folder. The best way to change unit.xml for a new vehicle, is copying an existing file and changing it.
About those menu pictures: Each car needs eight images. One large image which will appear in the lower right window when you select the vehicle. Four images are needed for the menu and three for the TransAid menu.
If you are known with programs like Photoshop it's not very difficult to make new images for your vehicles.
On the bottom of this tutorial you can download empty unit images. You only have to add a picture of your vehicle to those images.
33. Copy an existing unit.xml from the ".../Emergency 4/Data/Units/..." folder to your new folder and open it with WordPad or Notepad.
34. Make up a unit ID for your vehicle and enter it between the brackets in the first line. I've used: CV_LAPD. You will need that ID later!
There are two large parts in this file which are basicly the same; campaign and freeplay.
Most things will speak for themselves, but some things are important to know:
Maximum number of 'space value' is 8.
Maximum number of 'loadspace value' is 9.
Don't add more than 4 unit ID's.
Don't add more than 6 equipment ID's.
Adding 22 to 'mission value' in the freeplay part is required to use the vehicle in freeplay.
35. When you are done, save the file. You can open .xml files with Internet Explorer to check it for mistakes. If Internet Explorer gives an error, something is wrong with the file.

Image 13: Create unit folder
Image 14: Files inside the unit folder
Image 15: Changing unit.xml

==========================

SPECS:

36. Some files in the Specs folder are required when you add a vehicle to your mod.
Copy the following files from your .../Emergency 4/Data/Specs folder to the Specs folder in your mod:
freeplaybase.xml
freeplaybase_mp.xml
portraits.xml
metastrings.xml
freeplaybase_d.xml (if you have EM4 Deluxe)
37. Open freeplaybase.xml with Wordpad.
Every available vehicle in freeplay has their own line. 'count' means the number of vehicles in your garage which have already been bought.
Copy/Paste or change one of the lines and enter the path to your new vehicle.
Do this for freeplaybase_mp.xml (for multiplayer) and/or freeplaybase_d.xml (if you have EM4 Deluxe) too.
38. Open portraits.xml with WordPad.
Just like in freeplaybase.xml has each vehicle has their own line.
Copy/Paste or change one of the lines, enter the correct path to your new vehicle prototype.
Enter the Unit ID which has been made up in step 40 and enter the exact same name behind 'text' and 'unit'.

Image 16: Specs folder
Image 17: Changing freeplaybase.xml
Image 18: Changing portraits.xml

==========================

TEXT (LANGUAGE) FILES:

39. Copy the following files from your .../Emergency 4/Data/Lang/[game language]/ to your mod:
infotexts.xml
portraits.xml
40. Make sure the paths to these files have been changed in metastrings.xml too.
41. Open infotexts.xml
Each unit must have three lines with a text:
ID_NAME_[unit ID] The name of the unit.
ID_PURPOSE_[unit ID] Some information about the unit.
ID_TOOLTIP_[unit ID] Text which appears when you move your cursur over the menu image of the unit.
Make sure to enter the unit ID correctly and make up a name, purpose and tooltip text.
42. Open portraits.xml
Just like infotexts.xml each unit has a line with text. This text will appear in the lower right window when you select your new vehicle.
ID_PORTRAIT_[unit ID]
43. When you're done with the text files, your vehicle should be ready to use ingame.
44. Start Emergency 4, load your mod, start a mission or freeplay and play with your vehicle!

Image 19: Text files
Image 20: Changing infotexts.xml
Image 21: Changing portraits.xml

Download empty unit images:
Emergency 4 Unit Images

For questions about this tutorial:
Ask in the forum

==========================

Tutorial made by Hoppah
July 2007

Powered by Tutorials 1.5.2 © 2024, by Michael McCune