Box dropper: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Removed skill level)
 
(36 intermediate revisions by 13 users not shown)
Line 1: Line 1:
In this tutorial, the procedure of creating a box dropping device will be shown. The box dropping device will create a new box whenever the old one is destroyed.
{{LanguageBar|title = Portal - Tutorial - Box Dropper}}


== Creating the device ==
In this part, the design, the looks of the dropper will be created.
[[Image:Tutbd models.jpg|right|thumb|150px]]


=== Step 1 ===
{{Back | Portal Level Creation}}
For creating the tube for the standard box dropper, props will be used, which will eventually form a box transportation tube.
{{toc-right}}
 
This tutorial will show step-by-step how to create the '''box dropper''', or '''vital apparatus vent''', seen throughout the [[Portal]] test chambers. The box droppers can be used to give the player a new weighted storage cube whenever their previous one is destroyed.


Create two '''[[prop_dynamic]]'''s. The first one's world model is <code>models/props/box_dropper.mdl</code>. Set the second one's name to <code>box_dropper_cover</code> and set its world model to <code>models/props/box_dropper_cover.mdl</code>. Now, move the two models so that the second one is at the bottom of the first one. Refer to the screenshot for placement picture.
{{clr}}
{{clr}}
[[image:Tutbd drop.jpg|right|thumb|150px]]


=== Step 2 ===
== Construction ==
{{note|This step is optional. You may change most of the textures mentioned in this step - they are only used as an example.}}
=== Dropper model ===
First, 8 brushes which form a cube of the size '''128x128x16''' with an about '''88x88x16''' size 8-sided cylinder shaped hole in the middle. These sizes are optimized for the size of the tube prop and the cube. This is going to be a part of the ceiling of your room and where the cube enters the room.
[[File:Box dropper models.jpg|right|thumb|300px|The models]]


Create a <code>[[prop_dynamic]]</code>, set its model to <code>models/props/box_dropper.mdl</code>.


[[image:Tutbd bouncers.jpg|right|thumb|150px|Helping the cube down.]]
Create a <code>prop_dynamic</code>, set its model to <code>models/props/box_dropper_cover.mdl</code> and name <code>box_dropper_model_cover</code>.  
Create 2 '''128x16x256''' and 2 '''16x128x256''' brushes and place them together on top of the previous brushes. Texture them exactly the same way except that the inner faces should have a the texture <code>metal/metalwall048c_gradient</code>. Shift these textures so that the orange ends are on the top and the black ends are on the bottom of the faces.


To seal this hole, create a '''128x128x16''' brush and place it on top of the corridor. The inner face's texture is <code>lights/light_orange001</code> and the outer faces' texture is <code>tools/nodraw</code>.<br />
Align the two entities so they are in the same place where the dropper should be in the map.
Additionally, you may want to place extra brushes textured with <code>tools/nodraw</code> on top of the bottom piece to ensure that the box will fall down into the tube. Make sure all these brushes are tied to a '''[[func_detail]]''' entity. Refer to picture 3.


Finally, place the two models which you created in the previous step so that the cube falls through the cylinder right into the tube.
{{clr}}
{{clr}}


== Creating the dropper ==
=== Ceiling Arch ===
In this part of the tutorial, the triggers behind the dropper are created.
 
{{note|This part of the tutorial assumes that you did not skip Step 2 of the last part.}}
Use the [[Hammer Arch Properties|arch tool]] to create a <code>128L*128W*16H</code> arch above the <code>prop_dynamic</code> entities with the following settings:
[[Image:Tutbd sealedroom.jpg|right|thumb|150px|The weighted companion cube in the sealed room.]]
{| class="standard-table sortable"
!  Property Name !! Value
|-
| Wall width || 24
|-
| Number of Sides || 8
|-
| Arc || 360
|-
| Start Angle || 0
|-
| Add Height || 0
|}
 
Tie this brush to a <code>[[func_detail]]</code> then use the [[Hammer Vertex Tool|vertex manipulation tool]] to move the corners of the arch so it resembles a rectangle with a hole in the middle. After that, texture the inner rim of the arch with <code>metal/metalwall061f</code>. Texture the underside of the arch with <code>concrete/concrete_modular_ceiling001a</code>.
 
<gallery>
Image:Box dropper arch.jpg|The arch
Image:Box dropper arch2.jpg|The arch after vertex manipulation
Image:Box dropper arch3.jpg|The arch textured
</gallery>
 
{{clr}}
 
=== Ceiling shaft ===
[[File:Box_dropper_shaft.jpg|right|thumb|300px|The shaft seen from the outside]]
[[File:Box_dropper_shaft2.jpg|right|thumb|300px|The inside of the shaft with nodraw hidden]]
 
