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
Hey ! Welcome back to the modding then : D.
The best way to do this imho is to use Examine areas. They are in the area tab, all you have to do is put an area around the item that'll display the message, and then define the category and entry in the lang file.
Hope to see more about your mod soon ! : )
(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.

Um, it can be done simplier.
Just put the "sign" area around the object, then click on it, and select area from the right side toolbar and now:
1)Make sure you have "Messages" category in your extra_english.lang
2)Create a new entry in the messages category, like the guy above me wrote, and put the name from your lang into the empty field in level editor.
Here is the example:
Ups, lazzer is right ! It's sign area, not examine. My bad : >.
Oh I didn't know that.. Seems like I learned something myself.
(02-02-2014, 11:12 PM)daortir Wrote: [ -> ]Ups, lazzer is right ! It's sign area, not examine. My bad : >.
Well the examine area worked with his code but the message is displayed twice;
Once when you move the cursor into the area
Again when you move the cursor from being inside the examine area to out of it.
Just change the false to true in the SetEntityPlayerLookAtCallback

(02-03-2014, 08:56 PM)Romulator Wrote: [ -> ]Just change the false to true in the SetEntityPlayerLookAtCallback 
Thanks, this fixed the issue.
HELLO.
I AM GOING TO STOP BACKSEAT MODERATING ALREADY.
HAVE A GOOD DAY.