func_train

From Valve Developer Community
< Zh
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
← Trains
Icon-callout-not-in-fgd.png
此实体默认不存在于FGD。
请参阅下面的内容以获取有关使其可用的说明。
C++ 类层级
CFuncTrain
↳CBasePlatTrain
↳CBaseToggle
↳CBaseEntity
C++ trains.cpp

func_train是实体笔刷,可在所有的 起源 起源 游戏中使用。

它是从 雷神之锤 雷神之锤 遗留下来的实体,在一系列 path_corner(en) 的起点和终点之间来回移动。与 func_tracktrain 不同,它在转弯时不会旋转。

Tip.png提示: 此实体不受 func_tracktrain 所遇到的转弯不精确问题的影响,使其成为快速移动物体的良好替代方案。
Icon-Bug.png错误:无论是否实际指定了音效,它总会尝试播放音效。可以将其设置为 Default.Null 并将音量设为 0 以不播放任何音效。  [todo tested in ?]
Tip.png提示: As brush entities are lit using static lightmaps, lighting on this entity may look weird when it moves from its original position. If this is an issue, consider converting the brushes to a prop, changing the brushes to clip or skip, and parenting the converted model to this entity.

Keyvalues

Note.png注意: For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs(en)
Name(en) (targetname) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentname 或 target) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见: 所有实体均可使用的 通用键值、输入与输出(en)
Pitch Yaw Roll (Y Z X) (angles) <QAngle(en)>
列车的初始方向。
Angular Velocity (Y Z X) (avelocity) <vec3(en)> 不存在于FGD!
缺省值: 0 0 0
Per-axis rotation speed while the train is moving. Use the same speed values as func_rotating.
Spawn path_corner (target) <target_destination>
列车路径中第一个 path_corner 的名称。列车将在此 path_corner 处生成。
Speed (speed) <浮点型(en)>
列车移动的速度。
Movement Sound (noise1) <sound(en)>
The sound to play when the train moves.
Stop Sound (noise2) <sound(en)>
The sound to play when the train stops moving.
Move Sound index (movesnd) <integer choices(en)> (仅存在于 半衰期:起源半衰期死亡竞赛:起源 之中)
The sound to play when the train moves. Overrides noise1, even if absent.
Choices
  • 0: Plat.DefaultMoving
  • 1: Plat.BigElev1
  • 2: Plat.BigElev2
  • 3: Plat.TechElev1
  • 4: Plat.TechElev2
  • 5: Plat.TechElev3
  • 6: Plat.FreightElev1
  • 7: Plat.FreightElev2
  • 8: Plat.HeavyElev
  • 9: Plat.RackElev
  • 10: Plat.RailElev
  • 11: Plat.SqueakElev
  • 12: Plat.OddElev1
  • 13: Plat.OddElev2
Stop Sound index (movesnd) <integer choices(en)> (仅存在于 半衰期:起源半衰期死亡竞赛:起源 之中)
The sound to play when the train stops moving. Overrides noise2, even if absent.
Choices
  • 0: Plat.DefaultArrive
  • 1: Plat.BigElevStop1
  • 2: Plat.BigElevStop2
  • 3: Plat.FreightElevStop
  • 4: Plat.HeavyElevStop
  • 5: Plat.RackStop
  • 6: Plat.RailStop
  • 7: Plat.SqueakStop
  • 8: Plat.QuickStop
Sound Volume 0.0 - 1.0 (volume) <normal(en)>
Sound volume
Crush Damage (dmg) <浮点型(en)>
对阻挡列车的实体造成的伤害量。

Flags

Wait to retrigger(等待重新触发,由游戏代码设置和取消;不应手动设置) : [1]
Non-solid(非固体) : [8]

Inputs

Toggle
切换移动
Start
开始移动
Stop
停止移动


FGD 代码

@SolidClass base(Targetname, Origin, Angles, RenderFields) line(255 255 0, targetname, target) = func_train: "An old entity leftover from Quake. It follows a series of path_corner entities."
[
	spawnflags(flags) =
	[
		8 : "Non-solid" : 0
	]
	target(target_destination) : "Spawn path_corner" : : "The name of the first path_corner in the train's path. The train will spawn at this path_corner."
	speed(float) : "Speed" : "50" : "Speed at which the train moves."
	avelocity(vector) : "Angular Velocity (Y Z X)" : "0 0 0" : "Per-axis rotation speed of the train while it moves."
	noise1(sound) : "Movement Sound" : "Default.Null" : "The sound to play when the train moves. This must be specified, but can be set to 'Default.Null' to play no sound."
	noise2(sound) : "Stop Sound" : "Default.Null" : "The sound to play when the train stops moving. This must be specified, but can be set to 'Default.Null' to play no sound."
	volume(float) : "Sound volume (0-10)" : "10" : "Volume of the sounds emitted when moving and stopping."
	dmg(float) : "Crush Damage" : "0" : "Amount of damage to deal to entities blocking the train."

	// Inputs
	input Toggle(void) : "Toggle movement"
	input Start(void) : "Start movement"
	input Stop(void) : "Stop movement"
]