Completely new to scripting, stumped. - 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: Completely new to scripting, stumped. (/thread-16595.html) |
Completely new to scripting, stumped. - Shambles - 06-29-2012 Before you say ANYTHING, please understand that I am from Germany, and my english is not as good. I am trying to make a custom story for my partner, I keep getting "fatal error unexpected end of script" or something. I have hardly anything on the script now. I have tried following tutorial on wiki and youtube, am I placing wrong or something?? Very simple script so far, want to test out effects! Someone tell me what I am doing wrong, please? :c I want to make this work. void OnStart() { if(ScriptDebugOn()) { void FadeImageTrailTo(5.4f 2.1f); } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } Once more, not so great at english, and really really new to scripting. RE: Completely new to scripting, stumped. - Demondays1 - 06-29-2012 Anything on BOLD means its the problem void OnStart() { if(ScriptDebugOn()) } void FadeImageTrailTo(5.4f 2.1f) { } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } RE: Completely new to scripting, stumped. - Shambles - 06-29-2012 Ithink I see...Uneeded extra brackets?? also now I am trying this- Everything worked until I added the trail function It keeps telling me "unexpected ' " { AddEntityCollideCallback("Player", "push", "Push", true, 1); } void Push(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "guardian_distant.snt", "push", 0, false); AddPlayerBodyForce(30000, 0, 0, false); void FadeImageTrailTo(5.4f 2.1f); void FadeIn(10); } RE: Completely new to scripting, stumped. - ApeCake - 06-29-2012 Yes, I think that's the problem. I think it indeed should be this. void OnStart() { if(ScriptDebugOn()) { void FadeImageTrailTo(5.4f 2.1f) } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } I am not sure about this, seeing I've never used ScriptDebugOn nor FadeImageTrailTo. Viel Glück und Spaß! RE: Completely new to scripting, stumped. - Your Computer - 06-29-2012 You need to do research on how to define and call a function. C++ material should be enough for that. RE: Completely new to scripting, stumped. - Shambles - 06-29-2012 I get the basic idea, I just have trouble knowing if brackets should be on something or not If they need to be indented(?) if spacing is important Adding functions isn't a big problem. RE: Completely new to scripting, stumped. - Cruzore - 06-29-2012 spaces between anything doesn't matter. Functions and statements like if and for need brackets to determine what they should run. RE: Completely new to scripting, stumped. - Shambles - 06-29-2012 Alright! Thanks to everyone for answering! |