这篇条目有关 Source引擎。如需详情,点击这里。

path_corner

From Valve Developer Community
< Zh
Jump to navigation Jump to search
English (en)한국어 (ko)中文 (zh)Translate (Translate)
Icon-NotInFGD.png
此实体默认存在于 FGD
请参阅下面的内容以获取有关使其可用的说明。
Path corner.png

path_corner是一个点实体(en),可在所有的 起源 起源 游戏中使用。

C++ 类层级
CPathCorner
CPointEntity
CBaseEntity
C++ pathcorner.cpp
澄清: path_track 不是 path_corner


实体描述

简介

  • path_corner 是路径上的一个转折点,由 func_train(en)NPC(en) 使用。 可以串联起来形成复杂的路线。要创建一条path_corner链,只需Shift+拖动一个已有的path_corner。其属性会被自动填充。要手动创建转折路径(或将其连接成一个圆圈),请手动编辑Next stop target 属性。

NPC们

path_corner可以是NPC的目的地。当收到指示时,NPC会停止其他移动行为,径直朝path_corner走去。这完全是脚本化的行为。注意, Train Speedwait 属性不影响NPC。

要让NPC移动到某个指定path_corner,可以编辑 Target Path Corner 键值,无论是Hammer还是 I/O 系统(en)

也推荐使用 aiscripted_schedule(en)scripted_sequence(en) 实体。

  • 另见 突袭(en) ,这是一种无需path_corner即可创建NPC路线的替代方式。

限制与漏洞

  • 每个path_corner(或路径上的第一个path_corner)必须在576单位以内,NPC才能找到它。
  • 当NPC到达路径的转角处时,如果要告诉他们该面向哪个方向,要么很难,要么不可能。如果这很重要,你可能得考虑用 突袭(en) 替代。

示例

请注意,示例地图没有任何 info_node(en)。因为不需要NPC跟着普通路径走。

键值

Name(en) (targetname) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见: 所有实体均可使用的 通用键值、输入与输出(en)
Next stop target(下一个路径点) (target) <字符串(en)>
Wait here (secs)(等待x秒) (wait) <浮点型(en)>
New train speed(新的行驶速度) (speed) <浮点型(en)>
保持在0时速度不变

标签

等待重启 : [1]
传送到这个 path_corner : [2]

输入

SetNextPathCorner <target_destination>
设置目标 path_corner
InPass  不存在于FGD!
Called internally by game

输出

OnPass
!activator = activator of the InPass input, usually the train
!caller = InPass caller of the InPass input, usually the train
Fires when a path follower passes this point.

FGD 代码

The path_corner entity is not in defined the base.fgd that all games share. It only exists in the halflife2.fgd.
You may copy the FGD entry from the expand box below to the bottom of your base.fgd to make it appear in Hammer Hammer.

FGD entry from halflife2.fgd 
@PointClass base(Targetname, Angles) size(16 16 16) line(255 255 255, targetname, target) color(247 181 82) = path_corner : "Generic path point"
[
	spawnflags(Flags) =
	[
		1: "Wait for retrigger" : 0
		2: "Teleport to THIS path_corner" : 0
	]
	target(target_destination) : "Next stop target"
	wait(integer) : "Wait here (secs)" : 0
	speed(integer) : "New Train Speed" : 0
	yaw_speed(integer) : "New Train rot. Speed" : 0

	// Inputs 
	input SetNextPathCorner(string) : "Sets next pathcorner"

	// Outputs
	output OnPass(void) : "Fires when a path follower passes this point"
]

参见