Frictional Games Forum (read-only)
[LANG] Lang File not working? - 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: [LANG] Lang File not working? (/thread-53975.html)



Lang File not working? - Verkehr - 12-10-2017

I'm constantly having issues with my lang file as it won't work properly, and I tried my best to spot the mistake, but I can't see any? Any help please? Sad

Code:
    <CATEGORY Name="CustomStoryMain">
    <Entry Name="Description">Inside of this custom story, you play as a young scientist whose laboratorium got overrun by nightmares from his past. You have to stop them![br][br]The only way you could think of doing so is by creating a "potion of Life", a side result from an experiment you had. It's known that that potion would make any sins and nightmares go away, even the ones haunting you. However, you were late. The monsters bashed you in your head and you were unconscious for multiple hours. It's now or never, time to act!</Entry>
    </CATEGORY>
    <CATEGORY Name="Journal">

        //---Notes---//
        <Entry Name="Note_note1_1_Name">I salute you...</Entry>
        <Entry Name="Note_note1_1_Text">Robert Smith is the name, right?[br][br]I'm one of the nightmares that entered your house. However, do not fear, as I will not attack you. I have been already avenged by other people, but by spirit rules, I need to haunt 1 more house before I'm truly free.[br][br]I know that there are other spirits, and I can't fight aganst them, but I can help you beat them. Just follow my advice and ignore anything you see as good as you can and you'll be good to go.[br][br]-Your only friend</Entry>
//---Diaries---//
        //<Entry Name="Diary_DearDiary_Name1">End of the World</Entry>//
        //<Entry Name="Diary_DearDiary_Text1">21 December, 2012[br][br]The ground is literally shaking beneath my feet.</Entry>//

        //---Mementos---//
        //<Entry Name="Quest_MyMemento_Text">Perhaps I should go the other way.</Entry>//
    </CATEGORY>
    <CATEGORY Name="Inventory">

        //---Item Names/Descriptions---//
        //<Entry Name="ItemName_DoorKey">A Key</Entry>//
        //<Entry Name="ItemDesc_DoorKey">It's for unlocking a door.</Entry>//
    </CATEGORY>
    <CATEGORY Name="Sign">

        //---Signs---//
        //<Entry Name="SignStudy">Study Room</Entry>//
    </CATEGORY>
    <CATEGORY Name="Levels">

        //---Levels---//
        //<Entry Name="LevelHall">Main Hall</Entry>//
    </CATEGORY>
    <CATEGORY Name="DeathHint">

        //---Death Hints---//
        //<Entry Name="DHint1">You have to carry on...</Entry>//
    </CATEGORY>

No need to reply on this thread anymore, the glitch is fixed. Please be aware that any comments before the <LANGUAGE> tag will break the file! Make sure to remove any before posting a thread. Fix found by " Mudbill ".


RE: Lang File not working? - tigerlillymaya13 - 12-10-2017

(12-10-2017, 09:09 PM)CritZOfficial Wrote: I'm constantly having issues with my lang file as it won't work properly, and I tried my best to spot the mistake, but I can't see any? Any help please? Sad

Code:
    <CATEGORY Name="CustomStoryMain">
    <Entry Name="Description">Inside of this custom story, you play as a young scientist whose laboratorium got overrun by nightmares from his past. You have to stop them![br][br]The only way you could think of doing so is by creating a "potion of Life", a side result from an experiment you had. It's known that that potion would make any sins and nightmares go away, even the ones haunting you. However, you were late. The monsters bashed you in your head and you were unconscious for multiple hours. It's now or never, time to act!</Entry>
    </CATEGORY>
    <CATEGORY Name="Journal">

        //---Notes---//
        <Entry Name="Note_note1_1_Name">I salute you...</Entry>
        <Entry Name="Note_note1_1_Text">Robert Smith is the name, right?[br][br]I'm one of the nightmares that entered your house. However, do not fear, as I will not attack you. I have been already avenged by other people, but by spirit rules, I need to haunt 1 more house before I'm truly free.[br][br]I know that there are other spirits, and I can't fight aganst them, but I can help you beat them. Just follow my advice and ignore anything you see as good as you can and you'll be good to go.[br][br]-Your only friend</Entry>
