Like many of you, I love the new vehicles in UT2k4. I was disappointed to see that they were limited to only a few gametypes. Searching for a way to add vehicles to my maps, I came across the VSOverride actor written by Parser. I built a test map using this actor and, indeed, I was able to use vehicles in my maps. While running some online tests, I noticed that there were a few bugs in team games, most notably with multi-passenger vehicles. Also, with VSOverride, it was not possible to have vehicles locked to a particular team. After a lot of research and reading through the game scripts, I have found an easier and more reliable way to add vehicles to maps, regardless of game type.


Quick and easy
So you want to add some vehicles and you don't care how it works? This section is for you. If you'd like to see how it works, read the 'Changing the rules of the game" section.

1. Download VehicleCube.ut2 and place it in your UT2004/Maps folder.
2. Open UnrealEd and open the VehicleCube.ut2 map.
3. Now open your map you wish to add vehicles to or start a new map.
4. Open the Actor Class Browser. Extend 'Info' and then extend 'LevelGameRules'. Highlight 'VehiclesInAnyGame' by left clicking on it once. Close the Actor Class
Browser.
5. Right click anywhere in your map and select 'Add VehiclesInAnyMap Here'. The location of the actor doesn't matter since it will be hidden ingame.
6. Save your map. The actor is now embedded into your map. All you need to do now is add some vehicles. Go to the 'Adding vehicles to the map' section of this tutorial.

Changing the rules of the game
Epic put an actor into the game that is meant to be a starting point for modders wanting to change certain game rules without creating a new game type, 'LevelGameRules'. By subclassing this actor, we can change the rule that says vehicles are not allowed in certain game types. This tutorial will show you how to subclass the 'LevelGameRules' actor and embed the new class into the 'MyLevel' package of the map. By embedding this new actor class into the 'MyLevel' package, there is no need for any additional files to be distributed with the map.

1. Since you will be saving this to the 'MyLevel' package of the map, it's best to start UnrealEd fresh. If you had another map open and then just click 'New', all information
from the 'MyLevel' package of the previous map will be saved to your new map.
2. In UnrealEd, open the Actor Class Browser. Uncheck the box for 'Pacleable Classes Only'. Scroll down and extend 'Info'.
3. Find 'LevelGameRules' and right click on it. From the pop up menu, select 'New'.
4. In the window that pops up, set the package to 'MyLevel' and change the name to 'VehiclesInAnyGame'. Click 'OK' and a new window will open. This is the window you will add the script to.
5. Simply copy and paste the following text into the script editor below the header. To paste in the editor, press Ctrl V. Sometimes the pasted text will appear in black.
Don't worry, it's normal.

function UpdateGame(GameInfo G)
{
G.bAllowVehicles=True;
}

6. At the top of the script editor window, click on 'Tools' and select 'Compiled Changed'. Now you should see a new subclass to 'LevelGameRules' in the Actor Class
Browser. This is the new actor you will place in your map to enable vehicles.
7. Now open the map you wish to add vehicles to. In the Actor class Browser, highlight 'VehiclesInAnyGame' by left clicking on it once. Close the Actor Class Browser.
8. Right click anywhere in your map and select 'Add VehiclesInAnyMap Here'. The location of the actor doesn't matter since it will be hidden ingame.
9. Save your map. The actor is now embedded into the 'MyLevel' package of your map. All you need to do now is add some vehicles.

Adding vehicles to the map

Capture The Flag

Teamlocked Vehicles
By default, vehicles added using the ONSVehicleFactory subclasses will automatically associate themselves with the closest Flagbase. There is no need to set the team number in the default properties. Vehicles will be locked for opposing players until a player from the corresponding team enters them. Once a player exits the vehicle it can be hijacked.

