12-27-2011, 07:56 PM
So I'm making my map in amnesia level editor, everything's just fine. But then I wanna start my scripting. So I add a function, and it's works perfectly fine, but when I try to add a new function there's an error when I start up my custom story! D: I dunno what the problem is D:
Here's the error message:
Uploaded with ImageShack.us
Here's my script:
void OnStart()
{
AddEntityCollideCallback("Player", "door_slamHousekeeper", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("HousekeeperDoor", true, false);
PlaySoundAtEntity("DoorSlamSound", "scare_slam_door.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
{
AddEntityCollideCallback("Player", "NoOil", "Collide_Area", true, 1);
}
void Collide_Area(string &in asParent, string &in asChild, int alState)
{
SetPlayerLampOil(0.0f);
}
{
AddUseItemCallback("", "FirstRoomKey_1", "BedroomDoorFirst_1", "unlock_door", true);
}
void unlock_door(string &in FirstRoomKey_1, string &in BedroomDoorFirst_1)
{
SetSwingDoorLocked(BedroomDoorFirst_1, false, true);
PlaySoundAtEntity("", "unlock_door", BedroomDoorFirst_1, 0, false);
RemoveItem(FirstRoomKey_1);
}
void OnEnter()
{
}
void OnLeave()
{
}
Please help me!
Here's the error message:
Uploaded with ImageShack.us
Here's my script:
void OnStart()
{
AddEntityCollideCallback("Player", "door_slamHousekeeper", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("HousekeeperDoor", true, false);
PlaySoundAtEntity("DoorSlamSound", "scare_slam_door.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
{
AddEntityCollideCallback("Player", "NoOil", "Collide_Area", true, 1);
}
void Collide_Area(string &in asParent, string &in asChild, int alState)
{
SetPlayerLampOil(0.0f);
}
{
AddUseItemCallback("", "FirstRoomKey_1", "BedroomDoorFirst_1", "unlock_door", true);
}
void unlock_door(string &in FirstRoomKey_1, string &in BedroomDoorFirst_1)
{
SetSwingDoorLocked(BedroomDoorFirst_1, false, true);
PlaySoundAtEntity("", "unlock_door", BedroomDoorFirst_1, 0, false);
RemoveItem(FirstRoomKey_1);
}
void OnEnter()
{
}
void OnLeave()
{
}
Please help me!