prop_portal

From Source Entities
Jump to navigation Jump to search

Code classes:

prop_portal is a point entity present in both P1.pngP2.pngPortal games. This entity is a portal. Shot from a weapon_portalgun.

Warning: Removing one through methods such as Kill may crash the game. Instead, use Fizzle or SetActivatedState 0 to remove portals.

Bug: If a portal is told to activate while another portal with the same pair ID and color is open, that second portal's color will change and its particle effect will be bugged.

Portals should be placed facing the exact angle of their surfaces, or they may not open, or appear clipped. Portals should also be within a few units of their surface, otherwise movement may look odd, or they might not open at all. P2.pngPortals also need enough valid space on their surface in order to open.

Keyvalues[edit | edit source]

Portal pair ID that it belongs to (LinkageGroupID) <integer>
Which pair of portals this portal belongs to. Singleplayer uses 0, ATLAS uses 1, and P-Body uses 2.
Portal Number (PortalTwo) <choices>
Which portal in a pair this one is.
  • 0: Portal 1 (left click)
  • 1: Portal 2 (right click)
Start Activated (Activated) <choices>
Whether the portal starts active. Inactive portals are not visible and don't teleport entities.
Bug: P2.pngPortals must start inactive or they will be buggy.
Fix: Use logic_auto to send SetActivatedState.
  • 0: Inactive
  • 1: Active
Half-Width of the Portal (HalfWidth) <float> (only available in P2.png)
Half of the portal's intended width.
Half-Height of the Portal (HalfHeight) <float> (only available in P2.png)
Half of the portal's intended height.

Inputs[edit | edit source]

SetActivatedState <boolean>
Sets if the portal is active or not. When set to 0, the portal disappears quietly with no visual effect.
Fizzle
Sets the portal to be inactive and plays sound and visual effects as if a player walked into a fizzler.
NewLocation <string>
Puts the portal in a new location and gives it new angles. Expects 6 numbers: X Y Z coordinates, then a Pitch, Yaw and Roll.
SetLinkageGroupId <integer> (only available in P2.png)
Sets Portal pair ID.
Resize <string> (only available in P2.png)
Changes the width and height of the portal. Visually broken.

Outputs[edit | edit source]

OnPlacedSuccessfully
Fires when the portal is placed somewhere successfully by a portal gun.
OnEntityTeleportFromMe  (only available in P2.png)
Fires when any entity goes through this portal.
OnPlayerTeleportFromMe  (only available in P2.png)
Fires when a player goes through this portal.
OnEntityTeleportToMe  (only available in P2.png)
Fires when any entity goes though this portal's partner.
OnPlayerTeleportToMe  (only available in P2.png)
Fires when a player goes through this portal's partner.