//---Diaries---//
        //<Entry Name="Diary_DearDiary_Name1">End of the World</Entry>//
        //<Entry Name="Diary_DearDiary_Text1">21 December, 2012[br][br]The ground is literally shaking beneath my feet.</Entry>//

        //---Mementos---//
        //<Entry Name="Quest_MyMemento_Text">Perhaps I should go the other way.</Entry>//
    </CATEGORY>
    <CATEGORY Name="Inventory">

        //---Item Names/Descriptions---//
        //<Entry Name="ItemName_DoorKey">A Key</Entry>//
        //<Entry Name="ItemDesc_DoorKey">It's for unlocking a door.</Entry>//
    </CATEGORY>
    <CATEGORY Name="Sign">

        //---Signs---//
        //<Entry Name="SignStudy">Study Room</Entry>//
    </CATEGORY>
    <CATEGORY Name="Levels">

        //---Levels---//
        //<Entry Name="LevelHall">Main Hall</Entry>//
    </CATEGORY>
    <CATEGORY Name="DeathHint">

        //---Death Hints---//
        //<Entry Name="DHint1">You have to carry on...</Entry>//
    </CATEGORY>

This is from a trouble shooting guide for level editor
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
This is the description of my Custom Story! It is SCARY!
</Entry>
</CATEGORY>
</LANGUAGE>


RE: Lang File not working? - Neelke - 12-11-2017

Well youre using the // operation incorrectly. There are different ways of commenting out a line of script from your files and youre using // as if its functioning as a /* */.

To have you understand what the code needs in order for you to comment out things properly, I'll provide an example where you've been using it incorrectly:


Code:
//<Entry Name="ItemName_DoorKey">A Key</Entry>//

^^^^^^
The first // operation will comment out the entire row regardless of whats infront of it, so the second // operation therefore will not do anything and is useless.

/*<Entry Name="ItemName_DoorKey">A Key</Entry>*/

^^^^^^
This operation allows you to specifically comment out a certain section in one line, instead of commenting out the entire line. How you want to approach commenting out things is subjective but if you wish to use // for it, you only have to make it look like this:

//<Entry Name="ItemName_DoorKey">A Key</Entry>

As for your code, I'm not sure if you chose not to include it or not but have you actually used <LANGUAGE> and </LANGUAGE> to close off the entire code? If not, be sure to surround the whole language file with those two lines of code, which will give you an end result like the following:

Code:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
    <Entry Name="Description">Inside of this custom story, you play as a young scientist whose laboratorium got overrun by nightmares from his past. You have to stop them![br][br]The only way you could think of doing so is by creating a "potion of Life", a side result from an experiment you had. It's known that that potion would make any sins and nightmares go away, even the ones haunting you. However, you were late. The monsters bashed you in your head and you were unconscious for multiple hours. It's now or never, time to act!</Entry>
    </CATEGORY>
    <CATEGORY Name="Journal">

        //---Notes---//
        <Entry Name="Note_note1_1_Name">I salute you...</Entry>
        <Entry Name="Note_note1_1_Text">Robert Smith is the name, right?[br][br]I'm one of the nightmares that entered your house. However, do not fear, as I will not attack you. I have been already avenged by other people, but by spirit rules, I need to haunt 1 more house before I'm truly free.[br][br]I know that there are other spirits, and I can't fight aganst them, but I can help you beat them. Just follow my advice and ignore anything you see as good as you can and you'll be good to go.[br][br]-Your only friend</Entry>
