Creating a wake-up bed: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Unicodifying, replaced: [[Image: → [[File: (13))
 
(14 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{wip}}
{{lang|Creating_a_wake-up_bed}}
{{DISPLAYTITLE: Portal - Tutorial - Bed}}
{{back | Portal Level Creation}}


== Introduction ==
== Introduction ==
<div style='padding-left:20px'>Creating a wake-up bed is extremely easy. If you have decompiled the first level and analyzed it, you may have noticed a bunch of extra entities, which over complicate it.</div>
Creating a wake-up bed is extremely easy. If you have decompiled the first level and analyzed it, you may have noticed a bunch of extra entities, which over complicate it.


<div style='clear:both'>
===Models===
===Models===
[[Image:**.jpg|right|thumb|Step *]]
Create two prop_dynamic entities. One should be ''models\props\bed_body_reference.mdl'' and the ''other models\props\bed_cover_reference.mdl''. Call the cover bed_cover. Disable shadows on both.
<div style='padding-left:20px'>Create two prop_dynamic entities. One should be models\props\bed_body_reference.mdl and the other models\props\bed_cover_reference.mdl. Call the cover bed_cover. Disable shadows on both.</div></div>


<div style='clear:both'>
===Blackout===
===Blackout===
[[Image:**.jpg|right|thumb|Step *]]
Create another prop_dynamic. Call it blackout, with the model ''models\blackin.mdl''. This model will provide the movement for the camera. Place the blackout model as shown. Disable shadows on the model.
<div style='padding-left:20px'>Create another prop_dynamic. Call it blackout, with the model models\blackin.mdl. This model will provide the movement for the camera. Place the blackout model as shown. Disable shadows on the model.</div></div>


<div style='clear:both'>
===Start===
===Start===
[[Image:**.jpg|right|thumb|Step *]]
[[File:Bed_tutorial_setup.jpg|right|thumb|Placing the info_player_start]]
<div style='padding-left:20px'>Put a info_player_start, so it shares the exact origin of the blackout model. Their origins are highlighted here. The player should form a right angle with the blackout model's origin. The position of this is very important so the transition is as smooth as possible.</div></div>


Put a info_player_start, so it shares the exact origin of the blackout model. Their origins are highlighted here. The player should form a right angle with the blackout model's origin. The position of this is very important so the transition is as smooth as possible.


<div style='clear:both'>
<div style="clear:both"></div>
===Camera===
===Camera===
[[Image:**.jpg|right|thumb|Step *]]
Place a point_viewcontrol somewhere near the bed. Its position does not matter. Do not rotate the camera, leave it at the default rotation. Call it blackout_cam and set its parent to blackout. Have only these three flags checked: Freeze player, Infinite hold time, and Snap to goal angles.
<div style='padding-left:20px'>Place a point_viewcontrol somewhere near the bed. It's position does not matter. Do not rotate the camera, leave it at the default rotation. Call it blackout_cam and set it's parent to blackout. Have only these three flags checked: Freeze player, Infinite hold time, and Snap to goal angles</div></div>


<div style='clear:both'>
===Other Entities===
===Other Entities===
[[Image:**.jpg|right|thumb|Step *]]
Add a env_fade, set to fade from. Call it blackout_fade<br /><br />Add an ambient_generic, call it bed_cover_sound, set its sound origin to bed_cover, and set its sound to ''Doors.FullClose14''.
<div style='padding-left:20px'>Add a env_fade, set to fade from. Call it blackout_fade<br><br>Add an ambient_generic, call it bed_cover_sound, set it's sound origin to bed_cover, and set it's sound to Doors.FullClose14.</div></div>


===Logic===
[[File:Bed_tutorial_setup.jpg|right|thumb|Final Setup]]


<div style='clear:both'>
Create a logic_auto with the following outputs:
===Logic===
[[Image:**.jpg|right|thumb|Step *]]
<div style='padding-left:20px'>Create a logic_auto with the following outputs:


{| class=standard-table
{| class=standard-table
! || Output named || Target entities || Via this input || Parameter || Delay
! || Output named || Target entities || Via this input || Parameter || Delay
|-
|-
|[[Image:Io11.png]] || OnMapSpawn || blackout_cam || SetParentAttachment || vehicle_driver_eyes || 0.00
|[[File:Io11.png]] || OnMapSpawn || blackout_cam || SetParentAttachment || vehicle_driver_eyes || 0.00
|-
|[[File:Io11.png]] || OnMapSpawn || blackout_cam || Enable ||  || 0.00
|-
|-
|[[Image:Io11.png]] || OnMapSpawn || blackout_cam || Enable ||  || 0.00
|[[File:Io11.png]] || OnMapSpawn || blackout_fade || Fade ||  || 0.00
|-
|-
|[[Image:Io11.png]] || OnMapSpawn || blackout_fade || Fade ||   || 0.00
|[[File:Io11.png]] || OnMapSpawn || bed_cover || SetAnimation || opening || 5.00
|-
|-
|[[Image:Io11.png]] || OnMapSpawn || bed_cover || SetAnimation || Opening || 5.00
||[[File:Io11.png]] || OnMapSpawn || bed_cover || SetDefaultAnimation || open || 5.00
|-
|-
|[[Image:Io11.png]] || OnMapSpawn || bed_cover_sound || PlaySound ||  || 5.00
|[[File:Io11.png]] || OnMapSpawn || bed_cover_sound || PlaySound ||  || 5.00
|-
|-
|[[Image:Io11.png]] || OnMapSpawn || blackout || SetAnimation || exit1 || 5.00
|[[File:Io11.png]] || OnMapSpawn || blackout || SetAnimation || exit1 || 5.00
|}
|}


<br><br>Set these for the blackout model:
Set these for the blackout model:
{| class=standard-table
{| class=standard-table
! || Output named || Target entities || Via this input || Parameter || Delay
! || Output named || Target entities || Via this input || Parameter || Delay
|-
|-
|[[Image:Io11.png]] || OnAnimationDone || bed_cover || SetAnimation || closing || 0.00
|[[File:Io11.png]] || OnAnimationDone || bed_cover || SetAnimation || closing || 0.00
|-
|-
|[[Image:Io11.png]] || OnAnimationDone || bed_cover_sound || Playsound ||  || 0.00
|[[File:Io11.png]] || OnAnimationDone || bed_cover_sound || PlaySound ||  || 0.00
|-
|-
|[[Image:Io11.png]] || OnAnimationDone || blackout_cam || Disable ||  || 0.00
|[[File:Io11.png]] || OnAnimationDone || blackout_cam || Disable ||  || 0.00
|-
|[[File:Io11.png]] || OnAnimationDone || bed_cover || SetDefaultAnimation || idle || 0.00
|}
|}
</div></div>
 
<div style='clear:both'></div>
 
== Conclusion ==
This has the exact same function as the bed in the first chamber. It uses 1 sound entity (as the open and close sound are the exact same). It does not involve a teleporter, as it serves no logical purpose.


== See also ==
== See also ==
* [[Portal Level Creation]]
* [[Portal Level Creation]]


[[Category:Level Design Tutorials]]
== External links ==
* [http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=219 Example map] Example map using this tutorial. VMF included.
 
[[Category:Portal]]
[[Category:Portal]]
[[Category:Level Design]]
[[Category:Tutorials]]
[[Category:Sbrown Tutorials]]
[[Category:Sbrown Tutorials]]

Latest revision as of 08:42, 8 January 2024

English (en)Русский (ru)中文 (zh)Translate (Translate)

Warning: Display title "Portal - Tutorial - Bed" overrides earlier display title "Creating a wake-up bed".

Portal Level Creation

Introduction

Creating a wake-up bed is extremely easy. If you have decompiled the first level and analyzed it, you may have noticed a bunch of extra entities, which over complicate it.

Models

Create two prop_dynamic entities. One should be models\props\bed_body_reference.mdl and the other models\props\bed_cover_reference.mdl. Call the cover bed_cover. Disable shadows on both.

Blackout

Create another prop_dynamic. Call it blackout, with the model models\blackin.mdl. This model will provide the movement for the camera. Place the blackout model as shown. Disable shadows on the model.

Start

Placing the info_player_start

Put a info_player_start, so it shares the exact origin of the blackout model. Their origins are highlighted here. The player should form a right angle with the blackout model's origin. The position of this is very important so the transition is as smooth as possible.

Camera

Place a point_viewcontrol somewhere near the bed. Its position does not matter. Do not rotate the camera, leave it at the default rotation. Call it blackout_cam and set its parent to blackout. Have only these three flags checked: Freeze player, Infinite hold time, and Snap to goal angles.

Other Entities

Add a env_fade, set to fade from. Call it blackout_fade

Add an ambient_generic, call it bed_cover_sound, set its sound origin to bed_cover, and set its sound to Doors.FullClose14.

Logic

Final Setup

Create a logic_auto with the following outputs:

Output named Target entities Via this input Parameter Delay
Io11.png OnMapSpawn blackout_cam SetParentAttachment vehicle_driver_eyes 0.00
Io11.png OnMapSpawn blackout_cam Enable 0.00
Io11.png OnMapSpawn blackout_fade Fade 0.00
Io11.png OnMapSpawn bed_cover SetAnimation opening 5.00
Io11.png OnMapSpawn bed_cover SetDefaultAnimation open 5.00
Io11.png OnMapSpawn bed_cover_sound PlaySound 5.00
Io11.png OnMapSpawn blackout SetAnimation exit1 5.00

Set these for the blackout model:

Output named Target entities Via this input Parameter Delay
Io11.png OnAnimationDone bed_cover SetAnimation closing 0.00
Io11.png OnAnimationDone bed_cover_sound PlaySound 0.00
Io11.png OnAnimationDone blackout_cam Disable 0.00
Io11.png OnAnimationDone bed_cover SetDefaultAnimation idle 0.00

Conclusion

This has the exact same function as the bed in the first chamber. It uses 1 sound entity (as the open and close sound are the exact same). It does not involve a teleporter, as it serves no logical purpose.

See also

External links

  • Example map Example map using this tutorial. VMF included.