Frictional Games Forum (read-only)

Full Version: Need help with screen shake and look scripts~
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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();
}
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.
Thank you thank you thank you!
Wasn't to sure about how timers worked.
hahah np