这篇条目有关 Source引擎。如需详情,点击这里。

Zh/Ent fire: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{LanguageBar|ent_fire|title=ent_fire命令}} {{This is a|控制台命令|name=ent_fire}} 该命令用于触发实体的{{L|Inputs and Outputs|输入}},是程序员和地图制作者调试实体逻辑的核心工具。 {{warning|多人游戏中仅服务器/监听服务器主机可使用ent_fire}} {{note|在{{L|tf2}}等游戏中需改用{{code|script EntFire()}}命令: {{example|{{code|script EntFire("player", "SetHealth", "1", 5.0)}}}} == 使用方法 == {{pre|ent_...")
 
No edit summary
 
Line 5: Line 5:
{{warning|多人游戏中仅服务器/监听服务器主机可使用ent_fire}}
{{warning|多人游戏中仅服务器/监听服务器主机可使用ent_fire}}
{{note|在{{L|tf2}}等游戏中需改用{{code|script EntFire()}}命令:
{{note|在{{L|tf2}}等游戏中需改用{{code|script EntFire()}}命令:
{{example|{{code|script EntFire("player", "SetHealth", "1", 5.0)}}}}
{{example|{{code|script EntFire("player", "SetHealth", "1", 5.0)}}}}}}


== 使用方法 ==
== 使用方法 ==

Latest revision as of 00:11, 27 June 2025

English (en)Русский (ru)中文 (zh)Translate (Translate)

ent_fire是一个控制台命令,可在所有的 起源 起源 游戏中使用。 该命令用于触发实体的输入(en),是程序员和地图制作者调试实体逻辑的核心工具。

Warning.png警告:多人游戏中仅服务器/监听服务器主机可使用ent_fire
Note.png注意:tf2(en)等游戏中需改用script EntFire()命令:
PlacementTip.png示例:script EntFire("player", "SetHealth", "1", 5.0)

使用方法

ent_fire <类名/目标名/通配符> <输入名> <参数> <延迟>
  • 对匹配的实体触发指定输入
  • 可覆盖参数和延迟时间(秒)
  • 未指定输入时默认触发Use输入
Tip.png提示:控制台输入时会自动补全目标名和输入名
Note.png注意:The targetname/classname parameter supports wildcard but anything after the wildcard is ignored. For example, ent_fire zapperpod*_train kill will kill any 实体 whose targetname/classname starts with zapperpod no matter what text follows after wildcard.


{{bug|hidetested=1|延迟参数仅支持整数(小数部分会被忽略)

PlacementTip.png解决方案:通过AddOutput(en)设置延迟:
ent_fire crab AddOutput "OnUser1 !self:Unburrow::0:1"
ent_fire crab FireUser1

示例

ent_fire relay_start_assault Trigger

触发所有logic_relay(en)实体

ent_fire npc_barney SetHealth 5

设置NPC生命值为5

ent_fire !picker(en) Kill

删除准星指向的实体
Warning.png警告:对玩家或worldspawn(en)使用会导致崩溃

ent_fire counter_* Add 1

为所有math_counter(en)加1

ent_fire player IgniteLifeTime 5

点燃玩家5秒(需作弊模式)

ent_fire box addoutput "targetname crate"

修改实体名称

参见