Frictional Games Forum (read-only)
Keys opening doors - 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: Hints, help and spoilers (https://www.frictionalgames.com/forum/forum-34.html)
+--- Thread: Keys opening doors (/thread-8455.html)



Keys opening doors - RangerEDinc - 06-04-2011

So I am building a custom story and ive ran across a problem, i have tried to get everything working, im following a tutorial from youtube and everything goes well until the end. When i load up my save it gives me this error message due to the .hps file that I edited. Here is the error message.

FATAL ERROR: Could not load script file 'custom_stories/First Story/maps/entrymap.hps'!
main (27,2) :ERR :Unexpected end of file

Please help so i can continue with my custom story =)





RE: Keys opening doors - RawkBandMan - 06-05-2011

Post your entrymap.hps file here.


RE: Keys opening doors - RangerEDinc - 06-08-2011

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "ClosetKey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("ClosetKey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}


RE: Keys opening doors - WatzUpzPeepz - 06-08-2011

Well I can't see the problem but remove the voidOnLeave and on enter voids,you dont need them for the basic script you have posted. I counted the lines and I think the error is comming from the voidOnLeave so remove it.


RE: Keys opening doors - Roenlond - 06-08-2011

void UsedKeyOnDoor(string &in asItem, string &in asEntity

You forgot an end bracket.


RE: Keys opening doors - RangerEDinc - 06-08-2011

Ok it loads now, but the door i want locked (mansion_1) isnt locked, but i can still use the key with the door. Help..again?