☄️
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
  • How to Specify/Exclude Game Modes
  • media and autoexec.cfg
  1. Cap's Titanfall 2 Mods v1
  2. Mod Guides

Opening Music

Opening Music plays at the very start of the match.

PreviousVictory/Defeat/Draw MusicNextSpecific Time Music

Last updated 2 years ago

THIS PAGE IS NOT FINISHED!! Read ahead at your own discretion.

File Location

Opening Music uses the file located in: scripts/vscripts/client/cl_gamestate.gnut

What To Do

Because of the location we write our opening music code in, we need to force it to only run our code one time, because the area we put it in is repeatedly run during the prematch gamestate. To do this, at the top we'll establish our integer. In this example we'll call it startopening and set it to 0.

Next, scroll down until you get to case eGameState.Prematch:, which should be around line 227.

In this case, we're going to write an if-statement to check if startopening is still 0. At the end of this if statement, we'll change startopening to 1, so it won't run again.

                if ( startopening==0 )
                {
                    int musicnumber=RandomInt([number])
                    GetLocalClientPlayer().ClientCommand("opening"+musicnumber)
                    startopening=1
                }

Replace [number] with however many opening tracks you're going to have.

Your code should look something like this. Remember to write this stuff ABOVE the break line.

How to Specify/Exclude Game Modes

GAMETYPE specifies what gamemode you're currently playing. Using this we can have music play for specific modes. Below is all the GAMETYPE names on the left and actual mode names on the right for each playable gamemode.

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

For example, I want specific opening music to be played during LTS and Live Fire, otherwise play something else instead. To do that I write 2 if-statements, one checking if the mode isn't Live Fire and isn't LTS, and one checking if the mode is Live Fire or LTS. Squirrel uses & for and, and | for or. Your checks should look something like this:

media and autoexec.cfg

As always, put your bik files in the media folder.

The way it's written in autoexec is the same as most sound mods.

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