Frictional Games Forum (read-only)

Full Version: How to make screen shaking with sound?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you've played amnesia the dark descent then you know what I'm talking about! if you remember in the begining of amnesia when you enter the area where there is a oven with a wardrobe/the room where you'll enter after you grabbed the lantern. yeah that room where it will unlock the door after you get the lantern, everything starts to shake and makes a shaking rumble sound, how do I do that? I want to do that in my custom story! thanks Wink
You play a sound and shake the screen, pretty basic. All the functions for this can be found here:

http://wiki.frictionalgames.com/hpl2/amn..._functions
Look for the functions in the original script and "get inspired".
You'll need a Screenshake function to make the screen shake, basically. Then a PlayGuiSound that will play a rumble sound (PlayGuiSound works with .ogg sound files, no need to use any .snt).

Also you will need a AddPropForce to the items ! Shaking the screen and playing the sound are very good, but you want the whole room to shake ! So AddPropForce to the chandeliers, to the details, maybe turn some lights off using SetLampLit.

Also, create some dust particles in the room when the screen shakes !
(02-01-2014, 09:47 PM)i3670 Wrote: [ -> ]Look for the functions in the original script and "get inspired".
lol.
(02-02-2014, 03:23 AM)Amn Wrote: [ -> ]
(02-01-2014, 09:47 PM)i3670 Wrote: [ -> ]Look for the functions in the original script and "get inspired".
lol.

Yeah, it made me laugh my ass off too xD
Well, you can use my script if you wish.

Spoiler below!
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""Scare_1""StartShaking"true1);
}

void StartShaking(string &in asParentstring &in asChildint alState)
{  
    
SetPlayerMoveSpeedMul(0.35);
    
SetPlayerRunSpeedMul(0);
    
SetPlayerLookSpeedMul(0.5);
    
GiveSanityDamage(25.0ftrue);
    
PlayGuiSound("guardian_ontop3.ogg"0.5f);
    
StartScreenShake0.2f1.1f0.2f8.5f);
    
CreateParticleSystemAtEntity("""ps_cave_monster_breath.ps""Ghost_1"true);
    
CreateParticleSystemAtEntity("""ps_cave_monster_breath.ps""Ghost_2"true);
    
AddTimer(""0.7"scared");
}
void scared(string &in asTimer)
{
    
SetEntityActive("skull_1"false);
    
SetEntityActive("skull_2"true);
    
AddTimer(""8.5"scared2");
}
void scared2(string &in asTimer)
{
SetPlayerMoveSpeedMul(1);
SetPlayerRunSpeedMul(1);
SetPlayerLookSpeedMul(1);
ChangePlayerStateToNormal();
SetPlayerActive(true);