Zh/Info ambient mob: Difference between revisions
< Zh
Jump to navigation
Jump to search
({{lang}} -> {{Language subpage}}) |
1416006136 (talk | contribs) m (updated used templates) |
||
Line 10: | Line 10: | ||
{{KV|Entity Scripts|scriptlist|在所有实体生成之后执行的VScript文件列表(用空格分隔文件名,无需填文件后缀名)。 脚本都在相同的脚本作用域内执行,之后加载的脚本将覆盖之前任何相同的变量和函数。}} | {{KV|Entity Scripts|scriptlist|在所有实体生成之后执行的VScript文件列表(用空格分隔文件名,无需填文件后缀名)。 脚本都在相同的脚本作用域内执行,之后加载的脚本将覆盖之前任何相同的变量和函数。}} | ||
{{KV|Script think function|string|填入一个实体脚本中的函数名,该函数将在脚本运行时每100毫秒(每秒十次)自动调用。 它可以用于创建计时器或模拟自主行为。 返回值(如果存在)将设置下一次调用的时间。}} | {{KV|Script think function|string|填入一个实体脚本中的函数名,该函数将在脚本运行时每100毫秒(每秒十次)自动调用。 它可以用于创建计时器或模拟自主行为。 返回值(如果存在)将设置下一次调用的时间。}} | ||
{{ | {{Note|尽量避免在此函数中使用复杂的运算操作,否则可能会导致性能问题。}} | ||
==Inputs(输入)== | ==Inputs(输入)== | ||
Line 24: | Line 24: | ||
{{KV|RunScriptCode|string|在接收输入的实体的作用域内执行一段VScript代码。游戏中用控制台触发时字符串可能要加上引号。}} | {{KV|RunScriptCode|string|在接收输入的实体的作用域内执行一段VScript代码。游戏中用控制台触发时字符串可能要加上引号。}} | ||
{{Bug|在求生之路2中,代码在触发输出的实体的脚本作用域内执行,而不是接收输入的实体。}} | {{Bug|在求生之路2中,代码在触发输出的实体的脚本作用域内执行,而不是接收输入的实体。}} | ||
{{ | {{Warning|不要尝试使用此输入将字符串参数传递给脚本函数,这会因为嵌套的引号而损坏VMF文件的结构。如果真的损坏的话,只能用文本编辑器手动删除引号。}} | ||
{{KV|CallScriptFunction|string|在接收输入的实体的作用域内执行VScript函数。}} | {{KV|CallScriptFunction|string|在接收输入的实体的作用域内执行VScript函数。}} | ||
{{ | {{Note|部分游戏的FGD文件内未写有该输入。}} | ||
==Outputs(输出)== | ==Outputs(输出)== |
Revision as of 07:13, 26 November 2023
info_ambient_mob 是求生之路2中的一个点实体。 它是一个一般的环境尸潮 开始/结束(谨慎使用!)。
待完善: 尚未了解它在游戏中的用法
Keyvalues(键值)
- Entity Scripts ([todo internal name (i)]) <脚本列表 >
- 在所有实体生成之后执行的VScript文件列表(用空格分隔文件名,无需填文件后缀名)。 脚本都在相同的脚本作用域内执行,之后加载的脚本将覆盖之前任何相同的变量和函数。
- Script think function ([todo internal name (i)]) <字符串 >
- 填入一个实体脚本中的函数名,该函数将在脚本运行时每100毫秒(每秒十次)自动调用。 它可以用于创建计时器或模拟自主行为。 返回值(如果存在)将设置下一次调用的时间。

Inputs(输入)
- Kill
- 移除这个实体。
- KillHierarchy
- 移除这个实体和它所有的子体。
- AddOutput ([todo internal name (i)]) <字符串 >
- 为这个实体添加一个键值或输出,该输入使用不当很容易出错,请谨慎使用。
- 添加键值格式:<键> <值>
- 添加输出格式:<输出> <目标名>:<输入>:<参数>:<延迟>:<触发次数,-1为无限>
- FireUser1 到 FireUser4
- 触发OnUser输出,详情请参阅Inputs and Outputs。
- Use
- 与玩家调用+use相同。输入后可能不会有任何反应。也可以通过创建一个不指定输入的输出来调用它。
- Valve官方的FGD中未写有该输入。



Outputs(输出)
- OnUser1 到 OnUser4
- 分别在输入FireUser1到FireUser4时触发,详情请参阅Inputs and Outputs。
- OnKilled
- 在实体被移除时触发。
在官方地图中的使用例子
以下地图使用了info_ambient_mob,但没有为它命名。
- c5m2_park
- Located in a secluded area behind the building right after exiting the safe room. It is the area furthest from the bar that has a dynamic pathway in c5m1_waterfront.
- An area of concrete fences unreachable, between the gazebo and the narrow pathway leading to the queuing/quarantine area.
- Facing in the direction of the escape route, way behind the quarantine/queuing area before the gauntlet event. Behind concrete barriers and fences by the weapon spawns along the highway path.
- Behind concrete barriers left of the stairs leading to the park entrance.
- In narrow alleyway from the previous map, right of the building when entering the safe room in c5m1_waterfront.
- In flow towards park, it is in the park to the far left where it is unreachable to survivors. It is square space consisting of walls made out of bush props.
- Right by the park bushes (number 6, above), but unreachable and surrounded by concrete walls.