Frictional Games Forum (read-only)
[SCRIPT] How to appear a text message on screen? - 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] How to appear a text message on screen? (/thread-16704.html)



How to appear a text message on screen? - Demondays1 - 07-03-2012

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.


RE: How to appear a text message on screen? - jamesclarke555 - 07-03-2012

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.


RE: How to appear a text message on screen? - Steve - 07-03-2012

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>


RE: How to appear a text message on screen? - ApeCake - 07-03-2012

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.


RE: How to appear a text message on screen? - Steve - 07-03-2012

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


RE: How to appear a text message on screen? - SilentHideButFine - 07-04-2012

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


RE: How to appear a text message on screen? - Demondays1 - 07-04-2012

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)


RE: How to appear a text message on screen? - Cruzore - 07-05-2012

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.