//---Diaries---//
        //<Entry Name="Diary_DearDiary_Name1">End of the World</Entry>//
        //<Entry Name="Diary_DearDiary_Text1">21 December, 2012[br][br]The ground is literally shaking beneath my feet.</Entry>//

        //---Mementos---//
        //<Entry Name="Quest_MyMemento_Text">Perhaps I should go the other way.</Entry>//
    </CATEGORY>
    <CATEGORY Name="Inventory">

        //---Item Names/Descriptions---//
        //<Entry Name="ItemName_DoorKey">A Key</Entry>//
        //<Entry Name="ItemDesc_DoorKey">It's for unlocking a door.</Entry>//
    </CATEGORY>
    <CATEGORY Name="Sign">

        //---Signs---//
        //<Entry Name="SignStudy">Study Room</Entry>//
    </CATEGORY>
    <CATEGORY Name="Levels">

        //---Levels---//
        //<Entry Name="LevelHall">Main Hall</Entry>//
    </CATEGORY>
    <CATEGORY Name="DeathHint">

        //---Death Hints---//
        //<Entry Name="DHint1">You have to carry on...</Entry>//
    </CATEGORY>
</LANGUAGE>

Other than that, I cannot find anything wrong.


RE: Lang File not working? - Verkehr - 12-11-2017

(12-11-2017, 02:08 AM)Neelke Wrote: Well youre using the // operation incorrectly. There are different ways of commenting out a line of script from your files and youre using // as if its functioning as a /* */.

To have you understand what the code needs in order for you to comment out things properly, I'll provide an example where you've been using it incorrectly:


Code:
//<Entry Name="ItemName_DoorKey">A Key</Entry>//

^^^^^^
The first // operation will comment out the entire row regardless of whats infront of it, so the second // operation therefore will not do anything and is useless.

/*<Entry Name="ItemName_DoorKey">A Key</Entry>*/

^^^^^^
This operation allows you to specifically comment out a certain section in one line, instead of commenting out the entire line. How you want to approach commenting out things is subjective but if you wish to use // for it, you only have to make it look like this:

//<Entry Name="ItemName_DoorKey">A Key</Entry>

As for your code, I'm not sure if you chose not to include it or not but have you actually used <LANGUAGE> and </LANGUAGE> to close off the entire code? If not, be sure to surround the whole language file with those two lines of code, which will give you an end result like the following:

Code:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
    <Entry Name="Description">Inside of this custom story, you play as a young scientist whose laboratorium got overrun by nightmares from his past. You have to stop them![br][br]The only way you could think of doing so is by creating a "potion of Life", a side result from an experiment you had. It's known that that potion would make any sins and nightmares go away, even the ones haunting you. However, you were late. The monsters bashed you in your head and you were unconscious for multiple hours. It's now or never, time to act!</Entry>
    </CATEGORY>
    <CATEGORY Name="Journal">

        //---Notes---//
        <Entry Name="Note_note1_1_Name">I salute you...</Entry>
        <Entry Name="Note_note1_1_Text">Robert Smith is the name, right?[br][br]I'm one of the nightmares that entered your house. However, do not fear, as I will not attack you. I have been already avenged by other people, but by spirit rules, I need to haunt 1 more house before I'm truly free.[br][br]I know that there are other spirits, and I can't fight aganst them, but I can help you beat them. Just follow my advice and ignore anything you see as good as you can and you'll be good to go.[br][br]-Your only friend</Entry>
//---Diaries---//
        //<Entry Name="Diary_DearDiary_Name1">End of the World</Entry>//
        //<Entry Name="Diary_DearDiary_Text1">21 December, 2012[br][br]The ground is literally shaking beneath my feet.</Entry>//

        //---Mementos---//
        //<Entry Name="Quest_MyMemento_Text">Perhaps I should go the other way.</Entry>//
    </CATEGORY>
    <CATEGORY Name="Inventory">

        //---Item Names/Descriptions---//
        //<Entry Name="ItemName_DoorKey">A Key</Entry>//
        //<Entry Name="ItemDesc_DoorKey">It's for unlocking a door.</Entry>//
    </CATEGORY>
    <CATEGORY Name="Sign">

        //---Signs---//
        //<Entry Name="SignStudy">Study Room</Entry>//
    </CATEGORY>
    <CATEGORY Name="Levels">

        //---Levels---//
        //<Entry Name="LevelHall">Main Hall</Entry>//
    </CATEGORY>
    <CATEGORY Name="DeathHint">

        //---Death Hints---//
        //<Entry Name="DHint1">You have to carry on...</Entry>//
    </CATEGORY>