Create a shaft using brushes above the dropper with the dimensions of <code>128L*128W*256H</code> and split the sides of the shaft in two equal pieces with the [[clipping tool]]. Then proceed to texture the lower inner walls with <code>metal/metalwall_bts_006a</code>, top inner walls with <code>metal/metalwall_bts_006b_gradient</code> and inner ceiling with <code>lights/light_orange001</code>.
 
{{clr}}
 
=== Box Template ===
Create a small <code>128L*128W*112H</code> room above the dropper shaft with [[nodraw]] textured brushes.
 
Next, create a <code>[[prop_physics]]</code> entity in the middle of this room and set its model to <code>models/props/metal_box.mdl</code> and name to <code>box</code>. Give it the following outputs:
{| {{OutputsTable}}
| [[File:Io21.png]] || OnOutOfWorld || !activator || Kill || &nbsp; || 0.00 || No
|-
| [[File:Io12.png]] || OnOutOfWorld || <span style="color:red">logic_drop_box</span>|| Trigger || &nbsp; || 0.00 || Yes
|}
 
Create a <code>[[point_template]]</code> in the middle of the <code>box</code> entity. Set its name to <code>box_template</code> and set its first template to <code>box</code>.
 
Create an <code>[[env_entity_maker]]</code> somewhere near the top of the shaft of the dropper. Set its name to <code>entity_box_maker</code> and set its ''Point_template to spawn'' to <code>box_template</code>.
 
Create a <code>[[filter_activator_name]]</code> entity somewhere in the map. Set its name to <code>filter_boxes</code> and set its ''Filter Name'' to <code>box</code>.
 
Create a <code>[[logic_auto]]</code> entity and enter the following output:
{| {{OutputsTable}}
| [[File:Io12.png]] || OnMapSpawn || <span style="color:red">entity_box_maker</span>|| ForceSpawn || &nbsp; || 0.00 || No
|}
 
 
=== Lid Brush ===
[[File:Box_dropper_stop_plugging.jpg|right|thumb|300px|<code>tube_stop_plugging</code>]]
 
Create a <code>96L*96W*4H</code> nodraw textured brush just below the lid of the dropper. Tie this brush to a <code>[[func_brush]]</code> entity. Set its name to <code>stop_tube_plugging</code> and set its ''Start Disabled'' keyvalue to ''Yes''.


=== Step 1 ===
{{clr}}
Create a sealed room separately from any other part of the world. This sealed room should be a cube sealed by six brushes with each face of each brush textured with <code>tools/nodraw</code>. Inside this sealed room, place a '''[[prop_physics]]''' with the name <code>template_box</code> and the world model <code>models/props/metal_box.mdl</code>. Additionally, you may change the '''Skin''' keyvalue of this prop to 1, in which case the cube will look like a weighted companion cube.


In this very same sealed room, create a '''[[point_template]]'''. Set the name field to <code>template_box_drop</code> and the Template 1 field to <code>template_box</code>. This entity will assist in creating a new box whenever required.
=== Lid Trigger ===
{{note|If you have multiple box droppers in your level, only need to create one [[prop_physics]] and one [[point_template]]. Just create more [[env_entity_maker]]s all spawning the same box.}}
[[File:Box_dropper_trigger.jpg|right|thumb|300px|<code>trigger_box_dropper_clear</code>]]


