Frictional Games Forum (read-only)
Unlocking Level Doors with Item Pick-Up. - 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: Unlocking Level Doors with Item Pick-Up. (/thread-23134.html)



Unlocking Level Doors with Item Pick-Up. - mmeowwcat - 09-14-2013

Hello everybody, I am having some trouble with scripting. I am very new with scripting, but I have done some work and get what functions do, and how they do it. I also understand the .lang file fairly well also. So, my problem is, I want a level door that is usually locked, to become unlocked when I pick up the lantern. I have tried
Code:
SetLevelDoorLocked(string& asName, bool abLocked);
with the bool set to both true and false, with no difference, the door is still locked. If it helps, I have lantern set as the PlayerInteractCallBack, and in that function I have the code above, and a message that does display properly. Any help on this matter would be greatly appreciated.

Regards
mmeowwcat


RE: Unlocking Level Doors with Item Pick-Up. - Tomato Cat - 09-14-2013

Are you sure that it's a lever door and not a swing door? Swing doors are the ones that you can push and pull open.

Also, ensure that you callbacks and items match. But if you still need help, post your script file.


RE: Unlocking Level Doors with Item Pick-Up. - Daemian - 09-14-2013

Check the door's name, try to set it inactive with SetEntityActive to test.


RE: Unlocking Level Doors with Item Pick-Up. - DnALANGE - 09-14-2013

SetEntityPlayerInteractCallback("YOURITEM", "AfterPickUpLantern", true);
---
void AfterPickUpLantern(string &in asItem)
{
PlaySoundAtEntity("", "unlock_door", "YOURLEVELDOOR", 0, false);
SetLevelDoorLocked("YOURLEVELDOOR", false);
}

---*FOR SWINGDOOR*---
SetSwingDoorLocked("YOURSWINGDOOR", false, true);

Maybe this would work.


RE: Unlocking Level Doors with Item Pick-Up. - mmeowwcat - 09-14-2013

DnALANGE your answer actually worked, thank you so much. Also, thank you to everybody else who took time out of their day to try and help me out with this.