Victory/Defeat/Draw Music
Also includes Round Won/Lost/Draw
Last updated
Also includes Round Won/Lost/Draw
Last updated
Victory/Defeat/Draw Music uses the file located in: scripts/vscripts/client/cl_gamestate.gnut
Scroll down through cl_gamestate.gnut until you get to:
void function ServerCallback_AnnounceWinner
This should be around line 796:
Under this we can see clusters of code with the most obvious thing being things like #GAMEMODE_DRAW
, #GAMEMODE_VICTORY
, and #GAMEMODE_DEFEATED
.
Under these clusters is where we'll put our custom code, that way it's easier to find for future reference. As usual, we establish our variable and make it choose a random integer, then request a client command using that number. That code should look like this:
Where [number] is however many custom music tracks you plan on using for that specific end of a match. Obviously, you would replace "victory" with whatever match end you're doing, to keep it easy to understand. Your code should look something like this:
For round ends, you only need to scroll a little further down. There you'll see the same type of text with #GAMEMODE_ROUND_DRAW
, #GAMEMODE_ROUND_WIN
, and #GAMEMODE_ROUND_LOSS
. These play specifically during LTS and Live Fire rounds. You would add to them the same way, like so:
If you want these match ends to use the same music, just name them the same thing
Modes like LTS, Live Fire, and Titan Brawl have no epilogue, so you probably want separate tracks for these since normally yours would always abruptly end due to these ending so soon. To do this, we can also check for the match's GAMETYPE. Below are all the gamemodes (on the right) with their matching GAMETYPE names (on the left).
AI_TDM = Attrition
ATTRITION = Bounty Hunt
CAPTURE_POINT = Amped Hardpoint
LAST_TITAN_STANDING = Last Titan Standing
CAPTURE_THE_FLAG = Capture The Flag
PILOT_SKIRMISH = Pilots VS Pilots
SPEEDBALL = Live Fire
TITAN_BRAWL = Titan Brawl
COLISEUM = Coliseum
MARKED_FOR_DEATH = Marked For Death
If you want different music to play for Live Fire, LTS, and Titan Brawl, all you have to do is write an if-statement checking if the current mode is either SPEEDBALL
or LAST_TITAN_STANDING
. If it is, play the shorter end music, if it isn't, play the regular end music.
Your code should look something like this:
Assuming the dropship leaves at the last second, it will warp out at 1:07.5, the fade out will begin at 1:14.5, and the match will end at 1:22.5. Use this to try timing your music with the events. While it won't always line up, when it does it's more satisfying!
For LTS and Live Fire, final killcam starts at 0:03.5, player dies at 0:07.5, scoreboard appears at 0:13, match closes at 0:21.
Like always, place your custom .bik files into the Titanfall 2 media folder, and make sure they are named properly:
To call the victory music in the autoexec, write it out like so:
where [number] is the current number of each specific victory music track. Having multiple, you'll need to write out this line multiple times, which looks like:
You use this same format for all the other music tracks. So, for example, instead of 'victory' you would use 'defeat', 'draw', 'roundwon', 'roundlost', or 'rounddraw'.
Follow this guide for more info about the autoexec and how to properly set it up.
After that, your custom end music should now be working.