Part 8. Vehicles
Okay, so you made your map, and are having fun playing it in BF2. But you want to have some way to get around your map besides walking. I don’t blame you, I would too. So, in this section, I will teach you to add in vehicles, and we will add in some speeders.
First, we need to figure out the coded names of the speeders. Go to each side folder, but instead of going into odf, open the req file (the one without shell on the end). There is a list of vehicle codenames. The ones we want here are:
Rep_hover_barcspeeder
Cis_hover_stap
Imp_hover_speederbike
(the rebels don’t have their own speeder, so they use the imperial one)
Okay, open up zeroeditor. Make sure you are in the conquest layer. Now, in objects, click browse. Go to ModID\common\odfs. Find com_item_vehicle_spawn. You will also need to create control regions for your command posts. Control Regions are made exactly the same way as capture zones, except for a few differences:
- Control Regions are not written as cp#_capture, but cp#_control
- Control Regions are squares, not cylinders
- Control Regions should be 10 height instead of 5
- Control Regions should be placed next to the command posts instead of over them
Edit the command posts so that the palettes look something like this:
Then, make the control regions. Place them next to the command posts. Now we will make vehicles.
Go back to objects, and find com_item_vehicle_spawn again. Place 2 or 3 next to each command post, outside the capture zone/spawn path, inside the control region. You don’t want them inside the spawn path because if you do, people would spawn inside vehicles (which would be a little disturbing). The right palette will look like this:
Now here it gets a bit repetitive. In ControlZone, write the command post number. So, if it is cp1, write cp1, if cp2 write cp2, etc. In Spawn Count, put 1. In Spawn time, put 30.0. In ExpireTimeEnemy, put 30.0. In ExpireTimeField, put 60.0. In DecayTime, put 30.0. Now, you need to specify what class of vehicle you are putting in. Each field (find more by pressing page dn) specifies a kind of vehicle. The ones you need to fill in are:
ClassAllATK
ClassCISATK
ClassImpATK
ClassRepATK
ClassAllDef
ClassCISDef
ClassImpDef
ClassRepDef
Now, each of these is for a side. So, for the All and Imp ones, type:
Imp_hover_speederbike
For Each of the Rep ones, type:
Rep_hover_barcspeeder
And For Each of the CIS ones, type:
Cis_hover_stap
Easy? Yeah, but you have to do that for every single vehicle spawner. It gets really tiring. You can do different vehicles kinds as well. Look through all the vehicle types in the side folder and req files. There are many different varieties.
Before the vehicles will work, we need to edit the LUA files again. Go to common\scripts\MAP. You need the same 4 we worked with before. Open MAPc_con. Find the text:
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hover_fightertank",
"rep_hero_anakin",
"rep_hover_barcspeeder")
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul",
"cis_hover_aat")
Now, remember, these tell the game what files to read. So, now we need to input our vehicles. Edit it so it looks like this:
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hover_fightertank",
"rep_hero_anakin",
"rep_hover_barcspeeder")
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul",
"cis_hover_aat",
“cis_hover_stap” )
See? We added cis_hover_stap. Now the game knows to read that file. Do the same to MAPc_con.lua. Now, onto the GCW files. Open MAPg_con. Find the text:
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_fly_destroyer_dome" )
Remember, no Rebel files need to be read, because they are borrowing the Imperial’s speeder. Edit it so it says:
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_fly_destroyer_dome",
“imp_hover_speederbike” )
See? We added imp_hover_speederbike. Get used to fiddling with these LUA files. Do the same to MAPg_con.lua. Now, vehicles should spawn in your map. The next section will teach you to make the AI smarter, so they know where to walk