Frictional Games Forum (read-only)
[SCRIPT] .Hps File Failing - 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: [SCRIPT] .Hps File Failing (/thread-30116.html)



.Hps File Failing - Caleb4eva - 06-10-2015

So I have been working on a custom story for a bit now and I have gotten to the point where I needed to have a key unlock a level door,After using the .Hps file and typing in the code for it to work when ever I try to load the custom story map in game I recieve a failure notice that says this:FATAL ERROR:Could not load script file customstories/The Garden/maps/The Garden.hps'!
main (14,1) :ERR :Expected ',' or ';'. Here is the hps file code:void OnStart()
{
AddUseItemCallback("", "Room Key_1", "mansiondoor_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("mansiondoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Room key_1", 0, false);
RemoveItem("Room Key_1");
}
void OnEnter ()

}

void OnLeave ()
{

}


RE: .Hps File Failing - DnALANGE - 06-10-2015

Quote:void OnEnter ()

}

Should be:

PHP Code:
void OnEnter ()
{


You have missed 1 bracket -> {

-----
HINT:
main (14,1) = meaning LINE 14 has got an error and 1 = first letter or ANY first thing you miss or added.

Not sure what you have for making scripts..
I guess, almost all of us is using NotePad++
Free to download and it can show you the errors (if you have the right plugin enabled) and lines are more easy to see.


RE: .Hps File Failing - Caleb4eva - 06-11-2015

Thank you so much! It fixed when I added it.