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



Item Interaction - Russ Money - 01-05-2011

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?


RE: Item Interaction - Equil - 01-05-2011

Look here:

http://www.frictionalgames.com/forum/thread-4407.html

And here:

http://www.frictionalgames.com/forum/thread-4785.html


RE: Item Interaction - Russ Money - 01-05-2011

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.


RE: Item Interaction - Equil - 01-05-2011

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/amnesia/script_functions

Try this:

void OnStart()
{
SetEntityPlayerInteractCallback("albert_letter", "begindoor1", true);
}
void begindoor1(string &in asEntity)
{
SetLevelDoorLocked("begin_door", false);
}


RE: Item Interaction - Russ Money - 01-05-2011

It worked, once again, thank you! Guess I should just start PMing you, Equil!


RE: Item Interaction - Equil - 01-05-2011

Haha, go ahead, I'll be happy to help. Smile