(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.