User:Nescius/sandbox/test20

From Valve Developer Community
< User:Nescius
Revision as of 11:41, 26 September 2024 by Nescius (talk | contribs)
Jump to navigation Jump to search

Keyvalues

Collisions (solid) <choices>
该实体的碰撞方式。
Name (targetname) <string>
其他实体用来指代该实体的名称。
Parent (parentname) <targetname>
实体的父级实体,该实体可以与父实体保持移动偏移。名称后面可以添加一个附属点,以逗号隔开。 (parentname [targetname],[attachment]
Tip.pngTip:转换至下一张地图的实体关系会依然存在。
Tip.pngTip:一些不适合做父实体的实体可能难以运行,利用phys_constraint可以解决。
Origin (X Y Z) (origin) <coordinates>
实体处于世界中的位置,旋转实体会以实体坐标原点旋转。
Note.pngNote:Hammer 不会仅在编辑器中相应地移动实体。
Pitch Yaw Roll (Y Z X) (angles) <angle>
实体在世界中的方位,Pitch围绕X轴旋转,可以称为俯仰角。Yaw围绕Z轴旋转,可以称为偏航角,roll围绕Y轴旋转。
Note.pngNote:尽管 Hammer 不显示新角度,但其仍然适用于固实体。
Classname (classname) <string> !FGD
确定实体之前它生成的特征。
Tip.pngTip:使用AddOutput输入更改 Classname 仍然会影响游戏的代码,例如使类名与 S_PreserveEnts 列表中的一个元素匹配将使实体在新一轮中持续存在!
Spawnflags (spawnflags) <flags> !FGD
实体所具有的标志/标签,依实体所具有而定。
Effects (effects) <flags> !FGD
要使用的效果标志的组合。
Entity Scripts (vscripts) <scriptlist> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
在所有实体生成后执行的 VScript
Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|zh}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.

文件(无文件扩展名)的空格分隔列表。这些脚本都在同一个脚本范围内执行,以后的脚本会覆盖任何相同的变量和函数。在 worldspawn 实体上执行的脚本将放置在根作用域中。

Think function (thinkfunction) <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
此实体脚本中的函数名称,该函数将在脚本持续时间内每 100 毫秒(每秒 10 次)自动调用一次。它可用于创建计时器或模拟自主行为。返回值(如果存在)将设置下一次调用之前的时间。尽量避免在此函数中进行昂贵的操作,因为它可能会导致性能问题。
Lag Compensation (LagCompensate) <boolean> (in all games since Left 4 Dead 2) !FGD
设置为以延迟补偿此实体。应该非常谨慎地使用!
Is Automatic-Aim Target (is_autoaim_target) <boolean> (in all games since Counter-Strike: Global Offensive) !FGD
如果设置为 1,当实体位于十字准线下方时,该实体将减慢控制台和操纵杆控制器的瞄准移动速度。


Inputs

AddContext <string>
将此实体添加到响应上下文列表中。参见 上下文
AddOutput <string>
为此实体分配一个新的键值/输出。对于键值,有些依赖于额外的代码,不能仅通过此输入进行更改。必须遵循严格的格式: {| class="mw-collapsible mw-collapsed" style="background:rgba(0,0,0,0.05) ;float:no;margin-bottom:1em;margin-left:0;padding-right:0.5em;border:1px solid rgba(255,255,255,0.1); border-left:solid 1px #8bb9e0; padding-left:1em;"

|+ style="text-align:left; white-space:nowrap; font-weight:bold; color:#ddd; " |

|

// 更改键值的格式 "AddOutput [键] [值]"
//// 原始文本
"OnUser1" "!self,AddOutput,targetname new_name"

// 添加输出的格式 "AddOutput {目标名称}:{输入名称}:{参数}:{延迟}:{最大触发次数,-1 代表无限}"
//// 原始文本
"OnUser1" "!self,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
// 参数可以留空但仍应包含空的空白
//// 原始文本
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"

|}

ClearContext
从此实体的列表中移除所有上下文。
ClearParent
从运动层次结构中移除此实体,使其可以独立移动。
FireUser1 to FireUser4
触发相应的OnUser输出;参见 User Inputs and Outputs
Kill
从世界中移除此实体及任何附属于它的实体。
KillHierarchy
功能与Kill相同,但此实体和任何附属于它的实体在同一帧内被击杀,比Kill输入稍快。
RemoveContext <string>
从此实体的列表中移除一个上下文。名称应与现有上下文的键匹配。
SetParent <string>
与此实体一起移动。参见 Entity Hierarchy (parenting)
SetParentAttachment <string>
将此实体更改为附加到其父级上的特定attachment点。实体将被传送,以便其根bone的位置与附件的位置匹配。实体必须在发送此输入之前被附加。
SetParentAttachmentMaintainOffset <string>
如上所述,但不进行传送。实体保留相对于附件的当前位置。
Use  !FGD
与玩家调用+use相同;在大多数情况下没有效果。
SetTeam <integer> !FGD
更改此实体的团队。
TeamNum <integer> !FGD
此输入更改TeamNum属性的值。
DispatchResponse <string> !FGD
向实体分发响应。参见 ResponseConcept
DispatchEffect <string> (removed since Left 4 Dead) !FGD
从实体的原点分发特殊效果;另见 List of Client Effects。自Left 4 Dead以来被particle系统取代。
RunScriptFile <script> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
从磁盘执行VScript文件,无需文件扩展名。脚本内容与接收实体的脚本作用域合并。
RunScriptCode <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
在接收输入的实体的作用域中执行一串VScript源代码。通过控制台触发时可能需要字符串引号。
CallScriptFunction <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2) !FGD
调用在接收实体的作用域中定义的VScript函数。
TerminateScriptScope  (only in Team Fortress 2) !FGD
销毁接收实体的脚本作用域。
SetLocalOrigin <coordinates> (in all games since Alien Swarm) !FGD
将此实体发送到地图中的某个位置。如果实体附属于某个东西,它将相对于父级偏移此量。
SetLocalAngles <angles> (in all games since Alien Swarm) !FGD
设置此实体的角度。

Outputs

OnUser1 to OnUser4
这些输出分别在相应编号的 FireUser1 到 FireUser4 输入触发时触发;参见 用户输入和输出(en)

OnKilled|only=Left 4 Dead|当实体被击杀并从游戏中移除时触发此输出。}}