This article's documentation is for anything that uses the Source engine. Click here for more information.

Func areaportal: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Add Portal Version keyvalue)
 
(28 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{otherlang2
{{LanguageBar}}
|ru=Func_areaportal:ru
{{distinguish|linked_portal_door|desc1={{p2}} An unrelated entity, sometimes referred to as a "world portal"}}
}}


[[File:Toolsareaportal.gif|link=Areaportal|left]]


{{base_brush}} 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.
{{CD|CAreaPortal|file1=func_areaportal.cpp}}
{{This is a|semi-internal=1|brush entity|name=func_areaportal|sprite=Toolsareaportal.gif}} 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.


The entity's brush must be textured with <code>tools\toolsareaportal</code> (seen on the left) for it to function.
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.


{{DISPLAYTITLE:func_areaportal}} __NOTOC}}
While it is {{Tooltip|line=dashed|It will work the same if textured with a world texture, Nodraw, or trigger textures|not necessary for the entity to function}}, the texture [[Tool_textures_(Source)#Optimization|tools/toolsareaportal]] (seen on the left) is intended to be used on areaportals.
 
== See also ==
* [[Areaportal]]
* <code>[[CAreaPortal]]</code>
* [[func_areaportalwindow]]


== Keyvalues ==
== Keyvalues ==
; Name of Linked Door <code><[[targetname]]></code>
: A [[prop_door_rotating]] or [[func_door]] whose open/closed state controls the on/off state of the portal.
; Initial State <code><[[bool]]></code>
: Initial state of the portal.
{{KV Targetname}}
{{KV Targetname}}
{{KV|Name of Linked Door|intn=target|targetname|A entity (usually {{ent|prop_door_rotating}} or {{ent|func_door}}) whose open/closed state controls the on/off state of the portal. This is optional.}}
{{KV|Initial State|intn=StartOpen|bool|Initial state of the portal.}}
{{KV|Portal Version|intn=PortalVersion|integer|since={{Source 2006}}|Read-only version number that differentiates between shipping HL2 maps and maps using new engine features.}}
:* 0 : Backwards-compatible with Source 2004 (also called "shipping Half-Life 2 era")
:* 1 : New and default version


== Inputs ==
== Inputs ==
{{I|Open|Sets the portal to the open state.}}
{{I|Close|Sets the portal to the closed state.}}
{{I|Toggle|Opens the portal if closed. Closes the portal if open.}}


; Open
== See also ==
; Close
* {{ent|func_areaportalwindow}}
; Toggle
* [[areaportal]]
: Control the state of the portal.
* [[Optimization/Level_Design|Optimization (Level Design)]]
{{I Targetname}}


== Outputs ==
[[Category:Optimization Brush Entities]]
{{O Targetname}}

Latest revision as of 11:35, 18 August 2025

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>[ Edit ]
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) <boolean>
Initial state of the portal.
Portal Version (PortalVersion) <integer> (in all games since Source 2006)
Read-only version number that differentiates between shipping HL2 maps and maps using new engine features.
  • 0 : Backwards-compatible with Source 2004 (also called "shipping Half-Life 2 era")
  • 1 : New and default version

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