爆炸方块

From Valve Developer Community
< Zh
Revision as of 07:21, 2 July 2025 by WoShiGeNiCheng (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)

小作品

This article or section is a stub. You can help by expanding it.

创建方法

假设你已经有一个可以放置爆炸立方体的测试关卡。如果没有,可以参考这里(en)学习基础的关卡设计。

准备工作:

确保你已经下载了这些必要文件。如果没有安装这些文件,你仍然可以使用普通立方体,但这可能会让玩家误以为它只是一个普通道具。

步骤: 1.创建一个 prop_physics 实体,并设置以下参数:

Property Name Value
Name explosive_cube
World Model models\explosivebox\metal_box.mdl

2.创建一个 env_explosion 实体,并设置以下参数:

Property Name Value
Name explosive_cube_explosion
Parent explosive_cube

3.将 env_explosion 放置在立方体的中心位置。

完成以上步骤后,爆炸立方体就准备好了。

触发爆炸立方体

触发爆炸立方体非常简单。选择你想要用来触发立方体的对象(例如按钮),并设置以下三个输出(以按钮为例):

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnPressed exploding_cube Skin 1 0.00 No
Io11.png OnPressed exploding_cube Break none 5.00 No
Io11.png OnPressed exploding_cube_explosion Explode none 5.00 No
Note.png注意:从激活立方体到爆炸的延迟时间不一定是 5 秒,你可以自定义这个数值。此外,为了增强效果,你可以在立方体被激活时播放一个 ambient_generic 音效。