Autoexec

From P2SR Wiki

Revision as of 22:42, 26 May 2021 by AMJ (talk | contribs) (move vid to top)

Autoexec.cfg


Overview

Video with common examples and explanations


The autoexec is a configuration file that stores settings. .cfg Files can be executed by Portal 2, and the autoexec is a configuration file that is executed upon launch of your game. It is most commonly used to alter settings that are reverted after every game close.

For more information on .cfg files, and configuration files check out the page on .cfg Files and Aliases

Where is my autoexec?

The autoexec is located at Portal 2's installation folder (usually C:\Program Files (x86)\Steam\steamapps\common\Portal 2\portal2\cfg), and is called autoexec.cfg. There is a chance you don't have this file by default, creating it should be fine, just ensure that you have the right file type. How to show/change file names on Windows 10.

What should be in my autoexec?

You can put anything you want in your autoexec, a good autoexec should save you time and keep you from having to type any commands into Portal 2 when you launch the game.

  • SAR commands are not kept between sessions, as well as SAR loading itself.
  • Aliases are not kept between sessions.
  • cvars like cl_showpos and r_portal_use_pvs_optimization are reverted to 0 after restarting.

Commands for fullgame runs

SAR commands for full game runs

sar_speedrun_autostart 0 - Prevents immediate start when loading into the level
sar_autorecord 1 - Will continue demo recordings after death and through level transitions
sar_speedrun_offset 16868 - Offset for your timer to work with the containerridesave
sar_speedrun_time_pauses 0 - Timer will not continue while paused (Be sure to look into rules about pause abuse)
cl_showpos 1 - Shows your player's look angle, and position and velocity (Used for Secret Panel, Column Blocker, and Three Gels)

Alias

Alias is a console command that takes two arguments. The first argument will be the name of whatever command you are creating, and the second argument is what will happen as the result of you calling that command. They are incredibly powerful, but are forgotten by the game upon closing, so they are perfect for an autoexec.

View a large list of alias examples by visiting the wiki page on Aliases.

Showing Textures Out-of-bounds

By default, after leaving the games normal bounds, the surrounding area is just white. You can fix this to see out of bounds with the command r_portal_use_pvs_optimization 0. It's another command that should be placed in your autoexec if you plan on ever playing around OoB.

I need one for Full Game Runs, quick.

Say no more

Massive Autoexec with tons of useful commands and Aliases

cfg suite (includes large autoexec.cfg file)

More information about commands is on this page