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
.Lang File Help Custom Messages Don't Show Up
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#1
Custom Messages Don't Show Up

I just started adding text to my maps and I figured adding a few hints would be fair for the player. Problem is, the hints, note text, and custom item names don't show up on screen. The game doesn't crash or say anything is wrong with the lang/script files.
This is the .lang file:
<LANGUAGE>
    </RESOURCES>
    
    /////////////////////////////////////////////////
    /////////////CS DESCRIPTION STUFF////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">There are multiple endings based on your actions. Good luck. (note to self: edit this later)</Entry>
    </CATEGORY>
    
       /////////////////////////////////////////////////
    //////////////////INVENTORY//////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Inventory">
        <Entry Name="ItemName_ScienceKey">Room Key</Entry>
        <Entry Name="ItemDesc_ScienceKey">A simple key. Probably for that locked room down the hallway...</Entry>
    </CATEGORY>
    
    /////////////////////////////////////////////////
    ////////////////JOURNAL ENTRIES//////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Journal">
    </CATEGORY>
    
    /////////////////////////////////////////////////
    //////////////////LEVEL NAMES////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Levels">
    <Entry Name="LivingQuarters">Living Quarters</Entry>
    <Entry Name="Atrium">Atrium</Entry>
    </CATEGORY>
    
    /////////////////////////////////////////////////
    //////////////////GAME HINTS/////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="LivingQuarters">
        <Entry Name="FirstHint">I don't think that candle was lit when I got here.</Entry>
        <Entry Name="SecondHint">That chemical jar... something must have made it fall, but what?</Entry>
    </CATEGORY>
    
    /////////////////////////////////////////////////
    //////////////////DEATH HINTS////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Hints">
    </CATEGORY>
    
    /////////////////////////////////////////////////
    ////////////////EMOTION STONE////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="EmotionStone">
    </CATEGORY>
    
    /////////////////////////////////////////////////
    /////////////////LOADING TEXT////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="LoadingText">
    </CATEGORY>

    /////////////////////////////////////////////////
    ////////////////////CREDITS//////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Ending">
    </CATEGORY>
    
</LANGUAGE>

and the script which requires the lang:
void Hint_1(string &in asParent, string &in asChild, int alState)
{
    AddTimer("First_Hint", 120.0f, "timer_hint_1");
}

void Hint_2(string &in asParent, string &in asChild, int alState)
{
        AddTimer("Second_Hint", 240.0f, "timer_hint_2");
}

void timer_hint_1(string &in asTimer)
{
    SetMessage("LivingQuarters", "FirstHint", 10.0f);
}

void timer_hint_2(string &in asTimer)
{
    SetMessage("LivingQuarters", "SecondHint", 10.0f);
}

Any suggestions? I'm completely stumped Undecided

Edit: I couldn't find anything in the wiki or on the forum about lang files. Sorry if I'm asking a question that's been asked before

[Image: quote_by_rueppells_fox-d9ciupp.png]
(This post was last modified: 03-21-2013, 08:29 AM by CarnivorousJelly.)
03-21-2013, 08:27 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#2
RE: Custom Messages Don't Show Up

(03-21-2013, 08:27 AM)Kiandra Wrote: I just started adding text to my maps and I figured adding a few hints would be fair for the player. Problem is, the hints, note text, and custom item names don't show up on screen. The game doesn't crash or say anything is wrong with the lang/script files.
This is the .lang file:
<LANGUAGE>
    </RESOURCES>
    
    /////////////////////////////////////////////////
    /////////////CS DESCRIPTION STUFF////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">There are multiple endings based on your actions. Good luck. (note to self: edit this later)</Entry>
    </CATEGORY>
    
       /////////////////////////////////////////////////
    //////////////////INVENTORY//////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Inventory">
        <Entry Name="ItemName_ScienceKey">Room Key</Entry>
        <Entry Name="ItemDesc_ScienceKey">A simple key. Probably for that locked room down the hallway...</Entry>
    </CATEGORY>
    
    /////////////////////////////////////////////////
    ////////////////JOURNAL ENTRIES//////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Journal">
    </CATEGORY>
    
    /////////////////////////////////////////////////
    //////////////////LEVEL NAMES////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Levels">
    <Entry Name="LivingQuarters">Living Quarters</Entry>
    <Entry Name="Atrium">Atrium</Entry>
    </CATEGORY>
    
    /////////////////////////////////////////////////
    //////////////////GAME HINTS/////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="LivingQuarters">
        <Entry Name="FirstHint">I don't think that candle was lit when I got here.</Entry>
        <Entry Name="SecondHint">That chemical jar... something must have made it fall, but what?</Entry>
    </CATEGORY>
    
    /////////////////////////////////////////////////
    //////////////////DEATH HINTS////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Hints">
    </CATEGORY>
    
    /////////////////////////////////////////////////
    ////////////////EMOTION STONE////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="EmotionStone">
    </CATEGORY>
    
    /////////////////////////////////////////////////
    /////////////////LOADING TEXT////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="LoadingText">
    </CATEGORY>

    /////////////////////////////////////////////////
    ////////////////////CREDITS//////////////////////
    /////////////////////////////////////////////////
    
    <CATEGORY Name="Ending">
    </CATEGORY>
    
