credits.txt
credits.txt is the configuration file that defines the text displayed by env_credits, env_portal_credits, env_outtro_stats (when using the RollCredits input), and env_introcredits. It is located in the scripts/ folder in most games, or the game directory root in the Left 4 Dead series.
The file is standard KeyValues, with the root key typically named the same as the file. Its sub-keys define various components of the credits:
CreditsParamsconfigures various settings for the credits displayIntroCreditsNameslists the names displayed in the intro credits (not in


)IntroCreditslists the names displayed in the intro credits across multiple maps (only in
)OutroCreditsNameslists the names displayed in the outro creditsOutroSongLyricslists the lines for the Portal musical credits (only in
)OutroAsciiArtdefines the ASCII art images that appear throughout Portal's credits (only in
)
Credits parameters
The CreditsParams block contains various pre-defined settings for how the credits should be displayed. Most of these only apply to specific credits types. All of the given default values are as defined in code, and may differ from what is actually used in Valve's games.
<dl id="color" style="margin-block:.4em 1em">
color <color255> (not in Outro credits
<dl id="scrolltime" style="margin-block:.4em 1em">
scrolltime <float>
<dl id="separation" style="margin-block:.4em 1em">
separation <float>
Intro credits
(not in ![]()
![]()
)
<dl id="fadeintime" style="margin-block:.4em 1em">
fadeintime <float>
<dl id="fadeholdtime" style="margin-block:.4em 1em">
fadeholdtime <float>
<dl id="fadeouttime" style="margin-block:.4em 1em">
fadeouttime <float>
<dl id="nextfadetime" style="margin-block:.4em 1em">
nextfadetime <float>
<dl id="pausebetweenwaves" style="margin-block:.4em 1em">
pausebetweenwaves <float>
<dl id="logotime" style="margin-block:.4em 1em">
logotime <float>
<dl id="posx" style="margin-block:.4em 1em">
posx <float>
<dl id="posy" style="margin-block:.4em 1em">
posy <float>
Logo
env_portal_credits has Episode One's logo text hardcoded in and does not support these. Use the original env_credits instead if you want to show a logo in a Portal mod.
<dl id="logo" style="margin-block:.4em 1em">
logo <string>
ShowLogo is used. This uses ClientTitleFont (same as the title screen logo) in the HL2 Episodes and Portal, or WeaponIcons in HL2. Defaults to HALF-LIFE', which will be drawn as the HL2 logo with the aforementioned fonts.<dl id="logo2" style="margin-block:.4em 1em">
logo2 <string>
Portal credits
<dl id="cursorblinktime" style="margin-block:.4em 1em">
cursorblinktime <float>
<dl id="scrollcreditsstart" style="margin-block:.4em 1em">
scrollcreditsstart <float>
scrolltime will start after this and is not shortened. Defaults to 6 seconds.(only in
):
<dl id="songstarttime" style="margin-block:.4em 1em">
songstarttime <float>
music/portal_still_alive.mp3 will be played. Defaults to 6.85 seconds.<dl id="screenxoffset" style="margin-block:.4em 1em">
screenxoffset <integer>
<dl id="screenyoffset" style="margin-block:.4em 1em">
screenyoffset <integer>
<dl id="screenwidthadjustment" style="margin-block:.4em 1em">
screenwidthadjustment <integer>
<dl id="screenheightadjustment" style="margin-block:.4em 1em">
screenheightadjustment <integer>
<dl id="asciiartfont" style="margin-block:.4em 1em">
asciiartfont <string>
Default.<dl id="aascreenxoffset" style="margin-block:.4em 1em">
aascreenxoffset <integer>
<dl id="aascreenyoffset" style="margin-block:.4em 1em">
aascreenyoffset <integer>
<dl id="aaseparation" style="margin-block:.4em 1em">
aaseparation <integer>
(only in
):
<dl id="color_lyrics" style="margin-block:.4em 1em">
color_lyrics <color255>
<dl id="color_credits" style="margin-block:.4em 1em">
color_credits <color255>
Intro/outro credits names
The IntroCreditsNames and OutroCreditsNames blocks define the names displayed in the intro and outro credits respectively. Both have the same format. For intro credits in Black Mesa, see the section below.
Each keyvalue represents a single line in the credits. The key name is the text that you want to appear on that line, while the value is the name of the font to use from clientscheme.res. Usually the font CreditsText is used for intro credits and CreditsOutroText used for outro credits, but you can swap these out or use different fonts on different lines in order to create headers or icons.
The intro credits are shown in groups of three, so you should take this into account when writing intro credits. The first three lines (showing the Valve logo in HL2) will fade in and fade out all at once, then the second group will fade in all at once, then it will begin going through the rest of the groups with a top-to-bottom fade animation.
In Black Mesa, outro credits prefixed with a question mark (?) will be left aligned, and credits prefixed with a exclamation point (!) will be right aligned and drawn on the same line as the previous credit. This allows creating dual-column credits.
Example
"IntroCreditsNames"
{
"V" "WeaponIcons" // Valve logo
" " "CreditsText" // padding out the rest of the group
" " "CreditsText"
"Credit1" "CreditsText" // first real credit
"Credit2" "CreditsText"
"Credit3" "CreditsText"
"Credit4" "CreditsText" // new group of three
"Credit5" "CreditsText"
"Credit6" "CreditsText"
}
"OutroCreditsNames"
{
"HALF-LIFE'" "CreditsOutroLogos" // HL2 logo
" " "CreditsOutroText" // spacing is purely aesthetic, there is no grouping for outro credits
"V" "CreditsOutroValve" // Valve logo
" " "CreditsOutroText"
"Credit1" "CreditsOutroText" // first real credit
"Credit2" "CreditsOutroText"
"Credit3" "CreditsOutroText"
"Credit4" "CreditsOutroText"
" " "CreditsOutroText"
"v" "CreditsOutroText" // last line, lingers for a few seconds. Will appear the same as the above Valve logo due to KV caching
}
Intro credits (Black Mesa)
Due to the tram ride being split across multiple maps, Black Mesa uses a different system for intro credits. The IntroCredits block holds subkeys corresponding to each map. Each of these then holds a totaltime key that sets the total amount of time that these credits should appear over, and a credits key holding the actual list of credits to display. Each credit has the text to display as the key name, and the value is not used.
Example
"IntroCredits" //Into credits start here.
{
"map1" //The first map there we want to have credits.
{
"totaltime" "90" //Total time (in seconds) we want to roll credits.
"credits"
{
"#Map1MyText1" "#BLANK" //The first is the text that will be displayed, the second does nothing (even if you'll write here some already existing text).
"#Map1MyText2" "#BLANK" //The second text that will be displayed.
"#Map1MyTextX" "#BLANK" //The X text that will be displayed.
}
}
"map2" //The second map there we want to have credits.
{
"totaltime" "100" //Total time (in seconds) we want to roll credits.
"credits"
{
"#Map2MyText1" "#BLANK" //The first text that will be displayed.
"#Map2MyText2" "#BLANK" //The second text that will be displayed.
"#Map2MyTextX" "#BLANK" //The X text that will be displayed.
}
}
}
Portal lyrics
The OutroSongLyrics block holds the lyrics to the Portal games' ending songs along with timing and display information. It is formatted similarly to regular intro/outro credits, with each key being the text to display and the value being the font name, but there are various formatting characters that can be used at the start of a line to control the behavior of the text. If multiple of these are used on a single line, they must be used in the order listed.
- A float inside square brackets (
[x]) indicates how long the line will take to appear. The speed of the text will be automatically timed so it lasts this duration. - An integer inside a set of three less/greater symbols (
<<<x>>>) will switch the active ASCII art to the one matching the specified ID. A value of zero hides the ASCII art. (only in
) - An ampersand (
&) will clear the screen. This should be used on its own line with a very short display time. - An asterisk (
*) will cause the next line of text to be displayed directly after this one, without a line break. This can be used to make different parts of a single visual line print at different speeds, which can allow matching the spoken lyrics better. - A caret (
^) used on an otherwise blank line will force a newline to be added. - A hash sign (
#) will look up the provided text as a localization token.
Example
"OutroSongLyrics"
{
"[2.05]#portal_lyrics_01" "CreditsOutroText" // brackets used for timing, hashes used for localization
"[1.9] " "CreditsOutroText"
"[2.1]#portal_lyrics_02" "CreditsOutroText"
"[0.1] " "CreditsOutroText"
"[1.8]#portal_lyrics_03" "CreditsOutroText"
"[1.00] " "CreditsOutroText"
"[2.36]#portal_lyrics_04" "CreditsOutroText"
"[0.04] " "CreditsOutroText"
"[2.71]#portal_lyrics_05" "CreditsOutroText"
"[2.13] " "CreditsOutroText"
"[1.76]<<<1>>>#portal_lyrics_06" "CreditsOutroText" // switch ascii art
"[2.10] " "CreditsOutroText"
"[1.57]#portal_lyrics_07" "CreditsOutroText"
"[0.20] " "CreditsOutroText"
"[0.75]*#portal_lyrics_08" "CreditsOutroText" // combine this with the next two lines
"[0.1]* " "CreditsOutroText"
"[0.71]#portal_lyrics_09" "CreditsOutroText"
"[1.67] " "CreditsOutroText"
"[1.55]*#portal_lyrics_10" "CreditsOutroText" // combine with next line
"[1.53]#portal_lyrics_11" "CreditsOutroText"
"[0.279] " "CreditsOutroText"
"[1.741]<<<6>>>#portal_lyrics_12" "CreditsOutroText" // switch ascii art
"[0.400]^" "CreditsOutroText" // force new line
"[0.01]&" "CreditsOutroText" // blank screen
}
Portal ASCII art
(only in
)
The OutroAsciiArt block defines all of the ASCII art images which can be switched between as the credits progress (see above). Despite the official credits file using a specific naming and formatting scheme for these, all of it does absolutely nothing. The game appears to simply read every subkey of OutroAsciiArt in order, and when an ASCII art index is selected, it will blindly draw 20 lines starting from the index - 1 * 20th key. This means all ASCII art must be exactly 20 lines in height, but the width can vary.
]) anywhere in a line will cause it and all preceding text to disappear despite this having no effect.
Example
"OutroAsciiArt"
{
"APERTURE1" "[1.000] .,-:;//;:=, " // the key names here do not matter, nor do the bracketed numbers at the start of the value
"APERTURE2" "[1.000] . :H@@@MM@M#H/.,+%;, "
"APERTURE3" "[1.000] ,/X+ +M@@M@MM%=,-%HMMM@X/, "
"APERTURE4" "[1.000] -+@MM; $M@@MH+-,;XMMMM@MMMM@+- "
"APERTURE5" "[1.000] ;@M@@M- XM@X;. -+XXXXXHHH@M@M#@/. "
"APERTURE6" "[1.000] ,%MM@@MH ,@%= .---=-=:=,. "
"APERTURE7" "[1.000] =@#@@@MX ., -%HX$$%%%+; "
"APERTURE8" "[1.000] =-./@M@M$ .;@MMMM@MM: "
"APERTURE9" "[1.000] X@/ -$MM/ .+MM@@@M$ "
"APERTURE10" "[1.000],@M@H: :@: . =X#@@@@-"
"APERTURE11" "[1.000],@@@MMX, . /H- ;@M@M="
"APERTURE12" "[1.000].H@@@@M@+, %MM+..%#$."
"APERTURE13" "[1.000] /MMMM@MMH/. XM@MH; =; "
"APERTURE14" "[1.000] /%+%$XHH@$= , .H@@@@MX, "
"APERTURE15" "[1.000] .=--------. -%H.,@@@@@MX, "
"APERTURE16" "[1.000] .%MM@@@HHHXX$$$%+- .:$MMX =M@@MM%. "
"APERTURE17" "[1.000] =XMMM@MM@MM#H;,-+HMM@M+ /MMMX= "
"APERTURE18" "[1.000] =%@M@M#@$-.=$@MM@@@M; %M%= "
"APERTURE19" "[1.000] ,:+$+-,/H#MMMMMMM@= =, "
"APERTURE20" "[1.000] =++%%%%+/:-. "
"CAKE1" "[2.000] ,:/+/- " // second ascii art starts exactly 20 lines down
"CAKE2" "[2.000] /M/ .,-=;//;- "
"CAKE3" "[2.000] .:/= ;MH/, ,=/+%$XH@MM#@: "
"CAKE4" "[2.000] -$##@+$###@H@MMM#######H:. -/H#"
"CAKE5" "[2.000] .,H@H@ X######@ -H#####@+- -+H###@X"
"CAKE6" "[2.000] .,@##H; +XM##M/, =%@###@X;- "
"CAKE7" "[2.000]X%- :M##########$. .:%M###@%: "
"CAKE8" "[2.000]M##H, +H@@@$/-. ,;$M###@%, -"
"CAKE9" "[2.000]M####M=,,---,.-%%H####M$: ,+@##"
"CAKE10" "[2.000]@##################@/. :%H##@$- "
"CAKE11" "[2.000]M###############H, ;HM##M$= "
"CAKE12" "[2.000]#################. .=$M##M$= "
"CAKE13" "[2.000]################H..;XM##M$= .:+"
"CAKE14" "[2.000]M###################@%= =+@MH%"
"CAKE15" "[2.000]@################M/. =+H#X%= "
"CAKE16" "[2.000]=+M##############M, -/X#X+;. "
"CAKE17" "[2.000] .;XM##########H= ,/X#H+:, "
"CAKE18" "[2.000] .=+HM######M+/+HM@+=. "
"CAKE19" "[2.000] ,:/%XM####H/. "
"CAKE20" "[2.000] ,.:=-. "
}