Jump to content


Tutorial info

  • Added on: Feb 07 2010 11:52 PM
  • Date Updated: Aug 20 2010 01:47 PM
  • Views: 7811
 


* * * * *
4 Ratings

Editing your 'unit.xml' files

A simple tutorial

Posted by Forensics on Feb 07 2010 11:52 PM
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.

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

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

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:
Units, Vehicles, Police, 020MTW.
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:

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

Missions
<missions value="3 4 13 15 9 8 5 17 12 14 7 19 10 6 18 16 11 20">
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:
<missions value="2 3 4 13 15 9 8 5 17 12 14 7 19 10 6 18 16 11 20">

Also in the freeplay section it contains '22'. This is freeplay, remove this number and the unit won't be available in freeplay.
Cost
<price value="500" />
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:
<BuyFactor value="10.0"/>
<SquadPriceGrowth value="30.0"/>
If you need help with this, ask in the topic. :)

Speed
<speed value="100" />
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.

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

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

Personal
<personnel>
		<unit id="POLICEMAN">
			<defaultcount value="1" />
		</unit>
		<unit id="PROFILER" />
		<unit id="SHOOTER" />
		<unit id="SCOUT" />
</personnel>

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:
<unit id="POLICEMAN">
			<defaultcount value="1" />
		</unit>
		<unit id="SHARP SHOOTER" />
		<unit id="PROFILER" />
		<unit id="SHOOTER" />
		<unit id="SCOUT" />

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

Equipment
<equipment>
				<unit id="ROAD BLOCK" />
			</equipment>

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:

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

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

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

Useful links:

Where's my editor
How to edit your freeplay files

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

@Moderators: Feel free to edit this and correct any errors. :)

Powered by Tutorials 1.5.2 © 2024, by Michael McCune