Frictional Games Forum (read-only)
[SCRIPT] Need help with screen shake and look scripts~ - 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: [SCRIPT] Need help with screen shake and look scripts~ (/thread-11339.html)



Need help with screen shake and look scripts~ - julianprokop - 11-14-2011

Basically I want the screen to shake when the player looks at an enemy entity.

This enemy is spawned with a trigger when the player hits a script box and when the player looks to see what the sound is, I want the screen to shake when you see the enemy. I also want the player's view to snap and look at the monster, then the shake will happen.

Here is what I have so far for the looking and shaking...I don't get any errors...it just isn't working Sad
Any help would be much appreciated!
Quote://CALLBACK
AddEntityCollideCallback("Player", "MonsterLook", "PlayerLook", true, 1);


//Void functions


void PlayerLook(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback)
{
StartPlayerLookAt("Enemy2", 3.0f, 3.6f, "ScreenShake");
}

void ScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime)

{
StartScreenShake (2.0f, 2.0f, 1.5f, 2.0f);
StopPlayerLookAt();
}



RE: Need help with screen shake and look scripts~ - flamez3 - 11-14-2011

Quote://CALLBACK
AddEntityCollideCallback("Player", "MonsterLook", "PlayerLook", true, 1);


//Void functions


void PlayerLook(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Enemy2", 3.0f, 3.6f, "ScreenShake");
AddTimer("look01", 4.0f, "Timer_1");
StartScreenShake (2.0f, 2.0f, 1.5f, 2.0f);
}

void Timer_1(string &in asTimer)
{
StopPlayerLookAt();
}
You don't need the extra function block "screenshake". Just add a timer so that when 4 seconds is up, the player will stop looking at him. Make sure Enemy2 is named Enemy2 in the level editor aswell. Also, you put the wrong syntax part next to the void PlayerLook. The one i put there is correct for colldecallbacks.


RE: Need help with screen shake and look scripts~ - julianprokop - 11-14-2011

Thank you thank you thank you!
Wasn't to sure about how timers worked.


RE: Need help with screen shake and look scripts~ - flamez3 - 11-14-2011

hahah np