Jump to content

Editing your 'unit.xml' files


Description

A simple tutorial
Hello, this is a tutorial on how to change your unit files. (Hopefully) It will teach you how to edit the speed and price of a unit. It will also explain how to edit the personal and equipment contained in a unit. This very simple and I'm sure many members already know how to do this. But for those who don't I have written this tutorial.

[u][b]Important[/b][/u]
Its very import that before you do anything with any game files that make copies of them so if do something wrong it's easy to replace it with an original one.

[b][u]The files[/u][/b]
To find the files go to your program files and find emergency 4.
For me it's:
[code]C:\Program Files\sixteen tons entertainment\Emergency 4[/code]
If you have 911 - First Responders it would be:
[code]C:\Program Files\WizardWorks\911 - First Responders[/code]

This will work for the original game and for any mods so either go to data (for the original game) or press mods then select the mod you want to edit.
Next find your units folder. If I wanted to edit the original police van I would go:
[code]Units, Vehicles, Police, 020MTW.[/code]
The file you need to edit is called 'unit'.
The file is in a .xml format. You can open the file directly into notepad by right clicking the file and selecting "Open With" and selecting notepad or wordpad.

For the police van I see this:

[code]<unit id="MTW">
<campaign>
<missions value="3 4 13 15 9 8 5 17 12 14 7 19 10 6 18 16 11 20">
<prototype name="mod:Prototypes/Vehicles/Police/mtw.e4p" />
<price value="500" />
<speed value="100" />
<space value="6" />
<loadspace value="4" />
<personnel>
<unit id="POLICEMAN">
<defaultcount value="1" />
</unit>
<unit id="PROFILER" />
<unit id="SHOOTER" />
<unit id="SCOUT" />
</personnel>

<equipment>
<unit id="ROAD BLOCK" />
</equipment>
</missions>
</campaign>

<freeplay>
<missions value="3 4 13 15 9 8 5 17 12 14 7 19 10 6 18 16 11 20 22">
<prototype name="mod:Prototypes/Vehicles/Police/mtw.e4p" />
<price value="500" />
<speed value="100" />
<space value="6" />
<loadspace value="4" />
<personnel>
<unit id="POLICEMAN">
<defaultcount value="1" />
</unit>
<unit id="PROFILER" />
<unit id="SHOOTER" />
<unit id="SCOUT" />
</personnel>

<equipment>
<unit id="ROAD BLOCK" />
</equipment>
</missions>
</freeplay>
</unit>[/code]
It is broken up into two different sections: freeplay and campaign. This means your changes don't have to apply to both freeplay and campaign.

[u][b]Missions[/b][/u]
[code]<missions value="3 4 13 15 9 8 5 17 12 14 7 19 10 6 18 16 11 20">[/code]
The 'missions value' is what missions you can use the unit in. If I wanted to use it in mission 2 then I would add the number 2 like this:
[code]<missions value="2 3 4 13 15 9 8 5 17 12 14 7 19 10 6 18 16 11 20">[/code]

Also in the freeplay section it contains '22'. This is freeplay, remove this number and the unit won't be available in freeplay.
[u][b]Cost[/b][/u]
[code]<price value="500" />[/code]
Changing this will change how much it costs to call the unit onto the map.

On a cost related note, you also can edit '"fp_params_endless.xml".
You can change the following valves:
[code]<BuyFactor value="10.0"/>[/code]
[code]<SquadPriceGrowth value="30.0"/>[/code]
If you need help with this, ask in the topic. :)

[b][u]Speed[/u][/b]
[code]<speed value="100" />[/code]
This is how fast the unit travels.
If you thought this is too slow you could change it to 125 or 150. If you change this value to 0 the unit will never arrive on the map.
The max. is 9,999,999km/h.

[u][b]Personal space[/b][/u]
[code]<space value="6" />[/code]
This is how many personal the unit can carry. (Max. is 12)

[u][b]Victim/prisoner space[/b][/u]
[code]<loadspace value="4" />[/code]
For the police loadspace is how many prisoners it can carry. (Max. is 12)
For the ambulance instead of prisoners it's victims.

[u][b]Personal[/b][/u]
[code]<personnel>
<unit id="POLICEMAN">
<defaultcount value="1" />
</unit>
<unit id="PROFILER" />
<unit id="SHOOTER" />
<unit id="SCOUT" />
</personnel>[/code]

This is the what type of personal you can put inside the van.
The defaultcount value is who will already be in the van.
If for some reason I wanted a sniper available in the van, I would go into the armoured car unit file then copy and paste so I got this:
[code] <unit id="POLICEMAN">
<defaultcount value="1" />
</unit>
<unit id="SHARP SHOOTER" />
<unit id="PROFILER" />
<unit id="SHOOTER" />
<unit id="SCOUT" />[/code]

[b]Note:[/b] If you increase the default personal in a unit you must change the loadspace value. So loadspace value is equal or higher than the sum of default personal.

[b][u]Equipment [/u][/b]
[code] <equipment>
<unit id="ROAD BLOCK" />
</equipment>[/code]

Finally the equipment in the unit. This unit currently contains a road block if I wanted to add a stun grenade I would do this:

[code] <equipment>
<unit id="ROAD BLOCK" />
<unit id="FLASH GRENADE" />
</equipment>[/code]
Don't add more than 6 equipment ID's.

[b]But[/b] you also need to edit the traits of the unit in the editor for this to work.

[b][u]Important:[/u] [/b]
It may not let you save you changes. You may have to edit your permissions.
I have to right click on the 'unit.xml' file, properties, security, my user account, then tick the boxes and press apply.

[b][u]Useful links:[/u][/b]

[url="http://forum.emergency-planet.com/index.php?showtopic=5851"]Where's my editor[/url]
[url="http://forum.emergency-planet.com/index.php?showtopic=4132&st=0&start=0"]How to edit your freeplay files[/url]

I know this isn't the best ever tutorial but I hope that this helped someone. :)
Confused about anything? Just ask. :)

[b]@Moderators:[/b] Feel free to edit this and correct any errors. :)

User Feedback



Recommended Comments

hey i tried to cahnge the speed of the EMVehicles because its too slow in lamod 2.0 but when i click save it wont work it says cannot create C:\Progam Files\WizardWorks\911-FirstResponder\Mods\Los Angeles Modv2.0\vehicles\Police\100Lapdcharger\unit.xml file. make sure that the path and file are correct pls help?
Link to comment
Share on other sites


Guest
Add a Comment

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