Frictional Games Forum (read-only)

Full Version: Item Interaction
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Thanks once again to you guys and your quick replies but, I've run into another problem.

I want to make a simple trigger where when the player interacts with an entity, that it will trigger something.

What I have so far is this, I've made a office with a single level door and a note on the desk. The level door is started locked. I want the letter to be the reason the door is locked and once the player picks up said letter, the level door unlocks. I also want the door to give a message while it's locked.

Here's what I got so far, if anyone can help out:
The name of the note entity is "albert_letter" the level door is named "begin_door"

Code:
void OnStart()
{
SetEntityPlayerInteractCallback("albert_letter", "begindoor1", true);
}
void begindoor1(string &in asParent, string &in asChild, int alState)
{
    SetLevelDoorLocked("begin_door", false);
}

Do I need to make entries into the .lang file? If so, what are the categories for locked doors?

Once last thing, how do I add narrations to letters?
Sorry, guess I should have been more specific, I'm very able to make notes that add to the journal, I just can't get the note to change the level door from locked to unlocked.
Wait.. so what you're saying is you want a note to act like a key on the door?

EDIT: Ah, I see the problem I think. You're using the collide callback syntax for your function to call, and not the Interact callback syntax.

You can find all the functions syntax listed here: http://wiki.frictionalgames.com/hpl2/amn..._functions

Try this:

void OnStart()
{
SetEntityPlayerInteractCallback("albert_letter", "begindoor1", true);
}
void begindoor1(string &in asEntity)
{
SetLevelDoorLocked("begin_door", false);
}
It worked, once again, thank you! Guess I should just start PMing you, Equil!
Haha, go ahead, I'll be happy to help. Smile