Frictional Games Forum (read-only)

Full Version: Scripting a fall sequence.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey there, I have another question. How would I go about creating a fall sequence which simulated the player falling over a barrier and down to a lower level?

[Image: zump.jpg]

The Image above shows what I want done. When the player enters the Area, I want a cinematic-like event to happen where the player turns around and gets pushed over the edge by an unseen force. But Simulating the roll and falling velocity would seem quite a challenge.

I had a look around the Amnesia files and saw the Wake Up sequence, but I'm still not sure if i understand the parameters correctly. Does anyone know an easy way of creating something like this?
Depends what you consider to be easy Tongue

You wouldn't have to worry about the falling speed, as the engine already has gravity - all you have to do is push the player off and let it take care of the rest.

As for screen/camera effects, it depends on how much you really want. Using StartPlayerLookAt etc you can get them looking the right way, and also to get their camera to move around appropriately but it looks like quite a short drop, so there isn't going to be enough time to do anything super complicated.

Just take it step by step. First work out how to push them over the edge (AddPlayerBodyForce, probably want to make the railing non-collidable), then take time to use StartPlayerLookAt with a timer to get them looking the right way, then add some rolling if it seems appropriate. Break the problem down into steps and take them one at a time.

Honestly, using a Wake Up script as a template for this is probably a bad idea - you'd have to do so much work to it to get it right that you may as well write it from scratch anyway. You would still need to understand the process to be able to adapt the wake up script, so there is little to no benefit

Hope that helps!
You may also want to utilize the FadePlayerRollTo and MovePlayerHeadPos scripts. You can actually make some pretty cinematic moment's in amnesia if you put in the scripting time.
At most you'd probably only need the following HPL2 functions: AddPlayerBodyForce, AddEntityCollideCallback, AddTimer, StartPlayerLookAt, StopPlayerLookAt, and SetPlayerSanity (setting the player's sanity to 0 will automatically provide a collapse animation with screen effects).