[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) |
Screen Shake - Alento - 01-18-2012 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! RE: Screen Shake - SilentStriker - 01-18-2012 (01-18-2012, 10:03 PM)Alento Wrote: Hello everyone!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 RE: Screen Shake - Alento - 01-18-2012 (01-18-2012, 10:15 PM)SilentStriker Wrote:hm.. i just got error message :/(01-18-2012, 10:03 PM)Alento Wrote:Use this code Don't i need a collide or something? Cuz i just got error message saying that "it's an unexpected '{' hmm :/ RE: Screen Shake - SilentStriker - 01-18-2012 (01-18-2012, 10:17 PM)Alento Wrote: oh! so it is just that void? :OIf 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? RE: Screen Shake - Alento - 01-18-2012 (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); } RE: Screen Shake - SilentStriker - 01-18-2012 (01-18-2012, 10:27 PM)Alento Wrote:Remember that when making a callback you need to use the right callback syntaxes so it should look like:(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 ^^ Code: void OnStart() RE: Screen Shake - Alento - 01-18-2012 (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:Thank you, but, actually, it doesn't shake at all :/ no error messages this time, but no shake :/ RE: Screen Shake - SilentStriker - 01-18-2012 (01-18-2012, 11:04 PM)Alento Wrote:Have you changed the "THENAMEOFTHEAREA" to the script area?(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:Thank you, but, actually, it doesn't shake at all :/ no error messages this time, but no shake :/ RE: Screen Shake - Alento - 01-18-2012 (01-18-2012, 11:05 PM)SilentStriker Wrote: Have you changed the "THENAMEOFTHEAREA" to the script area?Yepp RE: Screen Shake - SilentStriker - 01-18-2012 (01-18-2012, 11:20 PM)Alento Wrote:True change the 1 to a 0 on AddEntityCollideCallback(01-18-2012, 11:05 PM)SilentStriker Wrote: Have you changed the "THENAMEOFTHEAREA" to the script area?Yepp |