tonitoni1998
Member
Posts: 163
Threads: 54
Joined: Oct 2012
Reputation:
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 |
|
MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
RE: Display messages
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 |
|
tonitoni1998
Member
Posts: 163
Threads: 54
Joined: Oct 2012
Reputation:
1
|
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
When you are looking for someone, to do the scripting for your Custom Story, ask me!
|
|
02-08-2013, 05:09 PM |
|
MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
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
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.
(This post was last modified: 02-08-2013, 05:11 PM by MulleDK19.)
|
|
02-08-2013, 05:09 PM |
|
tonitoni1998
Member
Posts: 163
Threads: 54
Joined: Oct 2012
Reputation:
1
|
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 |
|
MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
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>
(This post was last modified: 02-08-2013, 05:13 PM by MulleDK19.)
|
|
02-08-2013, 05:12 PM |
|
tonitoni1998
Member
Posts: 163
Threads: 54
Joined: Oct 2012
Reputation:
1
|
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 |
|
MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
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.
|
|
02-08-2013, 05:21 PM |
|
tonitoni1998
Member
Posts: 163
Threads: 54
Joined: Oct 2012
Reputation:
1
|
RE: Display messages
no thanks, i bet i just have a tiny mistake somewhere ill look for it on my own 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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Display messages
EDIT... Nope didn't solve it
Trying is the first step to success.
|
|
02-08-2013, 05:47 PM |
|
|