[SCRIPT] Display Message When Looking At Sign/Script Area - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [SCRIPT] Display Message When Looking At Sign/Script Area (/thread-24521.html) |
Display Message When Looking At Sign/Script Area - FurtherGames - 02-02-2014 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 RE: Display Message When Looking At Sign/Script Area - daortir - 02-02-2014 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 ! : ) RE: Display Message When Looking At Sign/Script Area - Kixz0 - 02-02-2014 (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. 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. RE: Display Message When Looking At Sign/Script Area - Slanderous - 02-02-2014 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: Spoiler below!
RE: Display Message When Looking At Sign/Script Area - daortir - 02-02-2014 Ups, lazzer is right ! It's sign area, not examine. My bad : >. RE: Display Message When Looking At Sign/Script Area - Kixz0 - 02-02-2014 Oh I didn't know that.. Seems like I learned something myself. RE: Display Message When Looking At Sign/Script Area - FurtherGames - 02-03-2014 (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. RE: Display Message When Looking At Sign/Script Area - Romulator - 02-03-2014 Just change the false to true in the SetEntityPlayerLookAtCallback RE: Display Message When Looking At Sign/Script Area - FurtherGames - 02-03-2014 (02-03-2014, 08:56 PM)Romulator Wrote: Just change the false to true in the SetEntityPlayerLookAtCallback Thanks, this fixed the issue. RE: Display Message When Looking At Sign/Script Area - DnALANGE - 02-03-2014 HELLO. I AM GOING TO STOP BACKSEAT MODERATING ALREADY. HAVE A GOOD DAY. |