1. Open the Actor Class Browser and extend 'SVehicleFactory', then extend 'ONSVehicleFactory'. There are seven vehicle factories to choose from:
ONSAttakCraftFactory Raptor
ONSBomberFactory Bomber plane (haven't tried using this one yet, but it is an unmanned vehicle)
ONSHoverCraftFactory Manta
ONSMASFactory Leviathon
ONSPRVFactory Hellbender
ONSRVFactory Scropion
ONSTankFactory Goliath
2. Higlight the vehicle factory of your choice by left clicking on it once.
3. In the 3D perspective view of the editor, add the vehicle by right clicking on the desired location and selecting it from the popup menu.
4. Position the vehicle to your liking.
5. Repeat steps 2, 3 and 4 until all vehicles are placed.
6. Rebuild All and then save the map. Have fun with your new vehicles in regular CTF games!!


Unlocked Vehicles
Unlocked vehicles are just that, unlocked. There is no team association and can be driven by players from either team at any time. Unlocked vehicles require you to place vehicles using the ASVehicleFactory actor. The problem with this actor is that it will eject the driver when the vehicle is destroyed rather then kill the driver along with the vehicle. This tutorial will use a new Actor Class (VpVehicleFactory) I compiled that will kill the driver when the vehicle is destroyed. If you wish to have the driver ejected rather then killed, use the ASVehicleFactory in place of the VpVehicleFactory and skip to step 3.

1. Download VpVehicleFactory.u and place it in your UT2004/System folder.
2. In UnrealED, open the Actor Class Browser. Click on 'File' and select 'Open Package...'. Select 'VpVehicleFactory.u' and click 'Open'.
3. Extend 'Actor', scroll down and extend 'SVehicleFactory' and highlight 'VpVehicleFactory' by left clicking on it once.
4. In the 3D perspective view of the editor, right click on the desired location and select 'Add VpVehicleFactory' from the popup menu. A small car icon will appear in your
map.
5. To position how the vehicle will spawn, select the VpVehicleFactory actor by right clicking on it and move/rotate it accordingly in the 2d views of the editor. The
vehicle will face the direction the red arrow is pointing.
6. There are a couple properties that need to be changed for this actor to work properly. Right click on the VpVehicleFactory actor and select 'VpVehicleFactory
Properties' from the popup menu. In the VpVehicleFactory Properties window, extend 'VpVehicleFactory'. Set 'bRespawnWhenDestroyed' to 'True'. The reason for setting that should be obvious. Now scroll down and extend SVehicleFactory. Click on 'VehicleClass' and open the drop down menu. There are many vehicles listed in this window, but not all will work ingame. Here's a list of some that will work:


ONSAttackCraft-Raptor
ONSGenericSd-Toilet Car
ONSHoverBike-Manta
ONSHoverTank-Goliath
ONSHoverTank_IonPlasma-Ion Plasma Tank (very cool!!)
ONSMobileAssaultStation-Leviathon
ONSPRV-Hellbender
ONSRV-Scorpion


You can also add Assault weapons such as the minigun turret using this actor. I'll let you figure out which one is which in the menu.
7. Repeat steps 4, 5 and 6 until all vehicles are placed.
8. Rebuild All and then save the map. Have fun with your new vehicles in regular CTF games!!


Deathmatch
Since there are no teams in Deathmatch, just follow the directions for adding Unlocked Vehicles to a Capture The Flag map. I haven't tested this with TeamDeathmatch but I believe teamlocked vehicles won't be possible since the vehicles 'look' for a team objective to associate themselves with.


Bombing Run
Just follow the directions for adding vehicles to Capture The Flag maps. Locked vehicles will automatically associate with the nearest BombDelivery.


Assault
Vehicles are allowed in Assault by default.

All the other gametypes
I have not tested this with any other game types. Let me know how they work if you decide to try them out.

Additional Notes
You are free to use this tutorial to add vehicles to your maps, but please give me credit in the maps' ReadMe files.

If you add any vehicles using the VpVehicleFactory.u file included with this tutorial, you must distribute that file along with the map. That file must also be uploaded to the System folder of any server that runs the map.

The VpVehicleFactory.u file is a recompiled version of ASVehicleFactory with only one line of code changed to kill the driver when the vehicle is destroyed. I did not write any of the orginal code. All credit goes to Epic.

Botpathing is not one of my strong points. If you are interested in botpathing your vehicle map, check out http://nalicity.beyondunreal.com/view_content.php?cid=1822&page=2<<needs to be link for some very useful info.

Many thanks to Parser (although I have never met him) for writing the VSOverride actor and getting me interested enough to figure out how to do it myself.

Why put vehicles in CTF when there's already vCTF? I want to run a server where regular CTF maps and vehicle CTF maps can be seen in the mapvote window without having to search through different game types.

Many thanks to the guys in Team |-Vp-| that helped with the online testing!! http://vpclan.com/