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
Need help with a scripting problem
Author Message
Khan Offline
Member

Posts: 61
Joined: Aug 2011
Reputation: 0
Post: #1
Need help with a scripting problem
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?
08-15-2011 01:46 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,239
Joined: Jul 2011
Reputation: 216
Post: #2
RE: Need help with a scripting problem
Close your FUNCTION function.

Tutorials: From Noob to Pro
08-15-2011 02:32 AM
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)