Zh/Generic Keyvalues, Inputs and Outputs/Inputs: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== 输入 == {{I|{{L|AddOutput}}|为实体添加新的键值/输出。某些键值需要额外代码支持,仅通过此输入修改可能无效。<br/>格式:<code><键名> <值></code><br/>格式:<code><输出名称> <目标实体>:<输入名称>:<参数>:<延迟>:<最大触发次数(-1表示无限)></code>|param=string}} {{I|{{L|Kill}}|从场景中移除该实体及其所有子实体。}} {{I|FireUser1|to=FireUser4 |param=string|触发对应的<code>OnUser</...") |
Tag: Reverted |
||
Line 16: | Line 16: | ||
{{I|RunScriptFile|param=script|执行磁盘上的{{L|VScript}}文件(不含扩展名)。脚本内容会合并到接收实体的脚本作用域。|since={{l4d2}}|also={{tf2branch}}}} | {{I|RunScriptFile|param=script|执行磁盘上的{{L|VScript}}文件(不含扩展名)。脚本内容会合并到接收实体的脚本作用域。|since={{l4d2}}|also={{tf2branch}}}} | ||
{{I|RunScriptCode|param=string|在接收实体的作用域中执行VScript代码。可使用<code>activator</code>、<code>caller</code>、<code>self</code>变量(同<tt>RunScriptFile</tt>)。 | {{I|RunScriptCode|param=string|在接收实体的作用域中执行VScript代码。可使用<code>activator</code>、<code>caller</code>、<code>self</code>变量(同<tt>RunScriptFile</tt>)。 | ||
:{{Hammer quote warning}} | :{{Zh/Hammer quote warning}} | ||
:{{tip|1=在{{tf2branch}}中反引号{{code2|`}}会被转为引号{{code2|"}}。如需字符串建议使用<tt>RunScriptFile</tt>或{{L|Entity Scripts|实体脚本}}。}} | :{{tip|1=在{{tf2branch}}中反引号{{code2|`}}会被转为引号{{code2|"}}。如需字符串建议使用<tt>RunScriptFile</tt>或{{L|Entity Scripts|实体脚本}}。}} | ||
:{{bug|hidetested=1|在无脚本作用域的实体上使用此输入访问<code>activator</code>或<code>caller</code>会导致错误。{{tf2branch|2}}已修复此问题。}} | :{{bug|hidetested=1|在无脚本作用域的实体上使用此输入访问<code>activator</code>或<code>caller</code>会导致错误。{{tf2branch|2}}已修复此问题。}} |
Revision as of 22:09, 28 June 2025
输入
- AddOutput <字符串 >
- 为实体添加新的键值/输出。某些键值需要额外代码支持,仅通过此输入修改可能无效。
格式:<键名> <值>
格式:<输出名称> <目标实体>:<输入名称>:<参数>:<延迟>:<最大触发次数(-1表示无限)>
- Kill
- 从场景中移除该实体及其所有子实体。
- FireUser1 to FireUser4 <字符串 >
- 触发对应的
OnUser
输出;参见用户输入与输出 。 警告:此输入会接收但不处理字符串参数。若从可能发送值的输出触发此输入会导致问题,请确保指定虚拟字符串参数,否则控制台会报"错误的输入/输出链接"错误。
父子关系
- SetParent <目标名 >
- 支持!activator但不支持!caller
使实体跟随目标实体移动。参见实体层级(父子关系) 。
- SetParentAttachmentMaintainOffset <字符串 >
- 功能同上,但保持当前位置偏移。
- ClearParent
- 将实体从移动层级中移除,使其可独立移动。
- KillHierarchy
- 功能与
Kill
相同,但会同时移除所有子实体,执行效率略高。
VScript
- RunScriptCode <字符串 > (存在于自
以来) (也存在于
之中)
- 在接收实体的作用域中执行VScript代码。可使用
activator
、caller
、self
变量(同RunScriptFile)。 警告:在Hammer对象属性对话框 的任何文本字段中使用引号符号
"
会导致VMF 文件损坏,必须通过文本编辑器直接编辑VMF文件并删除额外添加的引号符号才能修复。提示:在
中反引号`会被转为引号"。如需字符串建议使用RunScriptFile或实体脚本 。
错误:在无脚本作用域的实体上使用此输入访问
activator
或caller
会导致错误。军团要塞2分支已修复此问题。
- TerminateScriptScope (仅存在于
之中) 不存在于FGD!
- 销毁接收实体的脚本作用域。
上下文
- ClearContext
- 清除实体的所有上下文。
警告:除非调试需要,否则不建议使用此输入,特别是对玩家实体,可能清除VScript模块存储的重要数据。
- RemoveContext <字符串 >
- 移除指定的上下文。
渲染
RenderFields:
- Alpha <整数 0-255 >
- Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its
rendermode
set to a number other than0
.
- Color <color255 >
- Sets an RGB color for the entity.
Shadow:
- DisableShadow
- Turn dynamic shadows off for this entity. Identical to applying EF_NOSHADOW.
- EnableShadow
- Turn dynamic shadows on for this entity.
- DisableReceivingFlashlight (存在于自
以来)
- This object will not receive light or shadows from projected textures.
- EnableReceivingFlashlight (存在于自
以来)
- This object may receive light or shadows from projected textures.
其他
|