Prop portal: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 4: Line 4:
The entity that represents a portal, exactly like one fired from a {{ent|weapon_portalgun}}.
The entity that represents a portal, exactly like one fired from a {{ent|weapon_portalgun}}.
{{note|In order for a prop_portal to link up to the player's portal gun, the portal pair ID must be set to 0.}}
{{note|In order for a prop_portal to link up to the player's portal gun, the portal pair ID must be set to 0.}}
{{warning|Removing one through methods such as <code>Kill</code> may crash the game.}}
{{warning|Removing one through methods such as <code>Kill</code> may crash the game. Instead, use <code>Fizzle</code> or <code>SetActivatedState 0</code> to remove portals.{{note|The distinction is that <code>Fizzle</code> plays a sound effect and removes the portal, while <code>SetActivatedState 0</code> silently closes the portal but does not remove it. However, if another portal with the same pair ID and color becomes active, the inactive portal will be removed. {{tip|This is useful for silently clearing out fixed portals before activating other fixed portals in the same map.}} }} }}
{{warning|When a portal is active but not linked, activating another portal of the same pair ID and color will cause the portal that was activated first to switch its color. This can be avoided by deactivating the first portal before the second one is activated.}}


===Placement Rules for Portal 2===
===Placement Rules for Portal 2===

Revision as of 14:23, 24 September 2019

Template:Portal series point

Entity description

The entity that represents a portal, exactly like one fired from a weapon_portalgun.

Note.pngNote:In order for a prop_portal to link up to the player's portal gun, the portal pair ID must be set to 0.
Warning.pngWarning:Removing one through methods such as Kill may crash the game. Instead, use Fizzle or SetActivatedState 0 to remove portals.
Note.pngNote:The distinction is that Fizzle plays a sound effect and removes the portal, while SetActivatedState 0 silently closes the portal but does not remove it. However, if another portal with the same pair ID and color becomes active, the inactive portal will be removed.
Tip.pngTip:This is useful for silently clearing out fixed portals before activating other fixed portals in the same map.
Warning.pngWarning:When a portal is active but not linked, activating another portal of the same pair ID and color will cause the portal that was activated first to switch its color. This can be avoided by deactivating the first portal before the second one is activated.

Placement Rules for Portal 2

Warning.pngWarning:In Portal 2, bad placement of a prop_portal will cause the location of the portal to revert to the map's origin. The rules are as follows:
  • Must not start active.
  • Must be over a single brush. It will not open on the seam between multiple brushes even if all surfaces are portalable. (This differs from the portal gun.)
  • Must have its pitch, yaw and roll facing the exact same direction of the surface it's placed on. Use the yellow line in the 2D view and the blue line (Z-axis) in the 3D view as guides to help with this.
  • Must be 0-8 units from the surface the portal is to be placed on.
  • Must be at least 57 units away from any adjacent surfaces on the top and bottom.
  • Must be at least 32 units away from any adjacent surfaces on the sides.

Keyvalues

PortalTwo ([todo internal name (i)]) <boolean>
Is this portal an orange portal?
Activated ([todo internal name (i)]) <boolean>
Is this portal activated at start?
Icon-Bug.pngBug:In Portal 2, this will cause the portal to appear at the world origin.  [todo tested in ?]
LinkageGroupID ([todo internal name (i)]) <integer>
Portal pair ID that it belongs to. Must be a value between 0 and 255.
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

Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

Inputs

SetName
Set the targetname of this portal.
SetActivatedState <booleanRedirectInput/boolean>
Set this portal to be inactive or active.
Fizzle
Fizzle and remove.
NewLocation <stringRedirectInput/string>
Sets this portal's location and angles. This expects 6 floats with space delimiters, the format is 'x y z pitch yaw roll'
Resize <stringRedirectInput/string> (in all games since Portal 2)
Changes the size of the portals. Note that portals only function if they are the same size, and the coloured border remains the same size and proportions.


Outputs

OnPlacedSuccessfully
Fired when the portal spawns successfully.


External links

Example Map VMF