</LANGUAGE>

Other than that, I cannot find anything wrong.

Since the extra_english.lang file I use is from Mudbill, there is only a 4 row long comment outside of the LANGUAGE sections.

Code:
//You can delete or add any lines that start with // if you wish. These are only comments
//made to help organize your file. Remember that some category names MUST NOT be changed,
//or else they won't work. For example CustomStoryMain and Journal must stay, but you're
//free to add any additional categories with your own names. Have fun! -Mudbill

<LANGUAGE>  
    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">Inside of this custom story, you play as a young scientist whose laboratorium got overrun by nightmares from his past. You have to stop them![br][br]The only way you could think of doing so is by creating a "potion of Life", a side result from an experiment you had. It's known that that potion would make any sins and nightmares go away, even the ones haunting you. However, you were late. The monsters bashed you in your head and you were unconscious for multiple hours. It's now or never, time to act!</Entry>
    </CATEGORY>
    <CATEGORY Name="Journal">

        //---Notes---//
        <Entry Name="Note_note1_1_Name">I salute you...</Entry>
        <Entry Name="Note_note1_1_Text">Robert Smith is the name, right?[br][br]I'm one of the nightmares that entered your house. However, do not fear, as I will not attack you. I have been already avenged by other people, but by spirit rules, I need to haunt 1 more house before I'm truly free.[br][br]I know that there are other spirits, and I can't fight aganst them, but I can help you beat them. Just follow my advice and ignore anything you see as good as you can and you'll be good to go.[br][br]-Your only friend</Entry>

        //---Diaries---//
        /*<Entry Name="Diary_DearDiary_Name1">End of the World</Entry>*/
        /*<Entry Name="Diary_DearDiary_Text1">21 December, 2012[br][br]The ground is literally shaking beneath my feet.</Entry>*/

        //---Mementos---//
        /*<Entry Name="Quest_MyMemento_Text">Perhaps I should go the other way.</Entry>*/
    </CATEGORY>
    <CATEGORY Name="Inventory">

        //---Item Names/Descriptions---//
        /*<Entry Name="ItemName_DoorKey">A Key</Entry>*/
        /*<Entry Name="ItemDesc_DoorKey">It's for unlocking a door.</Entry>*/
    </CATEGORY>
    <CATEGORY Name="Sign">

        //---Signs---//
        /*<Entry Name="SignStudy">Study Room</Entry>*/
    </CATEGORY>
    <CATEGORY Name="Levels">

        //---Levels---//
        /*<Entry Name="LevelHall">Main Hall</Entry>*/
    </CATEGORY>
    <CATEGORY Name="DeathHint">

        //---Death Hints---//
        /*<Entry Name="DHint1">You have to carry on...</Entry>*/
    </CATEGORY>
</LANGUAGE>

Is this also better? Used /* */ instead of // //.

RIP this thread.

Also, // alone on the beginning didn't work for me either. Also wouldn't load.


RE: Lang File not working? - Mudbill - 12-11-2017

I found the issue. Apparently, starting the file with comments before the <LANGUAGE> tag messes up the parsing of the file. Remove all those 4 lines. I'll see to edit the template.
It's not an obvious issue, but apparently a very critical one.


RE: Lang File not working? - Verkehr - 12-12-2017

(12-11-2017, 11:10 PM)Mudbill Wrote: I found the issue. Apparently, starting the file with comments before the <LANGUAGE> tag messes up the parsing of the file. Remove all those 4 lines. I'll see to edit the template.
It's not an obvious issue, but apparently a very critical one.

Alright! That fixed it! Thanks, Mudbill!

Also, please consider replacing the comments inside of the files you provide, so that it doesn't repeat so much.


RE: Lang File not working? - Mudbill - 12-13-2017

Yep, the downloadable template is also updated.