Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What's wrong with this script?
Author Message
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #1
What's wrong with this script?
//===========================================
     // 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.
(This post was last modified: 02-05-2012 12:08 AM by Strembitsky.)
02-05-2012 12:08 AM
Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 868
Joined: Aug 2011
Reputation: 26
Post: #2
RE: What's wrong with this script?
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!

The Interrogation
Chapter 1

My tutorials
02-05-2012 12:10 AM
Find all posts by this user Quote this message in a reply
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #3
RE: What's wrong with this script?
(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?
02-05-2012 12:13 AM
Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 868
Joined: Aug 2011
Reputation: 26
Post: #4
RE: What's wrong with this script?
[void FadeEnemyToSmoke(string& servant_grunt, bool abPlaySound);]

must be

FadeEnemyToSmoke("servant_grunt", true);

The Interrogation
Chapter 1

My tutorials
02-05-2012 12:19 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,236
Joined: Jul 2011
Reputation: 216
Post: #5
RE: What's wrong with this script?
FYI, square brackets are normally used for accessing array indexes.

Tutorials: From Noob to Pro
02-05-2012 12:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #6
RE: What's wrong with this script?
(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
02-05-2012 12:24 AM
Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 868
Joined: Aug 2011
Reputation: 26
Post: #7
RE: What's wrong with this script?
Glad that I was helpful Smile

The Interrogation
Chapter 1

My tutorials
02-05-2012 12:25 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)