Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Need help with screen shake and look scripts~
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#1
Need help with screen shake and look scripts~

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();
}
(This post was last modified: 11-14-2011, 06:16 AM by julianprokop.)
11-14-2011, 06:15 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Need help with screen shake and look scripts~

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.

(This post was last modified: 11-14-2011, 07:40 AM by flamez3.)
11-14-2011, 07:36 AM
Find
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#3
RE: Need help with screen shake and look scripts~

Thank you thank you thank you!
Wasn't to sure about how timers worked.
11-14-2011, 11:43 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Need help with screen shake and look scripts~

hahah np

11-14-2011, 03:34 PM
Find




Users browsing this thread: 2 Guest(s)