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 How to appear a text message on screen?
Demondays1 Offline
Member

Posts: 57
Threads: 7
Joined: Jun 2012
Reputation: 0
#1
Tongue  How to appear a text message on screen?

Yes, Im still in development in my new map, I need to know what script is called when it shows the text on the screen.

Intel HD Lag fix: tiny.cc/pyv1gw
07-03-2012, 07:23 AM
Find
jamesclarke555 Offline
Junior Member

Posts: 34
Threads: 2
Joined: Jan 2012
Reputation: 0
#2
RE: How to appear a text message on screen?

If you haven't already, you'll need to create an english.lang file; this will contain the information for your messages. Read up on that here.

But it will look something like this:

<CATEGORY Name="Messages">
<Entry Name="Message01">Hello world</Entry>
</CATEGORY>

Now in your map script file, use the following to call the message (obviously, this has to be called using a function, how you do this is up to you):

SetMessage("Messages", " Message01", 0.0f);

The float value (0.0f) determines how long the message is displayed.

- Parasomnia -
[Image: SxShD]
07-03-2012, 09:00 AM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#3
RE: How to appear a text message on screen?

This should work you only have to fill in the area's
void OnStart()
{
SetEntityPlayerInteractCallback("NAME_OF_OBJECT", "MSG", false);
}
void MSG(string &in entity)
{
SetMessage("Messages", "msgname", 0);
}
And in the .LANG file

<CATEGORY Name="Messages">
<Entry Name="msgname">Put Text Here.</Entry>
</CATEGORY>
(This post was last modified: 07-03-2012, 08:44 PM by Steve.)
07-03-2012, 06:11 PM
Find
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#4
RE: How to appear a text message on screen?

If you don't want to activate it when doing stuff and just want to see it instantly (probably for testing purposes I guess) use this;

void OnStart()
{
SetMessage("Messages", "NameofMessage", 0);
}

For the .lang part see james' post.
And Steve, as far as I'm concerned the O and S in OnStart need to be capitalized.
07-03-2012, 08:16 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#5
RE: How to appear a text message on screen?

(07-03-2012, 08:16 PM)ApeCake Wrote: If you don't want to activate it when doing stuff and just want to see it instantly (probably for testing purposes I guess) use this;

void OnStart()
{
SetMessage("Messages", "NameofMessage", 0);
}

For the .lang part see james' post.
And Steve, as far as I'm concerned the O and S in OnStart need to be capitalized.
I saw I forgot the capilization, I changed it immediately Tongue
It should work now.
(This post was last modified: 07-03-2012, 08:47 PM by Steve.)
07-03-2012, 08:45 PM
Find
SilentHideButFine Offline
Member

Posts: 156
Threads: 38
Joined: May 2012
Reputation: 6
#6
RE: How to appear a text message on screen?

void OnStart()
{
SetEntityPlayerInteractCallback("NAME_OF_OBJECT", "MSG", false);
}

void MSG(string &in entity)
{
SetMessage("Messages", "msgname", 1); //shows the message
}
.LANG file

<CATEGORY Name="Messages"> // start the category
<Entry Name="massage">put the message text here</Entry>
</CATEGORY> // ends the category

[url= http://www.moddb.com/mods/jessehmusic [/url] ,HOSPITAL OF HORROR MOD
07-04-2012, 11:06 PM
Find
Demondays1 Offline
Member

Posts: 57
Threads: 7
Joined: Jun 2012
Reputation: 0
#7
RE: How to appear a text message on screen?

Ok, how does it trigger it? do I have to put a script?

Lets saay for example that a monster was looking for you, I want it to say Hide somewhere when the monster spawns (No im not going to put this text on the game) (Dont wanna spoil the map)

Intel HD Lag fix: tiny.cc/pyv1gw
07-04-2012, 11:51 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#8
RE: How to appear a text message on screen?

just by a short part of the script you spoil nothing. Trust me.
So, to trigger it, there are multiple ways. Since you want to activate it when the monster spawns, put it right under the SetEntityActive of that monster.

Think, before you speak Google, before you post
07-05-2012, 12:03 AM
Find




Users browsing this thread: 1 Guest(s)