Create a <code>128L*128W*128H</code> [[Tool_textures#trigger|trigger]] textured brush around the box dropper models.


=== Step 2 ===
Tie this brush to a <code>[[trigger_multiple]]</code> and enter the following properties:
Place an '''[[env_entity_maker]]''' entity in the center of the long way down, about 48 units below the top piece. Set its name to <code>box_maker</code> and the '''Point_template to spawn''' field to <code>template_box_drop</code>. Hang in there. It's almost done.


The final piece of the puzzle which controls the whole mess and forms it into a box dropper. Create a '''[[logic_relay]]''' entity anywhere near the contraption and name it <code>logic_drop_box</code>. Add three outputs.
{| class=standard-table
{| class=standard-table
!Output named || Target entities || Via this input || Parameter || Delay
! Property Name || Value
|-
| Name || trigger_box_dropper_clear
|-
| Start Disabled || Yes
|-
|-
|OnTrigger || box_dropper_cover || SetAnimation || open || 0.00
| Filter Name || filter_boxes
|}
 
{{clr}}
 
Under Flags, modify the following:
 
{{entity-flag-start}}
{{entity-flag|Physics Objects|on|}}
{{entity-flag|Clients|off|}}
{{entity-flag-end}}
 
Now give it the following outputs:
{| {{OutputsTable}}
| [[File:Io11.png]] || OnEndTouch || entity_box_maker || ForceSpawn || &nbsp; || 0.00 || No
|-
| [[File:Io11.png]] || OnEndTouch || box_dropper_model_cover || SetAnimation || close || 0.00 || No
|-
|-
|OnTrigger || box_dropper_cover || SetAnimation || close || 2.00
| [[File:Io11.png]] || OnEndTouch || stop_tube_plugging || Enable || &nbsp; || 0.00 || No
|-
|-
|OnTrigger || box_maker || ForceSpawn || || 2.00
| [[File:Io21.png]] || OnEndTouch || !self || Disable || &nbsp; || 0.00 || No
|-
| [[File:Io11.png]] || OnEndTouch || stop_tube_plugging || Disable || &nbsp; || 2.00 || No
|-
| [[File:Io21.png]] || OnTrigger || !activator || Wake || &nbsp; || 0.00 || No
|}
|}


== How it works ==
{{clr}}
Cubes can be detected by creating a '''[[filter_activator_name]]''' with the '''Filter name''' field set to the same string as your box template - in this tutorial, it is <code>template_box</code>. Set it's name to, for example, <code>filter_box</code>. Create a '''[[trigger_multiple]]''' with the filter field set to <code>filter_box</code> to check whether the box is in a place you don't want it to be (for example acid). Make sure that the 'Physics Objects' flag is checked and add two outputs to this trigger.
 
{| class=standard-table
=== Lid Logic ===
!Output named || Target entities || Via this input || Parameter || Delay
Create a <code>[[logic_relay]]</code> and set its name to <code>logic_drop_box</code>. Give it the following outputs:
 
{| {{OutputsTable}}
| [[File:Io11.png]] || OnTrigger || box_dropper_model_cover || SetAnimation || open || 0.00 || No
|-
|-
|OnStartTouch || !activator || Kill || || 0.00
| [[File:Io11.png]] || OnTrigger || stop_tube_plugging || Disable || &nbsp; || 0.00 || No
|-
|-
|OnStartTouch || logic_drop_box || Trigger || || 0.00
| [[File:Io11.png]] || OnTrigger || trigger_box_dropper_clear || Enable || &nbsp; || 0.00 || No
|}
|}
You might want to spawn a cube when the map is loaded. To do this, create a '''[[logic_auto]]''' entity, and with the '''OnMapSpawn''' output, send a '''Trigger''' input to the <code>logic_drop_box</code> entity. It is advised that if you do this, set the delay to at least 4 seconds to avoid any problems.


Additionally, you can disable the recreation of the box when, for example, you destroy the box permanently. This is done by sending a '''Disable''' input to the <code>logic_drop_box</code> entity.


== See also ==
=== Shaft Slopes ===
* [[Portal Level Creation]]
[[File:Box_dropper_funnel.jpg|right|thumb|300px|The sloped brushes]]
 
Create brushes and use the clipping tool to shape them like depicted in the picture below. Tie all of these brushes to a <code>[[func_detail]]</code> entity. The dropper is now finished and ready to be implemented into a map.
 
{{clr}}
 
== Implementation ==
Place the dropper in the ceiling above where the box should drop. Texture the visible sides of the ceiling brushes with the <code>signage/hazard_orange_03b</code> texture.
 
=== Box Setup ===
Set up a trigger to send the ''Trigger'' input to the <code>logic_drop_box</code> entity. This can be done in numerous ways, such as using a <code>[[trigger_once]]</code> to have the box drop when the player enters the room or a <code>[[trigger_look]]</code> to make the box drop when the player is looking at the dropper.
 
=== Box Respawn ===
If there are [[Creating_a_portal/object_fizzler|fizzlers]] or [[Creating poison water|Hazard Liquid]] in the map, the box must be set up to respawn if it can be lost. For fizzlers, add a ''OnDissolveBox'' output that triggers <code>logic_drop_box</code> to the <code>[[trigger_portal_cleanser]]</code> entity.


== External links ==
To make the box respawn if it's lost in goo, create a <code>trigger_multiple</code> within the goo volume with its filter set to <code>filter_boxes</code>, the ''Physics Objects'' flag set, and with the following outputs:
* [http://forums.thinkingwithportals.com/downloads.php?view=detail&df_id=188 Example map] Example map using this tutorial. VMF included.
{| {{OutputsTable}}
| [[File:Io21.png]] || OnStartTouch || !activator || Kill || &nbsp; || 0.00 || No
|-
| [[File:Io11.png]] || OnStartTouch || logic_drop_box || Trigger || &nbsp; || 0.00 || No
|}


[[Category:Level Design Tutorials]]
[[Category:Portal]]
[[Category:Portal]]
[[Category:Level Design]]
[[Category:Tutorials]]

Latest revision as of 17:50, 19 April 2025

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


Portal Level Creation

This tutorial will show step-by-step how to create the box dropper, or vital apparatus vent, seen throughout the Portal test chambers. The box droppers can be used to give the player a new weighted storage cube whenever their previous one is destroyed.

Construction

Dropper model

The models

Create a prop_dynamic, set its model to models/props/box_dropper.mdl.

Create a prop_dynamic, set its model to models/props/box_dropper_cover.mdl and name box_dropper_model_cover.

Align the two entities so they are in the same place where the dropper should be in the map.

Ceiling Arch

Use the arch tool to create a 128L*128W*16H arch above the prop_dynamic entities with the following settings:

Property Name Value
Wall width 24
Number of Sides 8
Arc 360
Start Angle 0
Add Height 0

Tie this brush to a func_detail then use the vertex manipulation tool to move the corners of the arch so it resembles a rectangle with a hole in the middle. After that, texture the inner rim of the arch with metal/metalwall061f. Texture the underside of the arch with concrete/concrete_modular_ceiling001a.

Ceiling shaft

The shaft seen from the outside
The inside of the shaft with nodraw hidden

Create a shaft using brushes above the dropper with the dimensions of 128L*128W*256H and split the sides of the shaft in two equal pieces with the clipping tool. Then proceed to texture the lower inner walls with metal/metalwall_bts_006a, top inner walls with metal/metalwall_bts_006b_gradient and inner ceiling with lights/light_orange001.

Box Template

Create a small 128L*128W*112H room above the dropper shaft with nodraw textured brushes.

Next, create a prop_physics entity in the middle of this room and set its model to models/props/metal_box.mdl and name to box. Give it the following outputs:

  My Output Target Entity Target Input Parameter Delay Only Once
Io21.png OnOutOfWorld !activator Kill   0.00 No
Io12.png OnOutOfWorld logic_drop_box Trigger   0.00 Yes

Create a point_template in the middle of the box entity. Set its name to box_template and set its first template to box.

Create an env_entity_maker somewhere near the top of the shaft of the dropper. Set its name to entity_box_maker and set its Point_template to spawn to box_template.

Create a filter_activator_name entity somewhere in the map. Set its name to filter_boxes and set its Filter Name to box.

Create a logic_auto entity and enter the following output:

  My Output Target Entity Target Input Parameter Delay Only Once
Io12.png OnMapSpawn entity_box_maker ForceSpawn   0.00 No


Lid Brush

tube_stop_plugging

Create a 96L*96W*4H nodraw textured brush just below the lid of the dropper. Tie this brush to a func_brush entity. Set its name to stop_tube_plugging and set its Start Disabled keyvalue to Yes.

Lid Trigger

trigger_box_dropper_clear

Create a 128L*128W*128H trigger textured brush around the box dropper models.

Tie this brush to a trigger_multiple and enter the following properties:

Property Name Value
Name trigger_box_dropper_clear
Start Disabled Yes
Filter Name filter_boxes

Under Flags, modify the following:

Flag
Checkbox-on.png Physics Objects
Checkbox-off.png Clients

Now give it the following outputs:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnEndTouch entity_box_maker ForceSpawn   0.00 No
Io11.png OnEndTouch box_dropper_model_cover SetAnimation close 0.00 No
Io11.png OnEndTouch stop_tube_plugging Enable   0.00 No
Io21.png OnEndTouch !self Disable   0.00 No
Io11.png OnEndTouch stop_tube_plugging Disable   2.00 No
Io21.png OnTrigger !activator Wake   0.00 No

Lid Logic

Create a logic_relay and set its name to logic_drop_box. Give it the following outputs:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger box_dropper_model_cover SetAnimation open 0.00 No
Io11.png OnTrigger stop_tube_plugging Disable   0.00 No
Io11.png OnTrigger trigger_box_dropper_clear Enable   0.00 No


Shaft Slopes

The sloped brushes

Create brushes and use the clipping tool to shape them like depicted in the picture below. Tie all of these brushes to a func_detail entity. The dropper is now finished and ready to be implemented into a map.

Implementation

Place the dropper in the ceiling above where the box should drop. Texture the visible sides of the ceiling brushes with the signage/hazard_orange_03b texture.

Box Setup

Set up a trigger to send the Trigger input to the logic_drop_box entity. This can be done in numerous ways, such as using a trigger_once to have the box drop when the player enters the room or a trigger_look to make the box drop when the player is looking at the dropper.

Box Respawn

If there are fizzlers or Hazard Liquid in the map, the box must be set up to respawn if it can be lost. For fizzlers, add a OnDissolveBox output that triggers logic_drop_box to the trigger_portal_cleanser entity.

To make the box respawn if it's lost in goo, create a trigger_multiple within the goo volume with its filter set to filter_boxes, the Physics Objects flag set, and with the following outputs:

  My Output Target Entity Target Input Parameter Delay Only Once
Io21.png OnStartTouch !activator Kill   0.00 No
Io11.png OnStartTouch logic_drop_box Trigger   0.00 No