☄️
Cap's Archive Space
  • Welcome
  • Cap's Titanfall 2 Mods v1
    • Welcome!
    • Downloads
    • Custom Audio Repo
    • How-To Guides
      • autoexec.cfg
      • Extract Sound Files
      • Converting to Video
      • Converting to .bik
      • Unpack/Repack .vpk Files
      • How RandomInt Works
    • Mod Guides
      • Killsounds and Deathsounds
      • Lobby Music
      • Victory/Defeat/Draw Music
      • Opening Music
      • Specific Time Music
      • Almost Done Music
      • Announcement Sounds
      • Killstreak Sounds
      • Medal Sounds
      • Announcer
    • Northstar Guides
      • Installing Northstar
      • Modding Northstar
    • Announcers
      • TF2 Administrator
        • Team Fortress 2 Killstreak Mod
      • Halo Announcer
        • Install Guide
        • Mod Settings Info
        • All Medals & Voicelines
        • All Skulls
        • Previous Versions
      • DMC5 Announcer
        • Alternate Downloads
        • Installation Guide
        • In-Depth Guide
        • Configuration
        • Previous Versions
    • Titan OS
      • Titan Fortress 2
    • Text Changes
      • Alternate Titan Ready Text
    • Custom Music
    • Unlocks Reloaded
    • Music Packs
      • MGR Finale Music
    • Speedometer
    • English Text for Various Languages
    • Viewmodels
      • Minimized
    • Joke Mods
      • Shrek.Kill
      • GoFuckYourself
      • Survivor.Death
      • GoMortyYourself
    • Compatibility Patches
Powered by GitBook
On this page
  • File Location
  • What To Do
  • Mode Specific Music
  • media and autoexec.cfg
  1. Cap's Titanfall 2 Mods v1
  2. Mod Guides

Victory/Defeat/Draw Music

Also includes Round Won/Lost/Draw

PreviousLobby MusicNextOpening Music

Last updated 2 years ago

File Location

Victory/Defeat/Draw Music uses the file located in: scripts/vscripts/client/cl_gamestate.gnut

What To Do

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:

		int musicnumber=RandomInt([number])
		GetLocalClientPlayer().ClientCommand("victory"+musicnumber)

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

Mode Specific Music

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.

		if(GAMETYPE==SPEEDBALL || GAMETYPE==LAST_TITAN_STANDING || GAMETYPE==TITAN_BRAWL)
		{
			int musicnumber=RandomInt([number])
			GetLocalClientPlayer().ClientCommand("victoryshort"+musicnumber)
		}
		else
		{
			int musicnumber=RandomInt([number])
			GetLocalClientPlayer().ClientCommand("victory"+musicnumber)
		}

Your code should look something like this:

media and autoexec.cfg

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:

alias victory[number] "playvideo victory[number] 1 1"

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'.

After that, your custom end music should now be working.

Follow this guide for more info about the autoexec and how to properly set it up.