</LANGUAGE>

and the script which requires the lang:
void Hint_1(string &in asParent, string &in asChild, int alState)
{
    AddTimer("First_Hint", 120.0f, "timer_hint_1");
}

void Hint_2(string &in asParent, string &in asChild, int alState)
{
        AddTimer("Second_Hint", 240.0f, "timer_hint_2");
}

void timer_hint_1(string &in asTimer)
{
    SetMessage("LivingQuarters", "FirstHint", 10.0f);
}

void timer_hint_2(string &in asTimer)
{
    SetMessage("LivingQuarters", "SecondHint", 10.0f);
}

Any suggestions? I'm completely stumped Undecided

Edit: I couldn't find anything in the wiki or on the forum about lang files. Sorry if I'm asking a question that's been asked before

Where you put livingquarters put Messages (it shouldnt matter but it wouldnt work for me when i changed it to messages it worked)

03-21-2013, 09:26 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Custom Messages Don't Show Up

Your XML has syntax errors in it. For starters, the RESOURCES element wasn't opened to begin with, so there's no need to have a closing tag for it. Also, XML doesn't support C-like comments. If you want to write comments, you have to do it like this:

<!-- Comment goes here -->

Tutorials: From Noob to Pro
03-21-2013, 06:04 PM
Website Find
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#4
RE: Custom Messages Don't Show Up

(03-21-2013, 06:04 PM)Your Computer Wrote: Your XML has syntax errors in it. For starters, the RESOURCES element wasn't opened to begin with, so there's no need to have a closing tag for it. Also, XML doesn't support C-like comments. If you want to write comments, you have to do it like this:

<!-- Comment goes here -->

Ohhhhhhhh that makes more sense. I'll give it a try Smile

Thanks (to both of you)

Edit: still doesn't work :\ Not sure why

.Lang File:
<LANGUAGE>
    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">There are multiple endings based on your actions. Good luck.</Entry>
    </CATEGORY>

    <CATEGORY Name="Inventory">
        <Entry Name="ItemName_ScienceKey">Room Key</Entry>
        <Entry Name="ItemDesc_ScienceKey">A simple key. Probably for that locked room down the hallway...</Entry>
    </CATEGORY>

    <CATEGORY Name="Journal">

    </CATEGORY>

    <CATEGORY Name="Levels">
        <Entry Name="LivingQuarters">Living Quarters</Entry>
        <Entry Name="Atrium">Atrium</Entry>
    </CATEGORY>

    <CATEGORY Name="Messages">
        <Entry Name="FirstHint">When was that candle in the corner lit?</Entry>
        <Entry Name="SecondHint">That chemical jar... something must have made it fall, but what?</Entry>
    </CATEGORY>

    <CATEGORY Name="Hints">
        
    </CATEGORY>

    <CATEGORY Name="EmotionStone">
        
    </CATEGORY>

    <CATEGORY Name="LoadingText">

    </CATEGORY>

    <CATEGORY Name="Ending">
        <Entry Name="MainCredits"></Entry>
    </CATEGORY>
    
</LANGUAGE>

Script:
void OnEnter()
{
    /////////Setting up the level//////////
    AddUseItemCallback("ScienceRoom", "science_key", "locked_door", "Unlockdoor", true);
    AddTimer("painting", 3.0f, "timer_painting");
    PlayMusic("10_amb", true, 1.0f, 3.0f, 1, true);
    ///////Monster Encounters/////////
    AddEntityCollideCallback("book_moveable_1", "AreaBookPulled_1", "Secret_Shelf", true, 1);
    AddEntityCollideCallback("Player", "AreaMonsterTrigger", "MonsterTrigger", true, 1);
    ///////In case the player gets stuck////////
    AddEntityCollideCallback("Player", "AreaHint_1", "Hint_1", true, 1);
    AddEntityCollideCallback("Player", "AreaHint_2", "Hint_2", true, 1);
}

