Frictional Games Forum (read-only)
More script errors! - 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: More script errors! (/thread-13110.html)



More script errors! - Strembitsky - 02-05-2012

Code:
//===========================================
     // Starter's Script File!
     //===========================================

     //===========================================
     // This runs when the map first starts
     void OnStart()
     {
          AddEntityCollideCallback("Player", "ScriptArea_1", "Collide_Area", true, 1);
     }
     void Collide_Area(string &in asParent, string &in asChild, int alState)      
     {
          FadeEnemyToSmoke("servant_grunt_1", true);
     }
    
     {
          AddEntityCollideCallback("Player", "ScriptArea_2", "Message1", true, 1);
     }
    
     void Message1(string &in asChild, string &in asParent, int alState)
     {
          SetMessage("Messages", "RunandHide1", 0);
     }

     //===========================================
     // This runs when the player enters the map
     void OnEnter()
     {
     }

     //===========================================
     // This runs when the player leaves the map
     void OnLeave()
     {
     }

I get an error message saying Unexpected token on the 16th line of this character: "{"


The second collide function is causing the problem. What's wrong with it?


RE: More script errors! - vcplz - 02-05-2012

The AddEntityCollideCallback's should be in the same area, this instance the onstart
and each calls for their own func.
so just copy and paste the second one underneath the first callback


RE: More script errors! - Strembitsky - 02-05-2012

(02-05-2012, 01:07 AM)vcplz Wrote: The AddEntityCollideCallback's should be in the same area, this instance the onstart
and each calls for their own func.
so just copy and paste the second one underneath the first callback
Thanks a lot!