prop_portal

From Valve Developer Community
< Zh(Redirected from Zh/Portals)
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)

prop_portal是一个模型实体,可在传送门(系列) 传送门(系列)中使用。

实体描述

代表传送门的实体,与weapon_portalgun(en)发射的传送门完全一致。

Note.png注意:若要使prop_portal与玩家传送枪关联,必须将传送门配对ID设为0。
Warning.png警告:通过Kill等方式删除传送门可能导致游戏崩溃,应使用FizzleSetActivatedState 0
Note.png注意:区别在于:Fizzle会播放音效并移除传送门,而SetActivatedState 0会静默关闭传送门但不移除。若后续有相同配对ID和颜色的传送门激活,静默关闭的传送门会被移除。
Tip.png提示:此特性适用于在激活新传送门前静默清除地图中的固定传送门。
Warning.png警告:当存在未链接的激活传送门时,激活同配对ID同颜色的新传送门会导致先激活的传送门变色。可通过先禁用旧传送门避免此问题。
Icon-Bug.png错误:Garry's Mod Garry's Mod中使用传送门时,穿越传送门会出现碰撞异常(如卡入地板)。  [todo tested in ?]

《Portal 2》放置规则

Warning.png警告:Portal 2中,错误的prop_portal放置会导致传送门重置到地图原点,规则如下:
  • 必须非激活状态启动
  • 必须与放置表面完全平行(使用2D视图黄线和3D视图蓝线作为参考)
  • 与目标表面的距离必须为0-8单位
  • 实体中心与上下相邻表面的距离≥57单位,与左右相邻表面≥32单位
  • 表面材质必须允许放置传送门(即不含%noportal 1参数)
Note.png注意:该实体无视转化凝胶,即使材质有凝胶但禁止传送门放置也会失败。

键值

Start Activated (Activated) <布尔值(en)>
是否初始激活
Icon-Bug.png错误:传送门2 此设置会导致传送门出现在世界原点,建议改用logic_auto(en)  [todo tested in ?]
Icon-Bug.png错误:传送门 此设置会导致玩家无法正常走出配对传送门,必须跳跃通过  [todo tested in ?]
Portal Number (PortalTwo) <choices>
传送门颜色选择
  • 0 : 蓝色传送门
  • 1 : 橙色传送门
Half-Width of the Portal. (HalfWidth) <浮点型(en)> (存在于自 传送门2 以来)
传送门宽度的一半(默认为32)
Half-Height of the Portal. (HalfHeight) <浮点型(en)> (存在于自 传送门2 以来)
传送门高度的一半(默认为54)
Portal pair ID that it belongs to (LinkageGroupID) <整数(en)>
传送门配对ID(0-255)
Name (目标名称) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见:  所有实体均可使用的 通用键值、输入与输出(en)

Pitch Yaw Roll (Y Z X) (angles) <QAngle(en)>
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.

输入

SetName <字符串(en)>
设置实体名称(FGD注释:命名传送门很有趣)
SetActivatedState <布尔值(en)>
设置激活状态
Fizzle
播放消散效果并移除
NewLocation <字符串(en)>
设置新坐标和角度(格式:'x y z pitch yaw roll')
Resize <字符串(en)> (存在于自 传送门2 以来)
调整尺寸(注意:仅相同尺寸的传送门可正常运作)
SetLinkageGroupID <整数(en)> (存在于自 传送门2 以来)
设置配对ID

输出

OnPlacedSuccessfully
!activator = weapon_portalgun(en)
!caller = this entity
当传送门成功放置时触发
OnEntityTeleportFromMe  (存在于自 传送门2 以来)
当实体从本传送门传送到配对门时触发
OnPlayerTeleportFromMe  (存在于自 传送门2 以来)
当玩家从本传送门传送到配对门时触发
OnEntityTeleportToMe  (存在于自 传送门2 以来)
当实体从配对门传送到本传送门时触发
OnPlayerTeleportToMe  (存在于自 传送门2 以来)
当玩家从配对门传送到本传送门时触发


外部链接