- Created on Tuesday, 19 May 2009 19:09
This guide is aimed at level designers looking to add music to new maps. In Killing Floor it is possible to use a different combat and calm song for each wave, the same songs for several waves, one of each for the entire map, or anything inbetween. The music and order is up to you (though I recommend not using (c) material) whether it's your own custom music or the music that comes with the game (found in [Drive]:\Program Files\Steam\SteamApps\common\killingfloor\Music). This tutorial will follow the standard 10 wave setup for "Long" matches. The process of setting up wave based music has come a long way since the mod version of Killing Floor. The "playlist" is now a text document that can be edited quickly without having to open KFed and load the map and music can now play for any number of waves, not just the amount that are in the "playlist".
First I would recommend the map be in a playable state. If you can't playtest the map yet then there's no point in setting up music. You will also need your music encoded in the proper format. The Importing Music: Unreal Tournament 2kX tutorial explains the ogg vorbis format and offers a guide on encoding if you need more information on this subject. Now that you're good and ready let's move on.
Enable Wave-Based Music
There is one actor you will need to add to the map to begin music setup. KFMusicTrigger, which is a subclass of Triggers\MusicTrigger. Add this anywhere in the map and open it's properties. Expand the MusicTrigger section and you'll see values for Fade times and Song. I'd recommend leaving the Fade values as they are. This is essentially how much time, in seconds, the song that is currently playing will play after it has been triggered to stop and how long it will take to fade in when it's been triggered to play. Ambient music for example, is triggered to stop when the combat phase begins, which is why it's important to keep the values low. Otherwise you end up with long fades that no longer signal the transition from the two different phases.
The "Song" value acts as a failsafe of sorts. This is where we put the name of the last ambient song we want to play during the final trading phase. This will also be the song that plays for every trading phase past wave 10 if the player or server is sandboxing the map in more than 10 waves. After you've entered that, save the map and then export an INT (File\Export INT...). That's all we'll be doing in KFed.
Creating a "Playlist"
By no means do you have to arrange the wave based music in an INT. This can still be done inside KFed in the KFMusicTrigger's KFMusicTrigger section but using and INT will allow faster changes to the playlist contents and order if there is a possibility of it being changed before the map is released. Another thing to note is if you do use an INT to setup wave based music, the values in the INT will override any values in the KFMusicTrigger.
After opening the map's INT (with any text editor) you should find the section [KFMusicTrigger]. There may be a number following it. The number doesn't matter but there should only be one KFMusicTrigger section in the INT. If this section does not exist, it means there was no KFMusicTrigger saved in the map when the INT was exported. Feel free to use the following as a template to help flesh things out.
This example is pretty straight-forward. Just replace "ActionMusic1" with the name of the song (without the file extension) that you want to play for wave 1, and so on. Remember to include the quotes, they're important. Just as we had a "failsafe" ambient song, we have a "failsafe" combat song. In the above example "ActionMusic11" has been assigned to CombatSong. This is the combat song that will play for every combat phase past wave 10 if the player or server is sandboxing the map for more than 10 waves.
The order of the ambient music is slightly offset compared to how it's displayed in the example. Currently when starting a new game, ambient music begins playing as soon as the player spawns. After the combat phase is over the second ambient song will begin to play even though the wave counter ingame still says "wave 1". It is a little easier if you think of the order being: Amb1, Act1, Amb2, Act2, and so on. This is also why it was important to setup that one ambient song in KFed, otherwise music would no longer play during the last trading phase before the final wave.
This concludes all the changes necessary to setup wave based music for new maps. There is currently no configurable map-specific values for the boss music that plays during the final wave. At this time it is a value inside KillingFloor.ini. While this may be changed, the effect will only take place locally. No other players will be effected by this change.
Thanks for reading. If you'd like to tell me how wrong I am or that by some mistake you actually found this tutorial useful, let me know here.