Frictional Games Forum (read-only)
Need help to make key react when use for door. - 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: Need help to make key react when use for door. (/thread-7225.html)



Need help to make key react when use for door. - ZxBrad - 04-06-2011

Hey i just made a really small script a key to door script and i got the key item name and description working and all i need is just having it work on the door and i got the script done. But the door just doesnt want to work with the door heres my script

Quote:////////////////////////////
// Run first time starting map
void OnStart()
{
SetMessage("Journal", "start", 8.0f);
AddUseItemCallback("", "doorkey_1", "castle_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnCabinet(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("doorkey_1");
}

plz and thx for some replys.


RE: Need help to make key react when use for door. - Linus Ă…gren - 04-07-2011

In your Callback, you named the func UseKeyOnDoor, but you named it UseKeyOnCabinet in your actual func. :>


RE: Need help to make key react when use for door. - ZxBrad - 04-07-2011

(04-07-2011, 06:50 AM)junkfood2121 Wrote: In your Callback, you named the func UseKeyOnDoor, but you named it UseKeyOnCabinet in your actual func. :>

It did say that, but i changed it to Door before i tried it on the game.


RE: Need help to make key react when use for door. - Austums - 04-07-2011

Make sure your CustomSubItemTypeName is named the same as your entity. If you don't know what the CustomSub is, click the key or door and click on the entity tab. Scroll to the bottom and name it doorkey_1

Should work! I remember I had the same problem as well. xP