SDI title
 

 
  News:
  » Current News
  » Archive News

  Features:
  » Tutorials
  » Downloads

  Community:
  » Forum




  Random Tip:
24.World Builder will read a .big file if its name starts with "Expand" before its actual name. For Zero Hour it must be placed in the Data\Ini\ folder, otherwise it can be placed in the main game directory. World Builder will only read one .big file though.
  » View All Tips



  Site:
  » Staff
  » Contact Us

  Affiliates:
  » Atomic Wiener Dog
  » CNC Reneclips
  » GenDev
  » Project Perfect Mod
  » The Finest Hour
  » Warhammer40k: DoW SDI
  » YR Argentina
 

Adding new music

Title: Adding new music
Difficulty: Novice AI Scripter
Author(s): SDI Team
Game Type: Both regular Generals and Zero Hour


Okay first of all, your .mp3 files must be in the Command and Conquer Generals\Data\Audio\Tracks\ folder. Next you need to have them inserted in Music.ini which can be extracted from INI.big using a .big extractor and put into the Data\Ini\ folder.

To add new music to that file copy some entry and replace the Filename = with what your .mp3 file is labelled. Name the music track accordingly next to MusicTrack, to reference them again in the scripts.

Next open up World Builder, go to Edit>Player List and hit "Add Skirmish Players". Then click OK and go to Edit>Scripts and import the SkirmishScripts.scb which should be in your Command and Conquer Generals\Data\Scripts\ folder.

In the "PlyrCivilian" folder you'll see faction specific music and faction specific music events (like, when you loose an important building, a sad tune is played). The observer player also has music.

Now here is how the logic works, they could have made it simpler but why make it simple if you can make it complicated.. :

Initially there is always a Set Default Music Track script which checks what faction this player has, and then sets a counter to 1, to allow referencing to this for other scripts later. The first music track script always checks if this is the first time the music is played or if the cycle wants to restart. It then plays the according music track, sets the music counter to 2 and initializes a timer.

Once the first music track has played, the silence script for this track starts, playing a long silence track. The timer initialized earlier makes sure that this silence does not go on forever - as soon as this timer expires the next track is played, once that has been played it'll initialize the timer again and the silence script is played after the timer is expired again the next track is played and so on and so on.

Once the last track has played, the last script plays a silence again and sets a timer to expire. The first music script checks when this timer has expired and restarts the whole thing once that has happened.

So, to add your own music, you just have to copy the last script and edit some things: the script before the last one must initialize a different Music Track 9 Start timer, if for example you want to add one music track you have to name it "Music Track 10 Start" and match its expiration length with your new music track length. Your script for the new music track must then play your new music track as defined in Music.ini, check if Music Track 10 Start has expired and set the Music Track counter to 11 and also initialize a silence timer. Now you just need to modify the Silence End script to check if the Music Track counter is 11 and if the corresponding music track has completed. Now you're done with the generic music.

If you have some special event-related music you have to add them in the Music Events folder for a specific faction - the logic for the scripts is very straightforward.

Oh, and in case you want to replace the music instead of add them, just find the corresponding names for each faction music track filename in Music.big, match your filenames with them and place them in the Data\Audio\Tracks folder..








SDI
SDI is part of the Revora Creative Network.
Orange Block design created by Detail © 2004 Revora Creative Network.
Content © Revora Creative Network 2004 - 2008