Env portal credits: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Updated entity data style for consistency)
(credits.txt link)
 
(15 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{portal series point|env_portal_credits}}
{{LanguageBar}}
{{CD|CPortalCredits|file1=env_portal_credits.cpp}}
{{this is a|logical entity|name=env_portal_credits|series=Portal}} This entity controls the musical credits seen in both Portal games. All of the credits data, including the names and song lyrics, is read from the file {{ent|credits.txt}}.


==Entity Description==
In {{portal|2}}, the credits are rendered directly over the normal viewport, so to produce the black background from the original game a {{ent|point_viewcontrol}} should be activated alongside an {{ent|env_fade}} or inside a black box. The credits will automatically start the sound <code>music/portal_still_alive.mp3</code> after the delay specified by <code>songstarttime</code> in the credits file. HL2-style rolling credits can still be created with this entity, but they appear somewhat broken, so using the original {{ent|env_credits}} for this is recommended instead.
An entity to control the rolling credits for Portal & Portal 2.
{{bug|The music does not pause when the game is paused (even after the anniversary update), which will cause it to desync from the visual lyrics. {{workaround|Replace <code>music/portal_still_alive.mp3</code> with a blank file, then play your own track through map logic, which will pause correctly.}}|hidetested=1}}
{{bug|If a save is reloaded during the credits, they will turn into HL2-style rolling credits. Fixed in {{psa|1}} and Portal 2, but it may still cause other issues. Using <code>map_wants_save_disable 1</code> is recommended in the latter game.|hidetested=1}}


==Keyvalues==
In {{portal2|2}}, a background has been added to the credits, but there is a fade-in at the start so fading to black first may still be desirable. Music will need to be played manually through map logic as it no longer starts automatically. After the credits finish, <code>media/sp_ending_callback.bik</code> will be played, and then the game will automatically return to the main menu. All inputs to this entity will produce Portal-style credits; rolling credits and intro credits are no longer supported, and <code>env_credits</code> no longer functions.
 
 
== Keyvalues ==
{{KV Targetname}}
{{KV Targetname}}


==Inputs==
== Inputs ==
{{I Targetname}}
{{I|RollCredits|Start the intro credits rolling.}}
; <code>RollCredits</code>
{{I|RollOutroCredits|Start the outro credits rolling.}}
: Start the intro credits rolling.
{{I|ShowLogo|Shows the {{ep1|1}} logo, with an incorrect font.}}
; <code>RollOutroCredits</code>
{{I|RollPortalOutroCredits|Start the Portal greenscreen outro credits.}}
: Start the outro credits rolling.
{{note|All of the above inputs have the same effect in Portal 2, as noted in the page intro.}}
; <code>ShowLogo</code>
{{I|SetLogoLength|Meant to be used with {{code|preset=2|ShowLogo}}, it sets the duration for the logo to stay on the screen. It will also show the {{hl2|1|nt=0}} logo on top of the Episode One logo.|nofgd=1}}
: Show the HL2 logo.
 
; <code>RollPortalOutroCredits</code>
== Outputs ==
: Start the Portal greenscreen outro credits.
{{O|OnCreditsDone|Fired when HL2-style outro credits having finished rolling.}}
: {{bug|Portal-style credits do not cause this to fire. {{workaround|Use a delayed output (this is what the original game does). Unnecessary in Portal 2 as the game will return to the menu automatically.}}|hidetested=1}}


==Outputs==
== See Also ==
{{O Targetname}}
* [[Ending a Portal map]]
; <code>OnCreditsDone</code>
* [[Level Transitions]]
: Fired when the credits having finished rolling.

Latest revision as of 01:08, 9 December 2025

English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CPortalCredits
CPointEntity
CBaseEntity
C++ env_portal_credits.cpp

env_portal_credits is a logical entity available in Portal seriesPortal series Portal series. This entity controls the musical credits seen in both Portal games. All of the credits data, including the names and song lyrics, is read from the file credits.txt.

In Portal Portal, the credits are rendered directly over the normal viewport, so to produce the black background from the original game a point_viewcontrol should be activated alongside an env_fade or inside a black box. The credits will automatically start the sound music/portal_still_alive.mp3 after the delay specified by songstarttime in the credits file. HL2-style rolling credits can still be created with this entity, but they appear somewhat broken, so using the original env_credits for this is recommended instead.

Icon-Bug.pngBug:The music does not pause when the game is paused (even after the anniversary update), which will cause it to desync from the visual lyrics.
PlacementTip.pngWorkaround:Replace music/portal_still_alive.mp3 with a blank file, then play your own track through map logic, which will pause correctly.
Icon-Bug.pngBug:If a save is reloaded during the credits, they will turn into HL2-style rolling credits. Fixed in Portal: Still Alive and Portal 2, but it may still cause other issues. Using map_wants_save_disable 1 is recommended in the latter game.

In Portal 2 Portal 2, a background has been added to the credits, but there is a fade-in at the start so fading to black first may still be desirable. Music will need to be played manually through map logic as it no longer starts automatically. After the credits finish, media/sp_ending_callback.bik will be played, and then the game will automatically return to the main menu. All inputs to this entity will produce Portal-style credits; rolling credits and intro credits are no longer supported, and env_credits no longer functions.


Keyvalues

Name (targetname) <string>
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also: Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

RollCredits
Start the intro credits rolling.
RollOutroCredits
Start the outro credits rolling.
ShowLogo
Shows the Half-Life 2: Episode One logo, with an incorrect font.
RollPortalOutroCredits
Start the Portal greenscreen outro credits.
Note.pngNote:All of the above inputs have the same effect in Portal 2, as noted in the page intro.
SetLogoLength  !FGD
Meant to be used with ShowLogo, it sets the duration for the logo to stay on the screen. It will also show the HL2 logo on top of the Episode One logo.

Outputs

OnCreditsDone
Fired when HL2-style outro credits having finished rolling.
Icon-Bug.pngBug:Portal-style credits do not cause this to fire.
PlacementTip.pngWorkaround:Use a delayed output (this is what the original game does). Unnecessary in Portal 2 as the game will return to the menu automatically.

See Also