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
Script Help Display Message When Looking At Sign/Script Area
Kixz0 Offline
Junior Member

Posts: 16
Threads: 3
Joined: Apr 2013
Reputation: 0
#3
RE: Display Message When Looking At Sign/Script Area

(02-02-2014, 09:59 PM)FurtherGames Wrote: So, here I am again. It seems like this time last year I was posting other script level issues. I'm looking for a command that will display a message when the player looks at a specific sign or script area.

Probably seems like a really simple thing, but I stopped working on my custom story for around 9 months, so I've basically forgotten everything.

The character finds himself in a motel/hotel whatever. Next to each door there's a sign displaying the room number. Even though the player will be able to tell which room it is, I still would like some sort of script so that when the player looks at the sign, a message is displayed such as the room number.

E.g

Player looks at sign for Room Door 2
Message displayed "Room 2"

I


void OnStart()
{
SetEntityPlayerLookAtCallback("SignNameInGame", "DisplayMessage", false);
}

void DisplayMessage(string &in asEntity, int alState)
{
SetMessage("CategorySignText", "TextSignText", 3);
}


Also you'll need this in your .lang file

<CATEGORY Name="CategorySignText">
<Entry Name="TextSignText">TEXT ON SIGN HERE</Entry>
</CATEGORY>

And I guess you already got
<LANGUAGE>
And
</LANGUAGE>
in your .lang file, so just put the Category thingy between it.



It shows the text you put into your .lang time for 3 seconds. You can change it by changing the number 3 in the script. I'm not sure how to make so the text dissapears when you look away from the sign. But probably with a few "if-statements". Hope it's helpful. Smile
(This post was last modified: 02-02-2014, 10:09 PM by Kixz0.)
02-02-2014, 10:08 PM
Find


Messages In This Thread
RE: Display Message When Looking At Sign/Script Area - by Kixz0 - 02-02-2014, 10:08 PM



Users browsing this thread: 1 Guest(s)