Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What's wrong with this script?
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#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
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#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
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#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
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#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
Website Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#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
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#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




Users browsing this thread: 1 Guest(s)