Frictional Games Forum (read-only)
[LVL ED] Key scripting - 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: [LVL ED] Key scripting (/thread-17064.html)



Key scripting - Redzombie18 - 07-18-2012

Hello Peoples
Of course by the title you know im a noob at Custom story making Tongue
So i want a locked door and you need a key. I followed a tutorial on how to do it, but when i coded it, The custom story crashed. If you can respond Thanks. I might need more help with more Questions soooo if you want to you can add me on:
Steam: Redzombie18
Skype:brianliebrand
Thanks
Redzombie18


RE: Key scripting - HoyChampoy - 07-18-2012

(07-18-2012, 04:35 AM)Redzombie18 Wrote: Hello Peoples
Of course by the title you know im a noob at Custom story making Tongue
So i want a locked door and you need a key. I followed a tutorial on how to do it, but when i coded it, The custom story crashed. If you can respond Thanks. I might need more help with more Questions soooo if you want to you can add me on:
Steam: Redzombie18
Skype:brianliebrand
Thanks
Redzombie18
void OnStart()
{
AddUseItemCallback("", "nameofkey", "nameofdoor", "KeyOnDoor", true);
}



void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("nameofdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "nameofdoor", 0, false);
AddPlayerSanity(25);
RemoveItem("nameofkey");
}

Welcome To the forums Smile