Adding Vehicles

In this section I’ll go over the process of adding a vehicle into your map. This page is based on a section from the Getting Started.doc in the documentation of the BF2_ModTools.

Open Zero Editor, and open your map. (Remember to run zero editor from inside your mod directory, \BF2_ModTools\data_ABC\zeroeditor.exe )

Vehicle Spawn

The first thing you need to understand about adding vehicles to your level is that all vehicles are added with the same object in the editor called the vehicle spawn. With that in mind, go to Object edit mode. Once in object edit mode, click on Browse to open the browse window. Browse to \BF2_ModTools\data_ABC\common\odfs\com_item_vehicle_spawn.odf

Once you select this object, you will be brought back to the Object edit mode. To place the vehicle spawn, click on Place and simply click on the terrain where you want to place your vehicle spawn. You should now have an object in your level that looks like a grayish arrow. This is your vehicle spawn. The arrow indicates which direction the vehicle will be facing when it spawns in.

Select your vehicle spawn (click Select and then click on the vehicle spawn) and you’ll see the Object Instance box appear to the right. The first parameter, ControlZone, refers to what CP this vehicle is associated to. The value that should be entered here is the name of the CP, not the name of the control region, that you want this vehicle to be associated to. For example, cp1, or cp5. NOT cp1_control, or cp5_control.

The second parameter, SpawnCount, specifies how many of these vehicles you want to spawn from this vehicle spawn. I recommend always keeping this set to 1, and just add more vehicle spawns if you want more vehicles at a given CP.

ExpireTimeEnemy specifies how long (in seconds) a vehicle will sit idle, un-manned once the enemy has taken over the associated CP, before the vehicle will begin to decay.

ExpireTimeField specifies how long a vehicle will sit idle, un-manned in the field once it has left it’s control region.

DecayTime specifies how long a vehicle will take to decay and self-destruct once the expire time has been reached.

The vehicle that will spawn from this vehicle spawn is determined by what you enter in the Class fields. For example, if you wanted this vehicle spawn to spawn a republic speeder bike when the republic owns this CP, you would enter rep_hover_barcspeeder into the ClassRepATK field. This is assuming that the republic is set as team 1. Whether a team is ATK or DEF is determined by what team they are set as. ATK will spawn vehicles when that team is set as team 1, DEF will spawn vehicles if that team is set as team 2.

Note: 2 values that are no longer used are ClassHisATK and ClassHisDEF. Entering values in this field will accomplish nothing, so….just don’t bother.

If you click Page Dn you’ll see that there are more Class fields. As another example, if you want this vehicle spawn to spawn an AAT on a map where the republic is team 1, and the CIS is team 2, then you would click Page DN and enter cis_hover_aat into the ClassCISDEF field.

You can also have vehicle spawns spawn vehicles when either team owns the CP. If this is the case, you could enter both rep_hover_barcspeeder under ClassRepATK AND cis_hover_aat under ClassCISDEF.

Additionally, you can use a vehicle spawn to spawn vehicles for both eras, you just need to specify the vehicle classes in the corresponding Class parameters.

Lua Scripting

The last thing that is needed before vehicles show is for the vehicles to be loaded in the Lua script, just like the units. You’ll need to open up the Lua script to the mode the vehicles go in, which is located in \BF2_ModTools\data_abc\common\scripts\ABC\. In the case of a CW conquest script, the section you want to look at appears as such:


In the case of the CW era, it so happens that the template puts the BARC speeder and the AAT into the script when creating it. If, for example, you wanted the CIS to have and imperial ATST, you would put the appropriate name in Zeroeditor, of course, then you would add a comma after the "cis_hover_aat", then add "imp_walk_atst" (with the quotes).

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License