Difference between revisions of "Linked portal door"

From Valve Developer Community
Jump to: navigation, search
m (Keyvalues: rearranged keyvalues)
m (moved see also to bottom of the page)
Line 7: Line 7:
  
 
== Usage ==
 
== Usage ==
 
 
This entity is used in Chapter 9, in the Chamber 75 Death Trap with 6 defective turrets aiming directly at you. The room is actually completely separate from its supposed surroundings. It is the only use of this entity in the final version of the game, though commentary states that it was often used during the development of the title to link chambers together.
 
This entity is used in Chapter 9, in the Chamber 75 Death Trap with 6 defective turrets aiming directly at you. The room is actually completely separate from its supposed surroundings. It is the only use of this entity in the final version of the game, though commentary states that it was often used during the development of the title to link chambers together.
  
Line 14: Line 13:
  
 
The linked_portal_door is represented in hammer by a three axis marker when selected. The red axis is normal to the surface of the portal, the green axis is the width, and the blue axis is the height.
 
The linked_portal_door is represented in hammer by a three axis marker when selected. The red axis is normal to the surface of the portal, the green axis is the width, and the blue axis is the height.
 
==See also==
 
* [[prop_linked_portal_door]]
 
  
 
==Keyvalues==
 
==Keyvalues==
Line 28: Line 24:
  
 
==Inputs==
 
==Inputs==
 
 
{{I LinkedPortalDoor}}
 
{{I LinkedPortalDoor}}
 
{{I Targetname}}
 
{{I Targetname}}
Line 34: Line 29:
  
 
==Outputs==
 
==Outputs==
 
 
{{O LinkedPortalDoor}}
 
{{O LinkedPortalDoor}}
 
{{O Targetname}}
 
{{O Targetname}}
 +
 +
==See also==
 +
* [[prop_linked_portal_door]]

Revision as of 11:50, 2 June 2012

Example of a linked portal: it connects to a room of the same size with white tiles.
Portal 2's impossible room.


[Portal 2] linked_portal_door is a point entity available in Portal 2. It is a square portal that leads seamlessly to another linked_portal_door. The player can shoot the portal gun through it.

Note:A portal cannot update its position while open. The only way is to close it, move the entity, then reopen it.

Usage

This entity is used in Chapter 9, in the Chamber 75 Death Trap with 6 defective turrets aiming directly at you. The room is actually completely separate from its supposed surroundings. It is the only use of this entity in the final version of the game, though commentary states that it was often used during the development of the title to link chambers together.

...tweaks to existing levels. When we started the project making any big structural change in a level or the order of levels would lead to hours or even days of busy work trying to reconnect things and make sure they lined up again. If we ever wanted to ship something the size of Portal with the finely tuned balance we desired then we needed a way to be able to make big changes to the layout of the game without paying the cost of making everything line up again. We needed a way to bend space. We needed to think with portals. Using portals to connect different areas in the world we could make any type of impossible space work out. You could look through a hallway into the next room but the hallway might be on the other side of the map and the room you are looking into might be in a completely different orientation. We could seamlessly insert an elevator, a huge expansive vista, a room that was bigger on the inside than the outside, or even create an infinite fall by connecting a shaft back into itself. Soon every connection between any space was a portal. We would even switch them on the fly. Even a simple door worked like the cartoons - just a facade painted on a wall that seamlessly opened somewhere else entirely. Once the game settled down we were able to finalize our path and remove all of the world portals. There's only one impossible space left in the whole game - see if you can figure out where it is.

-Eric Tams in the Portal 2 Developer Commentary.

The linked_portal_door is represented in hammer by a three axis marker when selected. The red axis is normal to the surface of the portal, the green axis is the width, and the blue axis is the height.

Keyvalues

Width <integer>
1/2 width of the desired portal. Must be less than 1024, and match the corresponding property of the partner.
Height <integer>
1/2 height of the desired portal. Must be less than 1024, and match the corresponding property of the partner.
Start Active <boolean>
Whether to start the linkage as active from the start.
Note:(As of DLC1) This will create a logic_auto entity somewhere in your map. The engine will try to tell you that the logic_auto has invalid i/o. You can safely ignore this.

LinkedPortalDoor:

Linked Partner <targetname>
Another 'linked_portal_door' entity which will link to this one.

Targetname:

Name <string>
The targetname that other entities refer to this entity by.
Entity Scripts <scriptlist> (New with Left 4 Dead 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function <string> (New with Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note:Try to avoid expensive operations in this function, as it may cause performance problems.

Parentname:

Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.

Angles:

Pitch Yaw Roll (Y Z X) <angle>
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

LinkedPortalDoor:

SetPartner  <string>
Set a new partner door.
Open
Open the door and cause the portal to activate.
Close
Close the door and cause the portal to deactivate.

Targetname:

Kill
Removes this entity and any entities parented to it from the world.
KillHierarchy
Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster than Kill.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile  <script> (New with Left 4 Dead 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug: In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction  <string> (New with Left 4 Dead 2) !FGD
Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin  <coordinates> (New with Alien Swarm) !FGD
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles  <angles> (New with Alien Swarm) !FGD
Set this entity's angles.

Parentname:

SetParent  <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment  <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset  <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.

Outputs

LinkedPortalDoor:

OnOpen
Called when the door has started its open animation.
OnClose
Called when the door has started its close animation.
OnEntityTeleportFromMe
Called when an entity enters this linked portal.
OnPlayerTeleportFromMe
Called when the player enters this linked portal.
OnEntityTeleportToMe
Called when an entity exits this linked portal.
OnPlayerTeleportToMe
Called when the player exits this linked portal.

Targetname:

OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  (Only in the Left 4 Dead series)
This Output fires when the entity is killed and removed from the game.

See also