func_areaportal

From Valve Developer Community
Jump to navigation Jump to search
English (en)Hrvatski (hr)Русский (ru)中文 (zh)Translate (Translate)
Not to be confused with linked_portal_door (Portal 2 An unrelated entity, sometimes referred to as a "world portal").


C++ Class hierarchy
CAreaPortal
CFuncAreaPortalBase
CBaseEntity
C++ func_areaportal.cpp
Toolsareaportal.gif

func_areaportal is a semi-internal brush entity available in all Source Source games. It creates an areaportal, used to manage visibility in maps. When the portal is open it stops objects not visible through it from rendering; when the portal is closed it cannot be seen through at all.

These are not really brush entities. They are brush entities from a mapper/Hammer perspective, but by the time they reach the game, the brush is gone and this is, in effect, a point entity.

While it is not necessary for the entity to function, the texture tools/toolsareaportal (seen on the left) is intended to be used on areaportals.

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
Name of Linked Door (target) <targetname>
A entity (usually prop_door_rotating or func_door) whose open/closed state controls the on/off state of the portal. This is optional.
Initial State (StartOpen) <integer choices>
Default Value: 1
Initial state of the portal.
  • 0 - Closed
  • 1 - Open
Portal Version (PortalVersion) <integer choices> (in all games since Source 2006)
Default Value: 0
Number that differentiates between shipping HL2 maps and maps using new engine features. Should always be set to 1.
  • 0 - Backwards-compatible with Source 2004 (also called "shipping Half-Life 2 era"); treated as always open on the client. When closed, area will be rendered if there is even one other open areaportal connected to it.
  • 1 - New version; set as default in FGDs. When closed, area will be culled as expected, regardless of other open areaportals.
Portal Number (portalnumber) <integer> !FGD
Default Value: -1
Automatically inserted by VBSP to distinguish areaportals; should not be handled manually.

Inputs

Open
Sets the portal to the open state.
Close
Sets the portal to the closed state.
Toggle
Opens the portal if closed. Closes the portal if open.

See also