Frictional Games Forum (read-only)

Full Version: Message Appears when you look at an entity
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sigh... need more help. I'm trying to make a message appear when I look at an entity. It's name and Callback Func in the Level Editor are JimmyOne. Here's my code;
Code:
void OnEnter()
{
ChangePlayerStateToNormal();
SetEntityPlayerLookAtCallback("JimmyOne", "JimmyOne", true);
}

void JimmyOne()
{
SetMessage("Message", "JimmyMessageOne", 6.0f);
}
In the LANG file, the category is Message and the name is JimmyMessageOne, so that isn't the problem.
Any help is always appreciated.
Try this:

Code:
void OnEnter()
{
ChangePlayerStateToNormal();

SetEntityPlayerLookAtCallback("JimmyOne", "JimmyOne", true);
}

void JimmyOne(string &in asEntity, int alState)
{
SetMessage("Message", "JimmyMessageOne", 6.0f);
}
Sorry, that isn't working. Can you think of another way I could do this? I notice there is a PlayerLookAtCallback on the entity on the level editor. I have that set as JimmyOne as well, but is there another script I could use to make it put up a message when I look at Jimmy? (On a side note, does the thing you look at have to be an entity you can interact with?)

Nevermind! I just stuck a hollow point needle in his chest (I was going to use one anyway), and named it JimmyOne (along with CallbackFunc and PlayerLookAt), and it worked when I looked at the needle. Thanks for your help.