本文与游戏《传送门2》有关。点击这里查看更多信息。

Zh/Prop tractor beam: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{LanguageBar|prop_tractor_beam|title=牵引光束}} {{p2 topicon}} {{CD|???|base=CBaseAnimating}} thumb|right|300px|《传送门2》中的偏移漏斗。 {{this is a|模型实体|name=牵引光束|game=传送门2}}<br> 这是一个会发射<code>{{L|projected_tractor_beam_entity}}</code>的模型。<br> 偏移漏斗是《传送门2》中的解谜元素,工作原理类似牵引光束。 当物体(如{{L|Npc_portal_turret_floor|炮塔...")
 
No edit summary
 
Line 2: Line 2:
{{p2 topicon}}
{{p2 topicon}}
{{CD|???|base=CBaseAnimating}}
{{CD|???|base=CBaseAnimating}}
[[File:1024_excursionfunnel.jpg|thumb|right|300px|《传送门2》中的偏移漏斗。]]
[[File:1024_excursionfunnel.jpg|thumb|right|300px|《传送门2》中的牵引光束。]]
{{this is a|模型实体|name=牵引光束|game=传送门2}}<br>
{{this is a|模型实体|name=牵引光束|game=Portal 2}}<br>
这是一个会发射<code>{{L|projected_tractor_beam_entity}}</code>的模型。<br>
这是一个会发射<code>{{L|projected_tractor_beam_entity}}</code>的模型。<br>
偏移漏斗是《传送门2》中的解谜元素,工作原理类似牵引光束。
偏移漏斗是《传送门2》中的解谜元素,工作原理类似牵引光束。
当物体(如{{L|Npc_portal_turret_floor|炮塔}}和{{L|Prop_weighted_cube|立方体}})或玩家触碰到蓝色漏斗时,会不受重力影响缓慢远离发射器;若碰到橙色漏斗则会朝向发射器移动。玩家可以将物体或自身移出漏斗,但无法逆着流移动。
当物体(如{{L|Npc_portal_turret_floor|炮塔}}和{{L|Prop_weighted_cube|立方体}})或玩家触碰到蓝色光束时,会不受重力影响缓慢远离发射器;若碰到橙色漏斗则会朝向发射器移动。玩家可以将物体或自身移出漏斗,但无法逆着流移动。


与{{L|bridge (Portal 2)|桥梁}}和{{L|laser (Portal 2)|激光}}类似,漏斗可通过{{L|portals|传送门}}延伸。
与{{L|bridge (Portal 2)|桥梁}}和{{L|laser (Portal 2)|激光}}类似,漏斗可通过{{L|portals|传送门}}延伸。
Line 17: Line 17:
{{KV|Use 128 model|intn=use128model|Boolean|使用适配128单位方框的牵引光束投射器模型(默认模型宽度为167单位)}}
{{KV|Use 128 model|intn=use128model|Boolean|使用适配128单位方框的牵引光束投射器模型(默认模型宽度为167单位)}}
{{KV|Primary Color|intn=primarycolor|color255|正向移动时的漏斗颜色。|only={{P2CE}}}}
{{KV|Primary Color|intn=primarycolor|color255|正向移动时的漏斗颜色。|only={{P2CE}}}}
{{KV|Secondary Color|intn=secondarycolor|color255|反向移动时的漏斗颜色。|only={{P2CE}}}}
{{KV|Secondary Color|intn=secondarycolor|color255|反向移动时的光束颜色。|only={{P2CE}}}}
{{KV BaseProjector}}
{{KV BaseProjector}}
{{KV Reflection}}
{{KV Reflection}}
Line 23: Line 23:
==输入==
==输入==
{{I|SetLinearForce|设置作用于光束中物体的线性力。标准值:250,可使用负值反转流向。|param=float}}
{{I|SetLinearForce|设置作用于光束中物体的线性力。标准值:250,可使用负值反转流向。|param=float}}
{{I|SetPrimaryColor|更改漏斗的主颜色。|param=color255|only={{P2CE}}}}
{{I|SetPrimaryColor|更改光束的主颜色。|param=color255|only={{P2CE}}}}
{{I|SetSecondaryColor|更改漏斗的次颜色。|param=color255|only={{P2CE}}}}
{{I|SetSecondaryColor|更改光束的次颜色。|param=color255|only={{P2CE}}}}
{{I BaseProjector}}
{{I BaseProjector}}



Latest revision as of 02:00, 30 June 2025

English (en)Français (fr)Русский (ru)中文 (zh)Translate (Translate)

C++ 类层级
???
CBaseAnimating
CBaseEntity
《传送门2》中的牵引光束。

牵引光束是一个模型实体,可在传送门2 传送门2中使用。
这是一个会发射projected_tractor_beam_entity(en)的模型。
偏移漏斗是《传送门2》中的解谜元素,工作原理类似牵引光束。 当物体(如炮塔(en)立方体(en))或玩家触碰到蓝色光束时,会不受重力影响缓慢远离发射器;若碰到橙色漏斗则会朝向发射器移动。玩家可以将物体或自身移出漏斗,但无法逆着流移动。

桥梁(en)激光(en)类似,漏斗可通过传送门(en)延伸。

键值

Name (目标名称) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见:  所有实体均可使用的 通用键值、输入与输出(en)

Linear Force (linearForce) <浮点型(en)>
作用于光束中物体的线性力。当值为负时,旋转颜色和方向会自动改变。V社官方制作的偏移漏斗线性力通常为250,反向漏斗应为-250。
Icon-Bug.png错误:屏幕上所有漏斗会以相同速度渲染,若速度不同会产生闪烁效果。确保玩家不会同时看到多个不同速度的漏斗。(例如250和-250的同速反向漏斗是可行的)
Disable Emitter Particles (noemitterparticles) <布尔值(en)>
禁用发射器上的漩涡粒子效果。
Use 128 model (use128model) <Boolean(en)>
使用适配128单位方框的牵引光束投射器模型(默认模型宽度为167单位)
Primary Color (primarycolor) <color255(en)> (存在于 传送门 2:社区特供版 之中)
正向移动时的漏斗颜色。
Secondary Color (secondarycolor) <color255(en)> (存在于 传送门 2:社区特供版 之中)
反向移动时的光束颜色。

BaseProjector:

Start Enabled (StartEnabled) <布尔值(en)>
If the projector should start enabled.
Disable Placement Helper (DisableHelper) <布尔值(en)>
Disable the automatically-created placement helper to prevent it from fighting with a custom one.
Render in Fast Reflections (drawinfastreflection) <布尔值(en)> (存在于自 传送门2 以来)
If enabled, this entity will render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.

输入

SetLinearForce <浮点型(en)>
设置作用于光束中物体的线性力。标准值:250,可使用负值反转流向。
SetPrimaryColor <color255(en)> (存在于 传送门 2:社区特供版 之中)
更改光束的主颜色。
SetSecondaryColor <color255(en)> (存在于 传送门 2:社区特供版 之中)
更改光束的次颜色。
BaseProjector:
Enable
Enables projection from this projector.
Disable
Disables projection from this projector.

创建

每个漏斗由prop_tractor_beam实体和前方的玩家碰撞体(en)组成。漏斗前方常放置light光源(亮度值建议为50 120 250 50)产生柔和的蓝色辉光。可逆光束通常会省略该光源以避免与橙色漏斗冲突,变通方案是放置蓝/橙两个光源,并通过反转漏斗的事件同步控制其启用/禁用。

栅格墙

创建允许牵引光束通过但阻挡玩家或prop_weighted_cube的墙体需要组合三种实体:

若存在油漆炸弹(en),需使用filter_activator_class允许油漆通过栅格。

牵引光束音效

V社官方地图中,玩家进入漏斗时会触发特殊音轨。该逻辑通过音效脚本(en)实现。自定义漏斗音乐教程参见Creating custom Portal 2 funnel music(en)

外部链接

示例地图含VMF文件。