Frictional Games Forum (read-only)
Shaky Script - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Shaky Script (/thread-17448.html)



Shaky Ground - Brothersvv09 - 08-03-2012

Does anyone know the script for when the ground should shake and when to add a scream effect inside in game. Thank you!


RE: Shaky Ground - Statyk - 08-03-2012

void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);

Shakes the screen.

afAmount - intensity of the shake
afTime - duration of the shake
afFadeInTime - time in seconds until full intensity is reached
afFadeOutTime - time until screen is back to normal


__________________________________________________________________________________
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

Creates a sound on an entity.

asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade
abSaveSound - determines whether a sound should “remember” its
state. If true, the sound is never attached to the entity! Also note
that saving should on be used on looping sounds!


RE: Shaky Script - Lizard - 08-03-2012

void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);

PS: i would sugest that you do not use any number higher than 0.4 in float afAmount. I never put the amount higher than 0.3


example

void OnStart()
{
AddEntityCollideCallback("Player", "Name_Of_Area", "Name_Of_Function", true(this deletes the area after collision), 1);
}

void Name_Of_Function(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(0.2, 2, 0, 1);
}

0.2 = the power of the shake
2 = Is how long the shake should last
0 = How long it should take for the shake to reach max shake (0 means max is reached immediately)
1 = How long it should take for screen to be back to normal