Blowout Doors: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(removed pov + formatting)
 
(23 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===
In order to transform the door to a physically simulated version, the {{ent|phys_convert}} entity is used.


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>


This tutorial is very very simple...
===The Explosion===
First make your door, it can be any kind of door.
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]]


[[Func_door_rotating]]
===Triggering the Effect===


[[Func_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:


[[Prop_door_rotating]]
:{| border=1 cellpadding="2" cellspacing="1"
 
|- align=left style="background:#DCDCDC; color:black"
Once your door is done, make sure to make a door frame around it
!
Making a door friend is simple, select your door, and then, create a brush by the topview of the hammer, the brush will automatically take the scale of the last object you selected, in this case, the door.
! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once
 
|-
Make a very thin brush on the right side, then on the left side and then up.
| [[File:Io11.png]] || OnTrigger || door_converter || ConvertTarget || &nbsp; || 0 || No
If you want to detail your frame, you can add in front of all, a even thinner frame, which makes like the place for the door to close, it can look really nice.
|-
 
| [[File:Io11.png]] || OnTrigger || door_explosion || Explode || &nbsp; || 0.05 || No
Do not forget to select all parts and [[func_detail]] your door frame, or else vvis will take hours to compile it.
|}
 
If you want your frame not to have any collisions, it is our case here, make it a [[func_brush]], and in the Solid proprieties, put
 
NeverSolid
 
Then you have your door, your doorframe.
Now lets make the transformation.
 
== Transformation ==
 
Here, we are going to place a [[phys_convert]] in the map
 
Name : DoorConverter
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.
 
 
== The Explosion ==
 
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.


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}}).


[[Category:Physics]]
[[Category:Level Design]]
[[Category:Level Design]]
[[Category:Tutorial]]
[[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).