autoexec.cfg
How to create the autoexec.cfg file if you don't already have it, and how to make sure the game calls it.
Last updated
How to create the autoexec.cfg file if you don't already have it, and how to make sure the game calls it.
Last updated
autoexec.cfg is a config file with lines of commands, that executes upon opening the game. For the most part, we use this file to establish aliases so the game knows what we want when we command it to do certain things. Without this, the game will just see our commands as gibberish and never play anything.
If you own the game on Steam, autoexec.cfg should be located in: [game's drive, likely C:]/Program Files (x86)/Steam/steamapps/common/Titanfall2/r2/cfg/autoexec.cfg
If you own the game on Origin, autoexec.cfg should be located in: [game's drive, likely C:]/Program Files (x86)/Origin Games/Titanfall2/r2/cfg/autoexec.cfg
If this file does not exist, that's okay! You can make it yourself.
To create this file, simply right click in the cfg folder, go to New>Text Document.
This creates a .txt file. We need to change its extension to .cfg. If you can't see the file's extension, in File Explorer click View, and in the Show/hide section check File name extensions.
Rename this file to autoexec, and change its extension to .cfg.
In order for the autoexec to actually execute when the game starts, you need to go into the game's launch options and write this command:
To get to the launch options on Steam, right click the game, go to Properties, and it's in the General section.
To get to the launch options on Origin, click the gear/settings icon while the game is selected in your library, click Game Properties, and click the Advanced Launch Options tab.
Make sure the launch option is saved, and your autoexec is now properly set up! The file is probably empty right now, but we'll be adding to it as we make more and more custom sounds. (you can open the .cfg just like a .txt file, with Notepad or other similar programs)
The next section just demonstrates how the autoexec works.
For custom deathsounds, we write this code in cl_obituary.gnut:
After choosing a random variable, we tell it to run a client command named deathsound, followed by the random variable it selected.
Normally, a client command called deathsound does not exist. Using the autoexec, we make it exist.
alias deathsound[number] makes the command exist. After naming this command, we put into quotations what the command actually does. In this (and most) instances, we tell it to run the playvideo command, followed by the name of the video. While you don't HAVE to, it's easier if you name your video files the exact same as each of their aliases.
These aliases can also run multiple commands at once if they're separated with a semicolon (;). This is required for Custom Lobby Music to properly function.
alias lobbymusic[number] sets up the command. stopvideos stops any other custom sounds that are currently playing. playvideo plays the specified video. 1 1 specifies the width and height of the video. deathtips_tip5 [time] tells it to wait that long, in seconds, before going to play a new lobbymusic track.
Hopefully this section helped you better understand how the autoexec functions.