Frictional Games Forum (read-only)

Full Version: What's wrong with this script?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)      
     {
          [void FadeEnemyToSmoke(string& servant_grunt, bool abPlaySound);]
     }

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

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


It is meant to poof away a monster once you enter the area. Whenever I try to open the map in Amnesia, the game stops responding with an always unique error message.
I recommend watching this:

http://wiki.frictionalgames.com/hpl2/tut...ng/article

It gives you basic idea of scripting Smile. There are more tutorials in wiki!
(02-05-2012, 12:10 AM)Elven Wrote: [ -> ]I recommend watching this:

http://wiki.frictionalgames.com/hpl2/tut...ng/article

It gives you basic idea of scripting Smile. There are more tutorials in wiki!
I have! I also am currently following the tutorial on the wiki. Nothing is different in my code than the one on the wiki. Also, the error message always says that the code on the 13th line isn't right, so that means the function isn't written correctly. Could you please help?
[void FadeEnemyToSmoke(string& servant_grunt, bool abPlaySound);]

must be

FadeEnemyToSmoke("servant_grunt", true);
FYI, square brackets are normally used for accessing array indexes.
(02-05-2012, 12:19 AM)Elven Wrote: [ -> ][void FadeEnemyToSmoke(string& servant_grunt, bool abPlaySound);]

must be

FadeEnemyToSmoke("servant_grunt", true);
Thank you oh so very much Smile


Glad that I was helpful Smile