Skip to end of metadata
Go to start of metadata

This is a guide for installing the UGX Jukebox to your map. Note that the UGX Jukebox is (will be) also included with UGX Mod v1.1+ for automatic installation.


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.

Preparation

Download

Download the UGX Jukebox installation files here: UGX Jukebox v1.0.4.rar (25.1MB)

Extract the archive to it's own folder anywhere using WinRAR or equivalent.
Navigate into the mods/ folder and rename the MAPNAME folder to the name of your map's folder in your root directory (example: nazi_zombie_testmap)

Changelog

  • v1.0.4: Moved all songs to the "music" channel in the soundalias so that volume can be changed with the music slider in World at War's audio options.
  • v1.0.3: Fixed a bug where you receive a gun with full ammo back after the button pushing anim plays for the box, instead of reviving your current ammo back.
  • v1.0.2: Fixed a bug where if the wait for power setting was enabled, the Jukebox would never turn on. Fixed a bug where dynamically adding a song did not work.
  • v1.0.1: Fixed a visual menu bug where at certain screen resolutions the Jukebox menu would appear jumbled.
  • v1.0.0: Release.

Installation

The first step to installing the Jukebox is adding the files to your root directory. highlight the "map_source", "mods", "raw", and "sound_assets" folders from the archive and drag them into your root directory. It should merge with your existing folders. If not, you did it wrong!

Calling the Functions

You need to add two lines to your mapname.gsc before the Jukebox will run.

NOTE: "mapname.gsc" refers to your map's main gsc file, which is named the same name as your map.

For example, a map called "nazi_zombie_example" would have a mapname.gsc named "nazi_zombie_example.gsc". This file is commonly used to call custom scripts for a map.

Lines which precache items such as models need to be called BEFORE the gamestate starts and should not be threaded. Lines which do not precache any items should be called AFTER the gamestate starts and should be threaded.

The gamestate is started by this line in mapname.gsc:

maps\_zombiemode::main();

To add lines to your mapname.gsc:

  • Open your mapname.gsc file, which can be found in root/mods/mapname/maps.
  • For Precache Lines, add them before the gamestate line.
  • For Thread Lines, add them after the gamestate line.

Precache Line

maps\ugx_jukebox::jukebox_precache();

Thread Line

thread maps\ugx_jukebox::jukebox_init();

Configuration

The Jukebox has some basic configuration settings that can be changed if you wish. The default settings do not require the power switch to be on for the Jukebox to work, and charge 10 points per song play.

Power Needed

level.jukebox["power_needed"] = false;

Changing this setting to true will display a "Power must be on." message to players until the power switch is flipped in the map, preventing players from using the Jukebox until the power is on.

Cost

level.jukebox["cost"] = 10;

Changing this setting will change the amount of points players are charged each time they play a song from the Jukebox.

Radiant Placement

To place one or more Jukeboxes in your map, use the prefab root/map_source/_prefabs/ugx_mod/ugx_jukebox.map.

NOTE: "Prefab" is shorthand for "prefabrication". A prefab is a pre-assembled group of brushes, models, or terrain patches which can be placed and moved as a group in Radiant.
To Place a Prefab:

  • Right-click the 2D Window in Radiant.
  • Navigate to misc -> prefab
  • Use the file browser to navigate to the desired prefab, which should always be located in root/map_source/_prefabs.
  • Now you have a prefabricated group of objects which can be moved around as if it were one object.

To stamp a prefab, select the prefab and press the stamp button from the toolbar.


The prefab does not need to be stamped to work. There is no limit to how many Jukeboxes can be placed in a single map.

Compiling

Once you have done the above steps, you are ready to finalize the installation. If you would like to add custom songs to your Jukebox, read section 3 before completing this step. To finalize your installation of the Jukebox, complete the following steps:

  • Open Launcher and recompile your map. This is necessary because we added the Jukebox prefab to your map file.
  • Switch to the Mod Builder tab and select your map from the dropdown list. Add the following lines to the top of your mod.csv box:
sound,ugx_jukebox_music,,all_sp
xmodel,jukebox_on
weapon,sp/jukebox_button_press
xanim,jukebox_button_press
fx,ugx/jukebox_idle
menufile,ui/scriptmenus/ugx_jukebox.menu
material,jukebox_bg
xanim,jukebox_start_anim
xanim,jukebox_end_anim
xanim,jukebox_loop_anim

Check the box for animscripts/jukebox_animscript.gsc in the files list on the right side.
Check the box for animtrees/_jukebox.atr in the files list on the right side.
Check the boxes for the following image files in the files list on the right side:

jukebox_scroll.iwi
~jukebox_s_extra-rgbl-11.iwi
jukebox.iwi
jukebox_bg.iwi
jukebox_n.iwi

Check the box for maps/ugx_jukebox.gsc in the files list on the right side.
Check the box for weapons/sp/jukebox_button_press in the files list on the right side.
Check the boxes for "Build mod.ff fastfile" and "Build IWD"
Click the "Build MOD" button.

You are finished! You can now boot your map and enjoy the UGX Jukebox.

Adding Custom Songs

Song Files

If you plan to use your own songs in the Jukebox instead of the default non-copyright songs, you will need to convert them. Later we will have a page which teaches you all about converting sounds and creating soundaliases - but until then, you're on your own. The process is the same as you would use for any other music box. If you have already converted some songs for use with a different music box script, you may reuse them without changing anything.

Script Configuration

To add your custom songs to the Jukebox, you first need to open root/mods/MAPNAME/maps/ugx_jukebox.gsc.

Inside the jukebox_settings() function, you will find the default songs defined on line 19. There is a function called add_song() which adds songs to the Jukebox and its menu.

add_song(display_name, soundalias_name)
{
	level.jukebox["songs"][display_name]["name"] = soundalias_name;
}

The first argument is the song's display name which shows on the Jukebox menu. The second argument is the soundalias name, which is the soundalias name that corresponds to the display name. Replace the default songs on line 19 with your own. The Jukebox menu will only display a maximum of 10 songs, regardless of how many you add in the script file. This limit is imposed mainly because it is an inconvenience to players if they have to download a map file that is 400mb large because the mapper thought it was cool to add 40 uncompressed songs to the map.

 

Warning: If you are adding songs which are not copyright-free, PLEASE change the youtube_safe setting to false on line 16 inside the jukebox_settings function. This will disable the "COPYRIGHT FREE" message on the Jukebox menu, notifying players that a song that they play may trigger a copyright notice on YouTube. This is purely a courtesy to players.

 

It is not necessary to modify the menu file at all, it will load the song names dynamically. You are done after modifying the script file.

Dynamically Add Songs In-Game

It is also possible to have the Jukebox start with a limited amount of songs, and then by calling the add_song() function at any time during gameplay you could add a song to the menu, since it is dynamic. For instance, you could create an objective system for finding CD's scattered around the map - each CD unlocks a new song in the Jukebox! It's up to you to code these events, obviously. Here is an example function call:

thread maps\ugx_jukebox::add_song("Victory Song", "victory");

Credit: Treminaor