Author Topic: Install a Sporty Jukebox!  (Read 3300 times)

Offline ReaKtor

  • Rank: Private
  • *
  • Posts: 471
Install a Sporty Jukebox!
« on: August 20, 2008, 02:28:20 pm »
General Instructions for Setting up the eXtreme+ 2.4 Jukebox

eXtreme+ 2.4 contains a really nice Jukebox function. It is easy to set up and will add music of your choice to your server. The Jukebox has space for 20 song tracks (more if you want). ON/OFF and Track Selection, can be individually controlled by each player.  As a bonus the server will remember the power ON/OFF and track status of each player (by individual player name).  It saves/loads power status, loop status, shuffle status and current track.

To set up the Jukebox:

STEP 1. RIP -- Rip the Tracks of your choice and save them in mp3 format. Ripping is a function familiar to iPod owners. It reduces the size of an mp3 file from the typical 5-7 megs per track to less than 1 meg per track. Ripping will make your music file much smaller. The price you pay is the loss of some fidelity. The 9 tracks I ripped ended up as an 8.6 meg archive.

Various ripping programs are available for free. You might already have one that came with your mp3 player. I used the free version of EZ CD Ripper (Googgle for others): http://www.8to32.com/index.htm

I also chose the most compressed file format: sample rate- 11025, Bit rate- 32, Stereo.  This produced Tracks that were around 1 meg or less.  After you have ripped your tracks and saved them to a temp location, play each track to see if it is OK. Now rename the tracks in the order you want them played-- track01.mp3 --track02.mp3 --track03.mp3 ... ...


STEP 2. CREATE ZIP ARCHIVE -- When you unzip the eXtreme+ v 2.4 download you will find this directory in the file structure: /extremev2.4.iwd/sound/jukebox/trackxx.mp3.

This directory contains 20 mp3 files that contain one second of silence. That is there in case the jukebox is started with no tracks loaded. If you need more than 20 tracks you will have to edit the xx_jukebox.csv file in the "soundaliases" folder.

The idea is that you create a separate iwd file with the same file structure and replace the silent tracks with your ripped mp3 tracks (by loading another iwd file after eXtreme2.4.iwd).

Use Winrar to make the new archive. There are several ways to do this but the general idea is to make the directory structure in a temp location:  /sound/jukebox/track00.mp3-track20.mp3. And then zip it up. Rename it with the iwd extension that CoD2 requires.

Here is an easy example method: You can just open the eXtremev2.4.iwd with winrar and drag the /sound/folder out onto your desktop. Then delete all the directories in it except /sound/jukebox. Then if winrar is integrated into your shell you can just right click on the sound folder and select 'add to archive'. Then be sure to check the 'zip' button to make the archive in zip format. Press ok and a sound.zip folder should appear on your desktop.

The finished archive should have this structure: sound.zip/sound/jukebox/track01.mp3 - track20.mp3

Now use winrar to replace the trackxx.mp3 files with the files that you ripped. If you have fewer than 20 tracks you may leave rest of the tracks as the original silent track files from the eXtremev2.4.iwd.

Rename the new zip file with an iwd extension. *** IMPORTANT *** the name of your new iwd must be alphabetically after the name of your eXtreme.iwd.  I use x.iwd for my mod file and z.iwd for my jukebox file.  If you don't-- for example -- Xtremev2.4.iwd will write over music.iwd and you will listen to the 20 tracks of silence.

If you are trying to cram maps on your server use very short filenames.

Upload the new z.iwd music file both to the server and to your redirect. Your /fsgame will then have these iwd's:

/fsgame/eXtremev2.4iwd <<<-- extreme+ mod
/fsgame/music.iwd  <<<-- jukebox
/fsgame/mw.iwd  <<<-- modern weapons (if you are using them)

My fsgame looks like this:
/fsgame/mw.iwd  <<<- modern weapons
/fsgame/xiwd <<<-- extreme+ mod
/fsgame/z.iwd  <<<-- jukebox



STEP 3. SETUP the CONFIG -- In /scriptdata/miscfeatures.cfg you will find a section called // Jukebox

These are my recommended settings:

set ex_jukebox "1"      //enables jukebox on the server
set ex_jukebox_memory "1" //enables the jukebox memory on the server
set ex_jukebox_power "0"  // sets the jukebox power to 'OFF' so the jukebox does not start playing when a player joins the server (unless he saved Power ON).

You must set the length of each track.  Here you want to enter the time for each track PLUS 10 to 20 seconds (for silence between each track). Get the time for each track from the album jacket. Or, Google for it on the internet. Or, as a last resort, measure it with a stopwatch. If you enter a time that is too short the track will just abruptly end...

set ex_jukebox_tracks "9"      // enter the number of tracks in your music.iwd

//These are the times for Huey Lewis & The News--Sports (9 tracks total)

set ex_jukebox_length_1 "5:20"
set ex_jukebox_length_2 "4:33"
set ex_jukebox_length_3 "4:20"
set ex_jukebox_length_4 "5:10"
set ex_jukebox_length_5 "5:30"
set ex_jukebox_length_6 "4:10"
set ex_jukebox_length_7 "4:15"
set ex_jukebox_length_8 "4:15"
set ex_jukebox_length_9 "3:56"

// these times are ignored because of the set ex_jukebox_tracks "9" above
set ex_jukebox_length_10 "3:00"
set ex_jukebox_length_11 "3:00"
set ex_jukebox_length_12 "3:00"
set ex_jukebox_length_13 "3:00"
set ex_jukebox_length_14 "3:00"
set ex_jukebox_length_15 "3:00"
set ex_jukebox_length_16 "3:00"
set ex_jukebox_length_17 "3:00"
set ex_jukebox_length_18 "3:00"
set ex_jukebox_length_19 "3:00"
set ex_jukebox_length_20 "3:00"

Then add a MOTD to the server (also found in miscfeatures.cfg):

set ex_motd5 "Press v then 8 to control the JukeBox! Today - Huey Lewis--Sports"

Upload your miscfeatures.cfg and RestarT your server and it will read the new iwd file and the jukebox settings. Now your Jukebox is finished and your players can control what they hear.

************************************************

Addtional Notes:

The server stores the player info in /fsgame/scriptdata/memory/playername-jukebox. On a linux server you will likely find this is located in a hidden directory something like this-- .codlnxd/fsgame/scriptdata/memory/playername-jukebox.

You can change the music on your server just by swaping music.iwd files Don't forget to enter the new timings in miscfeatures.cfg.

All of this worked for me the very first time I tried it. The eXtreme+ Crew are a bunch of genious scripters for making it all work. Thanks eXtreme+ Crew!

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Install a Sporty Jukebox!
« Reply #1 on: August 20, 2008, 03:36:11 pm »
Excellent post ReaKtor

Offline PvtGomerPyle

  • Rank: Private
  • *
  • Posts: 577
Install a Sporty Jukebox!
« Reply #2 on: August 23, 2008, 04:15:00 pm »
Hey ReaKtor!!

Gomer here :D  :D

EXCELLENT TUT..... And here I thought I had nothing to do this weekend...lol

I'm getting started on this right NOW!!!

Thanks sir  :wink:  :wink:

As an update: Finished and it literally ROCKS now!!!
Thanks again ReaKtor!!!