Creating a wake-up bed: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 53: Line 53:
|-
|-
|[[Image:Io11.png]] || OnMapSpawn || blackout || SetAnimation || exit1 || 5.00
|[[Image:Io11.png]] || OnMapSpawn || blackout || SetAnimation || exit1 || 5.00
|}
<br><br>Set these for the blackout model:
{| class=standard-table
! || Output named || Target entities || Via this input || Parameter || Delay
|-
|[[Image:Io11.png]] || OnAnimationDone || bed_cover || SetAnimation || closing || 0.00
|-
|[[Image:Io11.png]] || OnAnimationDone || bed_cover_sound || Playsound ||  || 0.00
|-
|[[Image:Io11.png]] || OnAnimationDone || blackout_cam || Disable ||  || 0.00
|}
|}
</div></div>
</div></div>

Revision as of 13:56, 15 June 2009

Under construction.png
This page is actively undergoing a major edit.
As a courtesy, please do not edit this while this message is displayed.
If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page.

The person who added this notice will be listed in its edit history should you wish to contact them.

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

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


Other Entities

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

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.


Logic

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_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

See also