Frictional Games Forum (read-only)

Full Version: Need help with a scripting problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
KK, So Im trying to make a door slam shut, like in the main Amnesia, and I think I got the script right and all that, but everytime I try to start up my Amnesia to check and see if it works it crashes and sais there was a fatal error, wtf Sad


Here's the entire .hps file.


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "chamberkey", "chamberdoor", "FUNCTION", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("chamberdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("chamberkey");
SetSwingDoorClosed("doorslam", true, true);

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("doorslam", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Can anyone of you fine gentleman see a problem here?
Close your FUNCTION function.