Frictional Games Forum (read-only)

Full Version: Keys opening doors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 =)


Post your entrymap.hps file here.
////////////////////////////
// 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()
{

}
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.
void UsedKeyOnDoor(string &in asItem, string &in asEntity

You forgot an end bracket.
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?