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
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#1
Bug  Display Message When Looking At Sign/Script Area

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
02-02-2014, 09:59 PM
Find
daortir Offline
Senior Member

Posts: 422
Threads: 9
Joined: Sep 2013
Reputation: 18
#2
RE: Display Message When Looking At Sign/Script Area

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, 10:07 PM
Find
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
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#4
RE: Display Message When Looking At Sign/Script Area

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!
[Image: 20zzkmg.jpg]
02-02-2014, 10:49 PM
Find
daortir Offline
Senior Member

Posts: 422
Threads: 9
Joined: Sep 2013
Reputation: 18
#5
RE: Display Message When Looking At Sign/Script Area

Ups, lazzer is right ! It's sign area, not examine. My bad : >.

02-02-2014, 11:12 PM
Find
Kixz0 Offline
Junior Member

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

Oh I didn't know that.. Seems like I learned something myself.
02-02-2014, 11:42 PM
Find
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#7
RE: Display Message When Looking At Sign/Script Area

(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.
02-03-2014, 05:37 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#8
RE: Display Message When Looking At Sign/Script Area

Just change the false to true in the SetEntityPlayerLookAtCallback Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
02-03-2014, 08:56 PM
Find
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#9
RE: Display Message When Looking At Sign/Script Area

(02-03-2014, 08:56 PM)Romulator Wrote: Just change the false to true in the SetEntityPlayerLookAtCallback Smile

Thanks, this fixed the issue.
02-03-2014, 09:27 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#10
RE: Display Message When Looking At Sign/Script Area

HELLO.

I AM GOING TO STOP BACKSEAT MODERATING ALREADY.

HAVE A GOOD DAY.
(This post was last modified: 02-04-2014, 12:12 AM by Traggey.)
02-03-2014, 11:28 PM
Find




Users browsing this thread: 2 Guest(s)