Frictional Games Forum (read-only)
How to script waking up in a bed? - Printable Version

+- Frictional Games Forum (read-only) (
+-- Forum: Amnesia: The Dark Descent (
+--- Forum: Custom Stories, TCs & Mods - Development (
+---- Forum: Development Support (
+---- Thread: How to script waking up in a bed? (/thread-15293.html)

How to script waking up in a bed? - willochill - 05-06-2012

I want to start off with a kind of cliche "wake up in a bed, look around, then get out of the bed" type of thing. Only thing is, I don't know how to script it. Do I have to rotate the player start area so that the player starts sideways? Then how to I get him out of the bed? Please give me some suggestions.

RE: How to script waking up in a bed? - Streetboat - 05-06-2012

You don't script this kind of thing in the level editor. What you've gotta do is place a couple of script areas around the room in the exact location you want the player's view to be centered at, so where you want him to look in the room is where you place these script areas. Then, in your .hps file for that level, under the 'OnStart' section, you would use FadeOut with a time of 0 seconds, then FadeIn with however much time you want, then throw some timers in there, with each timer using StartPlayerLookAt and telling the player to look around at the various scriptareas in the room, by name. Don't forget to use StopPlayerLookAt(); to give back player control once you are satisfied with him looking around! And throw some PlaySoundAtEntity funcs to make the player breathe, and if you're feeling fancy, use FadeSepiaColorTo and FadeImageTrailTo to imitate grogginess upon waking up. Hope that helps Smile

RE: How to script waking up in a bed? - Your Computer - 05-06-2012