Frictional Games Forum (read-only)

Full Version: KeyDrop
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);
}
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);
}
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 ?
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.
Just want to thank you for the help both of you. Big Grin