Frictional Games Forum (read-only)
KeyDrop - 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: KeyDrop (/thread-25110.html)



KeyDrop - MacKetchup - 04-19-2014

I want my Key to drop from the door frame after reading the note. But it doesn't work

I would appreciate if someone could help me

AddEntityCollideCallback("Player", "note_generic_1",
"DoorKeyFallWhenReadingNote", true);

void DoorKeyFallWhenReadingNote(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("key_study_1", true);
SetMessage("Messages", "LoL", 0);
}



RE: KeyDrop - Neelke - 04-19-2014

It might be that you're trying to activate the key when player has read note, am I right?

Code:
void OnStart()
{
     SetEntityCallbackFunc("note_generic_1", "DoorKeyFallWhenReadingNote");
}

void DoorKeyFallWhenReadingNote(string &in asEntity, string &in asType)
{
     SetEntityActive("key_study_1", true);
     SetMessage("Messages", "LoL", 0);
}



RE: KeyDrop - MacKetchup - 04-19-2014

Yes correct

just wanted to thank you for making the key active but my message isn't showing up Tongue

SetMessage("Messages", "LoL", 0);

<CATEGORY Name="Messages">

<Entry Name ="msgname">The door is locked.</Entry>
<Entry Name ="LoL">I think i heard something by the door.</Entry>

</CATEGORY>

What can i do to fix it or is it even possible ?


RE: KeyDrop - Mudbill - 04-19-2014

The last number can't be 0, or else it will disappear instantly. That number represents the time the message is displayed. I recommend 3, but I think if you set it to -1, it will be displayed for a time depending on the length of the string.


RE: KeyDrop - MacKetchup - 04-19-2014

Just want to thank you for the help both of you. Big Grin