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
Shaky Script
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#1
Shaky Ground

Does anyone know the script for when the ground should shake and when to add a scream effect inside in game. Thank you!
08-03-2012, 07:25 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Shaky Ground

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!
(This post was last modified: 08-03-2012, 07:50 AM by Statyk.)
08-03-2012, 07:49 AM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#3
RE: Shaky Script

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

CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 08-03-2012, 12:01 PM by Lizard.)
08-03-2012, 11:38 AM
Find




Users browsing this thread: 1 Guest(s)