Template:I BaseEntity:zh-cn
This template is our holder for all inputs assigned through CBaseEntity. The template has a very specific syntax that you must follow to apply properly, because new games have added new features throughout the years. See Help:Templates for more info on named parameters.
{{I BaseEntity}}
No parameters: display inputs for ALL games.
{{I BaseEntity|base=1}}
Base: display inputs that have only existed since whatever game added the class (most have existed since HL2, the first Source game).
{{I BaseEntity|l4d2=1}}
Game as a parameter: display the inputs that base
displays, AND inputs that were added to the class, by the specified game. You can specify as many games as needed. You must specify ALL the games you want to include (e.g. l4d2
will not automatically include l4d
inputs as well).
All parameters for this template:
base
l4d2
portal2
prel4d
- (DEPRECATED 9/28/18: This parameter existed to hide DispatchEffect for games (ones before l4d) that did not have it. There's many cases of similar inputs and keyvalues that aren't in absolutely everything, and making similar parameters for all of those simply isn't worth the trouble, especially considering having to comb through every existing use of those templates. Parameter is totally removed from code and affects nothing.)

For full documentation on this family of templates, see FGD Template Prototype. Still confused on something? Ask for help before editing this template.

CBaseEntity
inputs are not covered here. See the talk page.基础:
- Kill
- 从这个世界中删除此实体。
- KillHierarchy
- 功能类似于
Kill
,尽管此实体与其父实体都被删除了,但比Kill
快一点。
- SetParent <string>
- 跟随此实体移动,详见Entity Hierarchy (parenting).
- SetParentAttachmentMaintainOffset <string>
- 同上,但不传送。实体接受到此输出后保留与父级的相对位置。
- ClearParent
- 取消绑定父实体,以至于此实体可以自由行动。
- AddOutput <string>
- 评估此实体的输出/键值(类似于增加输出给某实体)。
格式:<key/键> <value/值>
格式:<output name/输出名> <targetname/目标名>:<inputname/输入名>:<parameter/参数>:<delay/延迟>:<最大触发数,-1代表无限。>
- FireUser1 to FireUser4
- 触发
OnUser
输出; 详见 User Inputs and Outputs。
- AddContext <string>
- 添加到实体的response contexts/响应上下文列表。格式
<key/键>:<value/值>
.
- RemoveContext <string>
- 从实体列表删除一个上下文。名字应与现有上下文进行匹配。
- ClearContext <string>
- 删除实体的所有上下文。
- RunScriptFile <script> (in all games since
)
- 从硬盘执行一个VScript脚本文件,不带文件后缀名。会合并接收实体的脚本域。
- RunScriptCode <string> (in all games since
)
- (执行脚本代码。)执行一段接收实体域的脚本源代码。通过控制台触发,可能需要英文双引号。
Bug:在
中,该代码是触发输出的实体的脚本域中执行, 非 接受输入的实体。 [todo tested in ?]
Warning:切勿在此输入的元素内使用字符串!它将破坏VMF ,由嵌套引号引起!你必须用文本编辑器手动删除来修复!
- SetLocalOrigin <coordinates> (in all games since
) !FGD
- 将此实体设置到地图上某点。如果此实体是某实体父级,那么它的子级也会随着偏移。