08-03-2012, 07:25 AM
08-03-2012, 07:49 AM
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!
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!
08-03-2012, 11:38 AM
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
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