Explosive Cube: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{LanguageBar}}
{{Stub}}
==Creation==
==Creation==
This assumes you have a level to put the cube in. First, make sure you have downloaded [http://forums.thinkingwithportals.com/downloads.php?view=detail&df_id=1123|these files], which are needed for creation. If you do not have these files installed, you can continue using a normal cube, but it may mislead the player.
This assumes you have a level to put the cube in. If you do not, the basics of designing level are taught [[Level_Design_Introduction_(Portal_2)/Getting_Started|here]]. First, make sure you have downloaded [http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=1123|these files], which are needed for creation. If you do not have these files installed, you can continue using a normal cube, but it may mislead the player into believing that it is only a normal cube.


1. Create a [[prop_physics]] with the following settings:
1. Create a [[prop_physics]] with the following settings:
Line 27: Line 30:


==Triggering the Cube==
==Triggering the Cube==
Triggering the cube is very simple. Choose what you want to trigger the cube, and create two outputs
Triggering the cube is very simple. Choose what you want to trigger the cube, and create three outputs. In this example, the input was a button:
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[File:Io11.png]] || OnPressed || exploding_cube || Skin || 1 || 0.00 || No
|-
| [[File:Io11.png]] || OnPressed || exploding_cube || Break || none || 5.00 || No
|-
| [[File:Io11.png]] || OnPressed || exploding_cube_explosion || Explode || none || 5.00 || No
|-
|}
{{note|The delay from when the cube is primed to when it explodes does not have to be five. It can be any number you choose. Also, for added effect, you can create an [[ambient_generic]] that plays when the cube is primed.}}

Latest revision as of 07:17, 2 July 2025

English (en)中文 (zh)Translate (Translate)

Stub

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

Creation

This assumes you have a level to put the cube in. If you do not, the basics of designing level are taught here. First, make sure you have downloaded files, which are needed for creation. If you do not have these files installed, you can continue using a normal cube, but it may mislead the player into believing that it is only a normal cube.

1. Create a prop_physics with the following settings:

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

2. Create an env_explosion with these settings:

Property Name Value
Name explosive_cube_explosion
Parent explosive_cube

3. Place the env_explosion in the center of the cube.

Once that simple process is completed, the cube is ready.

Triggering the Cube

Triggering the cube is very simple. Choose what you want to trigger the cube, and create three outputs. In this example, the input was a button:

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.pngNote:The delay from when the cube is primed to when it explodes does not have to be five. It can be any number you choose. Also, for added effect, you can create an ambient_generic that plays when the cube is primed.