Frictional Games Forum (read-only)
[SCRIPT] Screen Shake - 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] Screen Shake (/thread-12700.html)

Pages: 1 2 3


RE: Screen Shake - Alento - 01-19-2012

(01-18-2012, 11:35 PM)SilentStriker Wrote:
(01-18-2012, 11:20 PM)Alento Wrote:
True change the 1 to a 0 on AddEntityCollideCallback Smile
Hey!

Now I'm home again and can continue scripting! Big Grin

I tried it now, but , still doesn't work! Sad


RE: Screen Shake - SilentStriker - 01-19-2012

(01-19-2012, 04:57 PM)Alento Wrote:
(01-18-2012, 11:35 PM)SilentStriker Wrote: True change the 1 to a 0 on AddEntityCollideCallback Smile
Hey!

Now I'm home again and can continue scripting! Big Grin

I tried it now, but , still doesn't work! Sad
There is something wrong with the script x) can I see your whole script? and what's the name of the area the player walks in to?




RE: Screen Shake - Alento - 01-19-2012

(01-19-2012, 08:12 PM)SilentStriker Wrote: There is something wrong with the script x) can I see your whole script? and what's the name of the area the player walks in to?
(01-19-2012, 08:12 PM)SilentStriker Wrote: Think this is the one Smile
{
AddEntityCollideCallback("Player", "HangArea", "Hang_Man", true, 1);

AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void Hang_Man(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("hangman", true);
}

void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);

{
StartScreenShake(2, 2, 1, 0);
}





RE: Screen Shake - SilentStriker - 01-19-2012

(01-19-2012, 08:25 PM)Alento Wrote:
(01-19-2012, 08:12 PM)SilentStriker Wrote: There is something wrong with the script x) can I see your whole script? and what's the name of the area the player walks in to?
(01-19-2012, 08:12 PM)SilentStriker Wrote: Think this is the one Smile
{
AddEntityCollideCallback("Player", "HangArea", "Hang_Man", true, 1);

AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void Hang_Man(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("hangman", true);
}

void StartScreenShake(string &in asParent, string &in asChild, int alState);

{
StartScreenShake(2, 2, 1, 0);
}
Why are you using two collidecallbacks to the same area? :p

And you are using the wrong syntax on the Callback ^^

Try this Smile

Code:
{
AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);

{
SetEntityActive("hangman", true);
StartScreenShake(2, 2, 1, 0);
}




RE: Screen Shake - Alento - 01-19-2012

(01-19-2012, 08:43 PM)SilentStriker Wrote:
(01-19-2012, 08:25 PM)Alento Wrote:
Why are you using two collidecallbacks to the same area? :p

And you are using the wrong syntax on the Callback ^^

Try this Smile

Code:
{
AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);

{
SetEntityActive("hangman", true);
StartScreenShake(2, 2, 1, 0);
}
hm.. xD i dunno, i thought it was like that Tongue

but now it says : Main(23,1) : ERR : Unexpected token '{'

^^

Thank for your patience ! Smile





RE: Screen Shake - SilentStriker - 01-19-2012

(01-19-2012, 08:55 PM)Alento Wrote:
(01-19-2012, 08:43 PM)SilentStriker Wrote: Why are you using two collidecallbacks to the same area? :p

And you are using the wrong syntax on the Callback ^^

Try this Smile

Code:
{
AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);

{
SetEntityActive("hangman", true);
StartScreenShake(2, 2, 1, 0);
}
hm.. xD i dunno, i thought it was like that Tongue

but now it says : Main(23,1) : ERR : Unexpected token '{'

^^

Thank for your patience ! Smile
You need to put the AddEntityCollideCallback inside the brackets of void OnStart

We are here to help ^^




RE: Screen Shake - Alento - 01-19-2012

(01-19-2012, 08:57 PM)SilentStriker Wrote:
(01-19-2012, 08:55 PM)Alento Wrote:
You need to put the AddEntityCollideCallback inside the brackets of void OnStart

We are here to help ^^
Big Grin it is :/ but , the error is with "void", it's there it shows error '{' :/





RE: Screen Shake - SilentStriker - 01-19-2012

(01-19-2012, 09:04 PM)Alento Wrote:
(01-19-2012, 08:57 PM)SilentStriker Wrote: You need to put the AddEntityCollideCallback inside the brackets of void OnStart

We are here to help ^^
Big Grin it is :/ but , the error is with "void", it's there it shows error '{' :/
The script should look like this

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void StartScreenShake(string &in asParent, string &in asChild, int alState);
{
SetEntityActive("hangman", true);
StartScreenShake(2, 2, 1, 0);
}




RE: Screen Shake - Alento - 01-19-2012

(01-19-2012, 09:23 PM)SilentStriker Wrote:
(01-19-2012, 09:04 PM)Alento Wrote:
The script should look like this

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void StartScreenShake(string &in asParent, string &in asChild, int alState);
{
SetEntityActive("hangman", true);
StartScreenShake(2, 2, 1, 0);
}
it does! Sad(




RE: Screen Shake - SilentStriker - 01-19-2012

(01-19-2012, 09:34 PM)Alento Wrote:
(01-19-2012, 09:23 PM)SilentStriker Wrote: The script should look like this

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void StartScreenShake(string &in asParent, string &in asChild, int alState);
{
SetEntityActive("hangman", true);
StartScreenShake(2, 2, 1, 0);
}
it does! Sad(
So nothings happening? see if you've done any typos or something


(01-19-2012, 09:34 PM)Alento Wrote:
(01-19-2012, 09:23 PM)SilentStriker Wrote: The script should look like this

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "HangArea", "StartScreenShake", true, 1);
}

void StartScreenShake(string &in asParent, string &in asChild, int alState);
{
SetEntityActive("hangman", true);
StartScreenShake(2, 2, 1, 0);
}
it does! Sad(
I found the problem remove the ; from (string &in asParent, string &in asChild, int alState);

oh and you might want to lower the screenshake to like (0.3f, 1, 1, 0);