Frictional Games Forum (read-only)

Full Version: Display messages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hey guys,

i wanted to display a message when the player starts. but just doesnt works.

this is in the .hps :
AddTimer("intro_message", 5, "SetMessage");

void SetMessage(string &in timer_name)
{
SetMessage("DisplayMessages", "IntroMessage", 0);
}

and this in the .lang :
<Category Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</Category>

where is my mistake?
The language file is case sensitive. Use CATEGORY instead of Category.

<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>
(02-08-2013, 05:06 PM)MulleDK19 Wrote: [ -> ]The language file is case sensitive. Use CATEGORY instead of Category.

<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>

still not working Sad
(02-08-2013, 05:09 PM)tonitoni1998 Wrote: [ -> ]
(02-08-2013, 05:06 PM)MulleDK19 Wrote: [ -> ]The language file is case sensitive. Use CATEGORY instead of Category.

<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>

still not working Sad

What's the rest of your language file?

The problem could also be that your function is called SetMessage, so the callback tries to call the internal SetMessage function already existing in the game, rather than yours.
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">description goes here</Entry>
</CATEGORY>
<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>
</LANGUAGE>
(02-08-2013, 05:11 PM)tonitoni1998 Wrote: [ -> ]<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">description goes here</Entry>
</CATEGORY>
<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>
</LANGUAGE>

Read my message above.

Try:

Code:
AddTimer("intro_message", 5, "ShowIntroMessage");

void ShowIntroMessage(string &in timer_name)
{
    SetMessage("DisplayMessages", "IntroMessage", 0);
}

And IIRC the game will complain without a RESOURCES element in the language file (Don't quote me on that though), so just to be safe, use:
Code:
<LANGUAGE>
<RESOURCES/>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">description goes here</Entry>
</CATEGORY>
<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>
</LANGUAGE>
still not showing up :/
(02-08-2013, 05:17 PM)tonitoni1998 Wrote: [ -> ]still not showing up :/

Well, you must have something wrong someone else.
I just tried that exact code with your language file, and it worked fine.

Are you sure your script gets executed at all?
Are you sure you named your language file correctly?

If you want, you can click here to join my live chat, and I'll try to help you resolve the issue from there.
no thanks, i bet i just have a tiny mistake somewhere Smile ill look for it on my own Big Grin but thanks for your help.
EDIT... Nope didn't solve it
Pages: 1 2