Blowout Doors: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(removed pov + formatting)
 
(21 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{cleanup}}
{{languageBar}}


== Introduction ==
This tutorial details how to create a normal door which, when triggered, becomes a physical object and is blown out from the door frame.


This tutorial will detail how to create a door, which can be toggled open or closed, and will also detail how to make the door become a physics object. This is useful for when you require a simple door to be blown down, most likely for a scripted sequence which involves NPCs.
==Construction==
===The Door===
[[File:Blowout1.jpg|thumb|200px|right|Fig. 1]]
[[File:Blowout2.jpg|thumb|200px|right|Fig. 2]]
# Create a door as needed. See [[Doors]].
# Once the door has been created, build a door frame. To do this, use three brushes to create an outline of the door. For ideal performance, use [[vertex manipulation]] to slot the pieces of the frame together, as in fig. 1.
:{{note|This will either have a very negligible or no performance benefit, it is safe to ignore this instruction.}}
# Once the frame is complete, select all the pieces, press {{key|Ctrl|T}} to tie them to an entity, and select {{ent|func_brush}} from the list. Then select ''Never Solid'' in the <code>Solidity</code> field. The door and its frame should now be exactly like in fig. 2.


== The Door ==
===Transformation===
[[Image:Blowout1.jpg|thumb|200px|right|Fig. 1]]
In order to transform the door to a physically simulated version, the {{ent|phys_convert}} entity is used.
[[Image:Blowout2.jpg|thumb|200px|right|Fig. 2]]
# Create your door as needed. See [[Creating Doors]].
# Once you have created your door, you will need to create a door frame. To do this, use three brushes to create an outline of your door. For ideal performance, you should use [[vertex manipulation]] to slot the pieces of the frame together, as in fig. 1.
# Once your frame is complete, select all the pieces, press '''Ctrl + T''' to tie them to an entity, and select <code>[[func_detail]]</code> from the list. You should now have a door and a frame as in fig. 2.
# If you'd prefer your frame not have any collisions, you can change the entity to a <code>[[func_brush]]</code> and select ''Not Solid'' in the <code>Solidity</code> field.


== Transformation ==
Place this entity near to the door and set the following values:
* <code>Name</code>: <code>door_converter</code>
* <code>Entity to convert</code>: <code>door</code>


Here, we are going to place a [[phys_convert]] in the map
===The Explosion===
To create the 'blowout' effect, two explosion entities need to be created. To do so, follow these steps:
# Place an {{ent|env_explosion}} entity on whichever side the door should be blown from. If it is placed behind the door, the door will blow towards the player. Name this entity <code>door_explosion</code>.
# To create the movement of the door, place an {{ent|env_physexplosion}} entity in the same place as the {{ent|env_explosion}}. This entity should also be named <code>door_explosion</code>.
:{{tip|The arrows and shift key can be used together to duplicate an entity in the exact same position as another one.}}
# The setup should now be similar to the setup in fig. 3.
[[File:Blowout3.jpg|thumb|200px|right|Fig. 3]]


Name : DoorConverter
===Triggering the Effect===
Entity to convert: Door


The [[phys_convert]] entity, is an entity that can convert any other into a physic entity, in that case the door.
Place a {{ent|logic_relay}} entity near to the door and name it <code>relay_door_blow</code>. Check the "Only trigger once" flag in the '''Flags''' tab. Switch to the '''Outputs''' tab and add two new records:


:{| border=1 cellpadding="2" cellspacing="1"
|- align=left style="background:#DCDCDC; color:black"
!
! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once
|-
| [[File:Io11.png]] || OnTrigger || door_converter || ConvertTarget || &nbsp; || 0 || No
|-
| [[File:Io11.png]] || OnTrigger || door_explosion || Explode || &nbsp; || 0.05 || No
|}


== The Explosion ==
To trigger the effect, trigger <code>relay_door_blow</code>, preferably with an entity that can only trigger once (e.g. with a {{ent|trigger_once}}).
 
This part is in case you want the door to explode
 
Simply put an [[env_explosion]] in the other side you want to door to blow at.
For example, if you want your door to blow and fly to the east, put the [[env_explosion]] to the west, if you want it to blow to the west, put the [[env_explosion]] to the east...ect...
 
Now, the [[env_explosion]] is just the visible part for the explosion, but if you really want your door to FLY you must put an [[env_physexplosion]]
 
This entity is like an [[env_explosion]] but its more for physics, and it does not has a physical explosion.
 
So put it near the [[env_explosion]]
 
Name : DoorPhysExplosion
Magnitude : Depends on the size of the door
Clamp Radius : This is the radius at which the physexplosion touches the physics, if you don't want all the physics near the door moving and killing your fps, then put the radius only so it includes the door.
 
== The Trigger ==
 
Now, put a [[logic_relay]] in your map
 
Name: RelayDoorBlow
 
In the outputs
 
OnTrigger : DoorPhysExplosion      Explode    Delay 0
 
OnTrigger : DoorExplosion          Explode    Delay 0
 
Now all you have to do so your door explodes, is to trigger the [[logic_relay]] RelayDoorblows and your done!
 
If you want more, put a [[func_smokevolume]] for smoke
 
Here is how to use the smokevolume :
 
 
== The Smoke==
 
Put a brush with trigger texture on it as big as you want your smoke to be, and tie it to [[func_smokevolume]], change the color to the color you want for your smoke, and put the density to 0
 
Now, to make you smoke appear, simply put :
 
SmokeVolume        SetDensity 1
 
And you'll have your smoke.
 


[[Category:Physics]]
[[Category:Level Design]]
[[Category:Level Design]]
[[Category:Level Design Tutorials]]
[[Category:Tutorials]]

Latest revision as of 16:26, 22 May 2025

English (en)Translate (Translate)

This tutorial details how to create a normal door which, when triggered, becomes a physical object and is blown out from the door frame.

Construction

The Door

Fig. 1
Fig. 2
  1. Create a door as needed. See Doors.
  2. Once the door has been created, build a door frame. To do this, use three brushes to create an outline of the door. For ideal performance, use vertex manipulation to slot the pieces of the frame together, as in fig. 1.
Note.pngNote:This will either have a very negligible or no performance benefit, it is safe to ignore this instruction.
  1. Once the frame is complete, select all the pieces, press Ctrl+T to tie them to an entity, and select func_brush from the list. Then select Never Solid in the Solidity field. The door and its frame should now be exactly like in fig. 2.

Transformation

In order to transform the door to a physically simulated version, the phys_convert entity is used.

Place this entity near to the door and set the following values:

  • Name: door_converter
  • Entity to convert: door

The Explosion

To create the 'blowout' effect, two explosion entities need to be created. To do so, follow these steps:

  1. Place an env_explosion entity on whichever side the door should be blown from. If it is placed behind the door, the door will blow towards the player. Name this entity door_explosion.
  2. To create the movement of the door, place an env_physexplosion entity in the same place as the env_explosion. This entity should also be named door_explosion.
Tip.pngTip:The arrows and shift key can be used together to duplicate an entity in the exact same position as another one.
  1. The setup should now be similar to the setup in fig. 3.
Fig. 3

Triggering the Effect

Place a logic_relay entity near to the door and name it relay_door_blow. Check the "Only trigger once" flag in the Flags tab. Switch to the Outputs tab and add two new records:

My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger door_converter ConvertTarget   0 No
Io11.png OnTrigger door_explosion Explode   0.05 No

To trigger the effect, trigger relay_door_blow, preferably with an entity that can only trigger once (e.g. with a trigger_once).