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
Whats wrong with this script!? D:
Author Message
teddifisk Offline
Senior Member

Posts: 303
Joined: Dec 2010
Reputation: 2
Post: #1
Whats wrong with this script!? D:
Hi.

When I try entering "mansionentrance.map" I get fatal error. Sad

Can anybody see whats wrong with my script???

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Cleaned", "NeedsCleaning", true, 1);
AddEntityCollideCallback("Player", "Patrol", "GoPath", true, 1);
AddEntityCollideCallback("Grunt1", "DisappearArea", "Disappear", true, 1);
}

void NeedsCleaning(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Cleaned", "react_breath1.ogg", "Player", 0.0, false);
SetMessage("JohnatanThoughts", "Thought9", 0);
}

void GoPath(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode(Grunt1, PathNodeArea_1, 0.0f, "");
}

void Disappear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Grunt1",false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("01_amb_darkness.ogg", true, 1, 3, 0, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

03-21-2011 05:49 PM
Find all posts by this user Quote this message in a reply
jens Offline
Frictional Games

Posts: 3,107
Joined: Apr 2006
Reputation: 103
Post: #2
RE: Whats wrong with this script!? D:
You don't have any "" around Grunt1 and PathNodeArea_1.

Best to do is to run Amnesia with a working .hps file before you start to edit it, then you use the F1 menu to reload the level, which will bring up an ingame window with a problem report if there is something wrong in the script. It tells you what the error(s) is and on which line to look, with a bit of practice you can learn what type of error is usually what and where it originates from.
03-21-2011 05:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




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