linked_portal_door
< Zh
Jump to navigation
Jump to search
linked_portal_door
是一个模型实体,可在 传送门2 和
地层起源中使用。 这是一种特殊的传送门 类型,无视觉效果,用于无缝连接地图中两个远距离区域。这些传送门呈方形,玩家可通过传送枪穿越。社区常称其为世界门户,因其与地图环境无缝融合,而非由玩家或测试元素放置。
在默认FGD 中,该实体显示为坐标轴辅助线:红色轴垂直于传送门表面,绿色轴代表宽度,蓝色轴代表高度。由于默认模型无方向标识,必须通过选中实体时显示的辅助线判断正反面。
使用此实体时需注意以下限制和特性:

- 默认情况下,屏幕上同时显示超过4个传送门(包括普通传送门,但不含嵌套传送门)会导致严重图形错误。可通过客户端设置
r_portal_fastpath
为0
修复,此操作无已知副作用(但过多传送门仍影响性能) - 低画质设置下,世界门户在远距离或通过其他门户观察时可能停止渲染,建议门户后方放置非nodraw 材质

- 实际传送门出现在实体位置前方0.5单位处,需使用Hammer变换工具(Ctrl+M)向后偏移0.5单位实现无缝衔接
- 移动实体不会动态更新门户位置(即使开启
sv_allow_mobile_portals
),必须发送Enable输入 - 传送门单面渲染,背面不可见
- 当
sv_player_funnel_into_portals
启用时,玩家仍会被吸入世界门户
应用示例
所有Puzzlemaker关卡都使用世界门户连接电梯井道与走廊,避免门框空间过度扩大。战役模式中实际使用两次(与解说声称的一次不符): 1. GLaDOS唤醒场景:连接焚烧炉竖井与主控室 2. 最终章2:连接"陷阱"房间与主地图
开发者解说提到,Valve在开发期间广泛使用该实体快速迭代关卡设计。通过门户连接独立房间,可自由调整关卡段落而无需考虑物理空间合理性。《斯坦利的寓言》中也大量运用该技术实现无限循环场景和空间错位效果。
键值
参见: Generic Keyvalues, Inputs and Outputs available to all entities
- Name (targetname) <target_source>
- 其他实体引用该实体的目标名称。
- Width (width) <整数 >
- 传送门宽度的一半。需小于1024且与配对实体匹配
- Height (height) <整数 >
- 传送门高度的一半。需小于1024且与配对实体匹配
- Static Portal ([todo internal name (i)]) <布尔值 > (仅存在于
之中)
- 设为true时门户固定不动,允许VRAD透射光线
注意:需-PortalTraversalLighting参数编译静态光照,-PortalTraversalAO参数编译环境光遮蔽
- Start Active (startactive) <布尔值 >
- 是否初始激活
注意:(DLC1起)此操作会生成logic_auto 实体,相关无效I/O警告可忽略
输入
LinkedPortalDoor:
- SetPartner <字符串 >
- 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.
输出
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.