Use key to unlock door script, but the script crashes my level? - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Use key to unlock door script, but the script crashes my level? (/thread-7020.html) |
Use key to unlock door script, but the script crashes my level? - Austums - 03-23-2011 Hi guys. I just added this to my hps Code: void OnStart() The AddUseItemCallback is where the key stuff starts, obviously. I don't see what the problem is. I named everything correctly. Oh, here's the error I get main (28,5) : ERR: No matching signatures to 'SetLevelDoorLocked(string@&, const bool, const bool)' RE: Use key to unlock door script, but the script crashes my level? - Viperdream - 03-23-2011 What does the error say? EDIT: Nevermind, this is what's wrong, you left the name open. Code: AddUseItemCallback("KeyOnDoor", "key_study_1", "level_wood_1", "KeyOnDoor", true); //Fix'd code This should help RE: Use key to unlock door script, but the script crashes my level? - Austums - 03-23-2011 Updated my original post with the error. Still getting an error :/ ERR: No matching signatures to 'SetLevelDoorLocked(string@&, const bool, const bool)' I'll post my entire script. Everything works fine when I take out this new door script, btw. Also thank you for your help! Code: void OnEnter() RE: Use key to unlock door script, but the script crashes my level? - Viperdream - 03-23-2011 Wait, now I see the problem Remove the last "true" of the SetLevelDoorLocked Level doors don't have an effect RE: Use key to unlock door script, but the script crashes my level? - Austums - 03-23-2011 Good news is the level ran! Bad news is, the door wasn't even locked. xD Do I lock a door from the Level Editor? RE: Use key to unlock door script, but the script crashes my level? - Viperdream - 03-23-2011 Yup You can also do that in the script with Code: void OnStart() But that's kind of a waste of time |