void Hint_1(string &in asParent, string &in asChild, int alState)
{
    AddTimer("First_Hint", 120.0f, "timer_hint_1");
}

void Hint_2(string &in asParent, string &in asChild, int alState)
{
        AddTimer("Second_Hint", 180.0f, "timer_hint_2");
}

void timer_hint_1(string &in asTimer)
{
    SetMessage("Messages", "FirstHint", 0);
}

void timer_hint_2(string &in asTimer)
{
    SetMessage("Messages", "SecondHint", 0);
}

[Image: quote_by_rueppells_fox-d9ciupp.png]
(This post was last modified: 03-22-2013, 12:11 AM by CarnivorousJelly.)
03-22-2013, 12:03 AM
Find
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#5
RE: Custom Messages Don't Show Up

Try this:

<LANGUAGE>

<RESOURCES>
    <Directory Path="fonts/eng" />
    <Directory Path="lang/eng" />
</RESOURCES>

<CATEGORY Name="CustomStoryMain">
    <Entry Name="Description">There are multiple endings based on your actions. Good luck.</Entry>
</CATEGORY>

etc...

or this:

<LANGUAGE>

<RESOURCES />

<CATEGORY Name="CustomStoryMain">
    <Entry Name="Description">There are multiple endings based on your actions. Good luck.</Entry>
</CATEGORY>

etc...

Also try deleting the .map_cache file of the map. Check HPL.log too for language errors. Usually you can see them there.
(This post was last modified: 03-22-2013, 03:29 AM by plutomaniac.)
03-22-2013, 03:25 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Custom Messages Don't Show Up

The resources element is irrelevant for custom stories that aren't full conversions. Try using a non-developer profile and see if they work then.

Tutorials: From Noob to Pro
03-22-2013, 07:31 AM
Website Find
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#7
RE: Custom Messages Don't Show Up

Well he hasn't confirmed this being a custom story or a full conversion. If it is a full conversion, then at least the <RESOURCES /> addition will help.

But, if deleting the cache file does not help, run it one more time until the entries should appear and check the HPL.log. I'm pretty sure the lang errors are printed there.
03-22-2013, 01:12 PM
Find
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#8
RE: Custom Messages Don't Show Up

(03-22-2013, 01:12 PM)plutomaniac Wrote: Well she hasn't confirmed this being a custom story or a full conversion. If it is a full conversion, then at least the <RESOURCES /> addition will help.

But, if deleting the cache file does not help, run it one more time until the entries should appear and check the HPL.log. I'm pretty sure the lang errors are printed there.

Sorry my replay took so long ^^" I was on a trip.

Anyways, it's a custom story, not a FC but I added it anyways, renamed the map and hps files in case there was a virtual storage copy or a cache somewhere, made sure the file was actually in the right place, and checked the hpl.log like you said. After all that, this is what I managed to come up with:

WARNING: Could not find language file category 'Messages'
WARNING: Could not find language file entry 'ItemName_ScienceKey'

I double and triple checked the spelling/capitalization but it's all correct. I'm really sorry for being such a pest; I can imagine you're tired of answering the same questions over and over and I wish I could figure it out for myself without having to consult the forum every time I slammed face-first into a major(ish) scripting error. That being said, thank you so much for helping me thus far. Believe it or not, I've actually managed to learn something from all of this and (I think) my questions are getting gradually less nooblette-y. So, um, you guys are wonderful and I certainly could not be doing any of this without all of you Smile

[Image: quote_by_rueppells_fox-d9ciupp.png]
03-31-2013, 12:48 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#9
RE: Custom Messages Don't Show Up

Try restarting the computer. it's an idiotic answer. please do not take this seriously. but you could try it.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 03-31-2013, 12:56 AM by PutraenusAlivius.)
03-31-2013, 12:55 AM
Find
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#10
RE: Custom Messages Don't Show Up

I saw you changed it to she. Sorry about that Big Grin

Well, if it is a virtualstore leftover go to C:\Users\--YOUR-USER-NAME--\AppData\Local\VirtualStore and rename it to VirtualStore_TEST just to make sure.

If that does not work, try placing the two hints under the Hints category and apply the changes to the scripts too(it doesn't have to do with them being hints, more to see if another category except Messages would work).
03-31-2013, 01:05 AM
Find




Users browsing this thread: 1 Guest(s)