Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Display messages
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#1
Display messages

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?

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-08-2013, 05:05 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#2
RE: Display messages

The language file is case sensitive. Use CATEGORY instead of Category.

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

[Image: 16455.png]
02-08-2013, 05:06 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#3
RE: Display messages

(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

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-08-2013, 05:09 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#4
RE: Display messages

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

[Image: 16455.png]
(This post was last modified: 02-08-2013, 05:11 PM by MulleDK19.)
02-08-2013, 05:09 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#5
RE: Display messages

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">description goes here</Entry>
</CATEGORY>
<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>
</LANGUAGE>

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-08-2013, 05:11 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#6
RE: Display messages

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

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:
<LANGUAGE>
<RESOURCES/>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">description goes here</Entry>
</CATEGORY>
<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>
</LANGUAGE>

[Image: 16455.png]
(This post was last modified: 02-08-2013, 05:13 PM by MulleDK19.)
02-08-2013, 05:12 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#7
RE: Display messages

still not showing up :/

When you are looking for someone, to do the scripting for your Custom Story, ask me!
(This post was last modified: 02-08-2013, 05:17 PM by tonitoni1998.)
02-08-2013, 05:17 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#8
RE: Display messages

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

[Image: 16455.png]
02-08-2013, 05:21 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#9
RE: Display messages

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.

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-08-2013, 05:24 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
RE: Display messages

EDIT... Nope didn't solve it

Trying is the first step to success.
(This post was last modified: 02-08-2013, 06:07 PM by FlawlessHappiness.)
02-08-2013, 05:47 PM
Find




Users browsing this thread: 2 Guest(s)