Frictional Games Forum (read-only)
Can't find the problem in my script? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Can't find the problem in my script? (/thread-20136.html)



Can't find the problem in my script? - Tiger - 02-01-2013

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/amnesia/script_functions
but to no help.

Anyone that could help? Undecided

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()
{
}

Am I supposed to change: (string &in asItem, string &in asEntity) with the key and door name or what?


RE: Can't find the problem in my script? - Your Computer - 02-01-2013

CompleteQuest and AddQuest do not take in a third argument.


RE: Can't find the problem in my script? - Tiger - 02-01-2013

(02-01-2013, 10:48 PM)Your Computer Wrote: CompleteQuest and AddQuest do not take in a third argument.

Well, Now I feel very stupid... I read statyk's sticky post but couldn't find the incorrect part. Thanks again. Confused