02-01-2013, 10:31 PM
I made a script for a map, where simply there's a key and there's a door. Mix those together and you know what. Well, the problem is, my script isn't working. Amnesia crashes when I play the map and shows an Error message. I've tried looking it over multiple times and checking the script functions with: http://wiki.frictionalgames.com/hpl2/amn..._functions
but to no help.
Anyone that could help?
Script:
Am I supposed to change: (string &in asItem, string &in asEntity) with the key and door name or what?
but to no help.
Anyone that could help?
Script:
Spoiler below!
void OnStart()
{
AddUseItemCallback("", "key_1","door_1", "opendoor_1", true);
}
void opendoor_1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
CompleteQuest("lockeddoorquest_1", "LockedDoorQuest_1", 0);
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("door_1") == true)
{
AddQuest("lockeddoorquest_1", "LockedDoorQuest_1", 0);
}
}
void OnEnter()
{
}
void OnLeave()
{
}
{
AddUseItemCallback("", "key_1","door_1", "opendoor_1", true);
}
void opendoor_1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
CompleteQuest("lockeddoorquest_1", "LockedDoorQuest_1", 0);
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("door_1") == true)
{
AddQuest("lockeddoorquest_1", "LockedDoorQuest_1", 0);
}
}
void OnEnter()
{
}
void OnLeave()
{
}
Am I supposed to change: (string &in asItem, string &in asEntity) with the key and door name or what?