Alento
Member
Posts: 64
Threads: 11
Joined: Jan 2012
Reputation:
0
|
Screen Shake
Hello everyone!
I just started to do this. And i must say, it is sooo much fun!
BUT!
I'm stuck.. I wanna do a screen shake when the player is in my "HangArea". Because when the
player is in the "HangArea", there is a corpse, hanging upside down, popping up .
I've looked around the forums for something similar.
But i don't still don't get it, how the script is supposed to look like.
Please help me someone! It would be so appreciated!
Thanks!
|
|
01-18-2012, 10:03 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Screen Shake
(01-18-2012, 10:03 PM)Alento Wrote: Hello everyone!
I just started to do this. And i must say, it is sooo much fun!
BUT!
I'm stuck.. I wanna do a screen shake when the player is in my "HangArea". Because when the
player is in the "HangArea", there is a corpse, hanging upside down, popping up .
I've looked around the forums for something similar.
But i don't still don't get it, how the script is supposed to look like.
Please help me someone! It would be so appreciated!
Thanks! Use this code
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
|
|
01-18-2012, 10:15 PM |
|
Alento
Member
Posts: 64
Threads: 11
Joined: Jan 2012
Reputation:
0
|
RE: Screen Shake
(01-18-2012, 10:15 PM)SilentStriker Wrote: (01-18-2012, 10:03 PM)Alento Wrote: Use this code
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 hm.. i just got error message :/
Don't i need a collide or something?
Cuz i just got error message saying that "it's an unexpected '{'
hmm :/
(This post was last modified: 01-18-2012, 10:23 PM by Alento.)
|
|
01-18-2012, 10:17 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Screen Shake
(01-18-2012, 10:17 PM)Alento Wrote: oh! so it is just that void? :O
Thank you! If you want it to start shake when the player walks in to an area you need to make a collidecallback and then use the use screenshake without the void inside the callback You get it or are you very new at scripting and don't know anything?
|
|
01-18-2012, 10:20 PM |
|
Alento
Member
Posts: 64
Threads: 11
Joined: Jan 2012
Reputation:
0
|
RE: Screen Shake
(01-18-2012, 10:20 PM)SilentStriker Wrote: If you want it to start shake when the player walks in to an area you need to make a collidecallback and then use the use screenshake without the void inside the callback You get it or are you very new at scripting and don't know anything? haha well ya, with that said.. i started scripting like.. 2 days ago ^^
So, yeah, i'm a bit retarded on this i try as hard as i can ^^
but i really don't get it. i mean
this is what my script to shake looks like now:
void OnStart()
{
AddEntityCollideCallback("hangman", "HangArea", "StartScreenShake", true, 1);
}
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);
{
StartScreenShake(3.0f, 2.3f, 0.0f, 0.0f);
}
|
|
01-18-2012, 10:27 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Screen Shake
(01-18-2012, 10:27 PM)Alento Wrote: (01-18-2012, 10:20 PM)SilentStriker Wrote: If you want it to start shake when the player walks in to an area you need to make a collidecallback and then use the use screenshake without the void inside the callback You get it or are you very new at scripting and don't know anything? haha well ya, with that said.. i started scripting like.. 2 days ago ^^
So, yeah, i'm a bit retarded on this i try as hard as i can ^^
but i really don't get it. i mean
this is what my script to shake looks like now:
void OnStart()
{
AddEntityCollideCallback("hangman", "HangArea", "StartScreenShake", true, 1);
}
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);
{
StartScreenShake(3.0f, 2.3f, 0.0f, 0.0f);
} Remember that when making a callback you need to use the right callback syntaxes so it should look like:
void OnStart()
{
AddEntityCollideCallback("Player", "THENAMEOFTHEAREA", "THECALLBACKNAME", true, 1);
}
void THECALLBACKNAME(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(2, 2, 1, 2);
}
(This post was last modified: 01-18-2012, 10:55 PM by SilentStriker.)
|
|
01-18-2012, 10:53 PM |
|
Alento
Member
Posts: 64
Threads: 11
Joined: Jan 2012
Reputation:
0
|
RE: Screen Shake
(01-18-2012, 10:53 PM)SilentStriker Wrote: Remember that when making a callback you need to use the right callback syntaxes so it should look like:
void OnStart()
{
AddEntityCollideCallback("Player", "THENAMEOFTHEAREA", "THECALLBACKNAME", true, 1);
}
void THECALLBACKNAME(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(2, 2, 1, 2);
}
Thank you, but, actually, it doesn't shake at all :/ no error messages this time, but no shake :/
|
|
01-18-2012, 11:04 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Screen Shake
(01-18-2012, 11:04 PM)Alento Wrote: (01-18-2012, 10:53 PM)SilentStriker Wrote: Remember that when making a callback you need to use the right callback syntaxes so it should look like:
void OnStart()
{
AddEntityCollideCallback("Player", "THENAMEOFTHEAREA", "THECALLBACKNAME", true, 1);
}
void THECALLBACKNAME(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(2, 2, 1, 2);
}
Thank you, but, actually, it doesn't shake at all :/ no error messages this time, but no shake :/ Have you changed the "THENAMEOFTHEAREA" to the script area?
|
|
01-18-2012, 11:05 PM |
|
Alento
Member
Posts: 64
Threads: 11
Joined: Jan 2012
Reputation:
0
|
RE: Screen Shake
(01-18-2012, 11:05 PM)SilentStriker Wrote: Have you changed the "THENAMEOFTHEAREA" to the script area? Yepp
|
|
01-18-2012, 11:20 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Screen Shake
(01-18-2012, 11:20 PM)Alento Wrote: (01-18-2012, 11:05 PM)SilentStriker Wrote: Have you changed the "THENAMEOFTHEAREA" to the script area? Yepp True change the 1 to a 0 on AddEntityCollideCallback
|
|
01-18-2012, 11:35 PM |
|
|