Skip to end of metadata
Go to start of metadata


NOTE: Before reading this guide, determine where your World at War root directory is located.

Non-Steam Install: C:\Program Files (x86)\Activision\Call of Duty World at War\

Steam Install: C:\Program Files (x86)\Steam\steamapps\common\Call of Duty World at War\

For the rest of this guide, it will be assumed that the word "root" refers to the appropriate installation path shown above.

Say 'Yes to all' if Windows asks you about replacing files when dragging files into your root directory.

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.

Changelog

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)

Preparation

To begin, you will need to copy root/raw/maps/_planeweapons.gsc to mods/mapname/maps.

Script

Precaching

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:

maps\_zombiemode::main();

Add:

plane = getEnt("plane","targetname");
maps\_planeweapons::build_bomb_explosions( "corsair", 1, 2, 1024, 768, 2000, 2000 );
maps\_planeweapons::build_bombs( "corsair", "aircraft_bomb", "explosions/fx_mortarExp_dirt", "tank_impact_full" );
plane maps\_planeweapons::bomb_init( 25 );
level._effect["corsair_prop_full"] = loadFX("vehicle/props/fx_corsair_prop_spin");

immediately above it. It should look like:

plane = getEnt("plane","targetname");
maps\_planeweapons::build_bomb_explosions( "corsair", 1, 2, 1024, 768, 2000, 2000 );
maps\_planeweapons::build_bombs( "corsair", "aircraft_bomb", "explosions/fx_mortarExp_dirt", "tank_impact_full" );
plane maps\_planeweapons::bomb_init( 25 );
level._effect["corsair_prop_full"] = loadFX("vehicle/props/fx_corsair_prop_spin");
maps\_zombiemode::main();

Sound

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:

name,file,platform,sequence,vol_min,vol_max,dist_min,dist_max,limit_count,limit_type,entity_limit_count,entity_limit_type,bus,volume_min_falloff_curve,volumefalloffcurve,reverb_send,dist_reverb_max,reverb_min_falloff_curve,reverb_falloff_curve,pitch_min,pitch_max,randomize_type,spatialized,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,chainaliasname,startdelay,speakermap,lfe percentage,center percentage,envelop_min,envelop_max,envelop percentage,occlusion_level,occlusion_wet_dry,real_delay,distance_lpf,move_type,move_time,min_priority,max_priority,min_priority_threshold,max_priority_threshold,,isbig
ambient_corsair,amb_corsair_01.wav,,,1,1,,,,,,,music,,,0,,,,,,,2d,streamed,,,,,,,,,,music_all,,,,,,0,,,,,,100,100,0.25,1,,

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:

sound,plane_sound,,all_sp

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.

CSV

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:

fx,explosions/fx_mortarExp_dirt
fx,vehicle/props/fx_corsair_prop_spin
rawfile,maps/_planeweapons.gsc
xmodel,aircraft_bomb
material,mtl_aircraft_bomb

Function (updated)

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:

bomb_run()
{
    plane = getEnt("plane","targetname");
    plane_path = GetVehicleNode("plane_path_start","targetname");
    plane AttachPath( plane_path );
    plane thread maps\_vehicle::vehicle_paths(plane_path);
    maps\_vehicle::vehicle_init(plane);
    plane thread corsair_spin_prop();
 
    plane StartPath( plane_path );
    wait 2;
    players = getplayers();
    for(i=0;i<players.size;i++)
	players[i] playsound("ambient_corsair");
 
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
}
 
corsair_spin_prop()
{
	self endon("hide_prop");
	self endon("death");
 
	while(1)
	{
		PlayFXOnTag(level._effect["corsair_prop_full"], self, "tag_prop");
 
		wait(0.1);
	}
}


Note that there are 25 instances of 'plane notify("drop_bombs"); - this must match what you set previously in your mapname.gsc, the line:

plane maps\_planeweapons::bomb_init( 25 );

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:

bomb_run_trig()
{
	trigger = getEnt("bomb_run_trig","targetname");
	zombie_cost = 3500;
	player = undefined;
	trigger setCursorHint("HINT_NOICON");
	trigger setHintString("Press &&1 to call in an Airstrike "+zombie_cost+"");

	while(1)
	{
		trigger waittill("trigger",player);
		if(player.score >= zombie_cost)
		{
			player maps\_zombiemode_score::minus_to_player_score( zombie_cost );
			trigger setHintString("Please wait...");
			bomb_run();
			wait 60;
		}
		else
			player playsound("no_cha_ching");
	}
}

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:

thread maps\bomb_run::bomb_run_trig();

immediately below:
Find the line:

maps\_zombiemode::main();

so that it looks like:

Find the line:

maps\_zombiemode::main();
thread maps\bomb_run::bomb_run_trig();

Radiant

Now you must do the necessary steps in Radiant.

Setup the Plane

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

Vehicle Path

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:

Bomb Run Trigger

If you are using bomb_run.gsc, simply create a trigger brush and give it the KvP:

Key

Value

targetname

bomb_run_trig

Finishing up

Compile your map, patch (if you have one), and mod.

Source

bomb_run.gsc

//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//|||| Name   : bomb_run.gsc 
//|||| Info     : script for bombing runs
//|||| Site     : www.ugx-mods.com
//|||| Author : [UGX] treminaor
//|||| Notes  : goes with Airstrike tutorial on UGX-Wiki
//|||| To-Do : n/a
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility; 

bomb_run_trig()
{
	trigger = getEnt("bomb_run_trig","targetname");
	zombie_cost = 3500;
	player = undefined;
	trigger setCursorHint("HINT_NOICON");
	trigger setHintString("Press &&1 to call in an Airstrike [Cost: "+zombie_cost+"]");
	
	while(1)
	{
		trigger waittill("trigger",player);
		if(player.score >= zombie_cost)
			{
			player maps\_zombiemode_score::minus_to_player_score( zombie_cost );
			trigger setHintString("Please wait...");
			bomb_run();
			wait 60;
			}
		else
			player playsound("no_cha_ching");
	}
}

bomb_run()
{
    plane = getEnt("plane","targetname");
    plane_path = GetVehicleNode("plane_path_start","targetname");
    plane AttachPath( plane_path );
    plane thread maps\_vehicle::vehicle_paths(plane_path);
    maps\_vehicle::vehicle_init(plane);
    plane thread corsair_spin_prop();
	
    plane StartPath( plane_path );
    wait 2;
	players = getplayers();
    for(i=0;i<players.size;i++)
	players[i] playsound("ambient_corsair");

    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
    wait 0.5;
    plane notify("drop_bombs");
}

corsair_spin_prop()
{
	self endon("hide_prop");
	self endon("death");
	
	while(1)
	{
		PlayFXOnTag(level._effect["corsair_prop_full"], self, "tag_prop");
				
		wait(0.1);
	}
}

 

Credit: Treminaor