Treyarch has lots of SP scripts for vehicles (mostly left over from COD4) that can be used in zombiemode with just a little bit of scripting and some time spent in Radiant. UGX Cabin features an airstrike that was made with this method, and that is what this tutorial will focus on. This will cover placing a plane model in Radiant, creating a vehicle path for it, customizing the bomb drop, configuring explosion fx, giving the plane a propeller, and giving the plane engine sound.
Fixed zombie_cost on the bomb run trigger - 01:32, 22 January 2014 (UTC)
Removed end_game call from script - this got left over from the original UGX Cabin version. - 03:10, 13 April 2012 (UTC)
Edited wording of Vehicle Paths section - 03:18, 13 April 2012 (UTC)
To begin, you will need to copy root/raw/maps/_planeweapons.gsc to mods/mapname/maps.
In order for the plane to function, it must be initialized. This is similar to precaching as it must be done before _zombiemode::main() is started. To do this, open your root/raw/maps/mapname.gsc with (prefered) Text Editors , although Windows Notepad will suffice.
Find the line:
Add:
immediately above it. It should look like:
I have already converted amb_corsair_01.wav (a CoD Sound) for use, although you can use any sound you want (just made sure you change the soundalias in the bomb_run() function - sound conversion is not covered in this tutorial)
If you would like to add a sound, you must make a soundalias.
Create a new file in root/raw/soundaliases/ called plane_sound.csv.
Paste this code inside and save the file:
Next, you must place amb_corsair_01.wav in root/mods/mapname/sound.
Then, open Launcher and go to the Mods tab. Select your Mod in the list, then add:
to the top of the mod.ff box. Check Build FF and Build Sounds, then click Build MOD. Ignore any errors. Then in the right-hand box, scroll down the list and check the box next to amb_corsair_01.wav. Then check Build FF and Build IWD, then click Build MOD.
If you want the FX to work and the bomb model to show, you must do this step.
1.4 Map: Navigate to root/zone_source/nazi_zombie_mapname_patch.csv and open it with Notepad.
1.1 Map: Navigate to root/zone_source/nazi_zombie_mapname.csv and open it with Notepad.
Add this anywhere in the file:
Finally, you must add a function to a script that is running in your level. Depending on how you want to use this, that file may be an endgame script, or it may be your mapname.gsc. It does not matter. For this tutorial I will use root/raw/maps/mapname.gsc. Open it with the usual text editor.
Here is an example function for a bombing run:
Note that there are 25 instances of 'plane notify("drop_bombs"); -
this must match what you set previously in your mapname.gsc, the line:
You can also adjust the time in between bomb drops by increasing the wait time in between them.
Now you must call bomb_run(). This can be for an endgame, or as a buyable occurrence. I will show you how to do the latter.
Here is a simple function for a buyable trigger:
Create a file in root/mods/mapname/maps/ called bomb_run.gsc and place both bomb_run() and bomb_run_trig() inside, along with the standard includes.
Open root/raw/maps/mapname.gsc with the usual text editor and add:
immediately below:
Find the line:
so that it looks like:
Find the line:
Now you must do the necessary steps in Radiant.
For this tutorial, we have made preparations to use the corsair plane. Right click the 2D view of your map and choose script -> vehicle . Select root/raw/xmodel/vehicle_usa_aircraft_f4ucorsair. Select the model and press N to open the Entity window. Add these KvPs:
Key |
Value |
---|---|
targetname |
plane |
target |
plane_path_start |
vehicletype |
corsair |
Now that you have your corsair model, it's time to create a path for it to follow. There are two nodes we will use. One (info_vehicle_node) is for linear movement, and the other (info_vehicle_rotate) is for rotational movement. You will use the first one when the plane is flying straight, and the second when the plane needs to turn. You could use the first type of node for your entire path, but the plane would not roll rotate in turns and would look very unrealistic. However, if you just want the plane to fly straight over the map, then all you have to use is the first type of node.
You must do this step regardless of your path type: Place the first type of node by right clicking the 2D view, then going to info -> vehicle -> node. Give the node these KvPs:
Key |
Value |
---|---|
targetname |
plane_path_start |
lookahead |
1 |
speed |
85 |
Note: Anywhere from 85 to 100 is a good speed for bombing runs.
Note: You
MUST
check the 'START-NODE' box on this first node.
If you have done everything correctly thus far, you should see a green line from your plane model to the first node. Go ahead and create a second node (do NOT simply make a copy of the first node).
Note: Each node on your path must have a speed KvP.
Select your first node, then your second node, and lastly press 'W' on your keyboard to link them. Then select the last node you placed, then the new one you placed. Then press W. This creates a chain of nodes. Repeat this process for your entire path. When selecting any node on your path, you should see arrows depicting the path of the vehicle dynamically based on your speed KvP's. Use this as a guide for how the plane will look. Here is what a good path with turns looks like:
If you are using bomb_run.gsc, simply create a trigger brush and give it the KvP:
Key |
Value |
---|---|
targetname |
bomb_run_trig |
Compile your map, patch (if you have one), and mod.
Credit: Treminaor