Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Message Appears when you look at an entity
Iyiyt Offline
Junior Member

Posts: 13
Threads: 5
Joined: Jul 2012
Reputation: 0
#1
Message Appears when you look at an entity

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;
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.
(This post was last modified: 08-07-2012, 11:17 PM by Iyiyt.)
07-28-2012, 04:49 AM
Find
ElectricRed Offline
Member

Posts: 106
Threads: 13
Joined: Jun 2012
Reputation: 5
#2
RE: Message Appears when you look at an entity

Try this:

void OnEnter()
{
ChangePlayerStateToNormal();

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

void JimmyOne(string &in asEntity, int alState)
{
SetMessage("Message", "JimmyMessageOne", 6.0f);
}

[Image: 9lkjf4.jpg]

(This post was last modified: 07-28-2012, 05:01 AM by ElectricRed.)
07-28-2012, 05:01 AM
Find
Iyiyt Offline
Junior Member

Posts: 13
Threads: 5
Joined: Jul 2012
Reputation: 0
#3
RE: Message Appears when you look at an entity

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.
(This post was last modified: 08-07-2012, 11:17 PM by Iyiyt.)
08-07-2012, 10:46 PM
Find




Users browsing this thread: 1 Guest(s)