Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Item Interaction
Author Message
Russ Money Offline
Senior Member

Posts: 360
Joined: Dec 2010
Reputation: 3
Post: #1
Item Interaction
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"

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?
01-05-2011 05:53 AM
Find all posts by this user Quote this message in a reply
Equil Offline
Member

Posts: 94
Joined: Sep 2010
Reputation: 0
Post: #2
RE: Item Interaction
Look here:

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

And here:

http://www.frictionalgames.com/forum/thread-4785.html
01-05-2011 06:24 AM
Find all posts by this user Quote this message in a reply
Russ Money Offline
Senior Member

Posts: 360
Joined: Dec 2010
Reputation: 3
Post: #3
RE: Item Interaction
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.
01-05-2011 06:42 AM
Find all posts by this user Quote this message in a reply
Equil Offline
Member

Posts: 94
Joined: Sep 2010
Reputation: 0
Post: #4
RE: Item Interaction
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);
}
(This post was last modified: 01-05-2011 07:43 AM by Equil.)
01-05-2011 07:10 AM
Find all posts by this user Quote this message in a reply
Russ Money Offline
Senior Member

Posts: 360
Joined: Dec 2010
Reputation: 3
Post: #5
RE: Item Interaction
It worked, once again, thank you! Guess I should just start PMing you, Equil!
01-05-2011 08:11 AM
Find all posts by this user Quote this message in a reply
Equil Offline
Member

Posts: 94
Joined: Sep 2010
Reputation: 0
Post: #6
RE: Item Interaction
Haha, go ahead, I'll be happy to help. Smile
01-05-2011 08:13 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)