Frictional Games Forum (read-only)

Full Version: [SOLVED] Newbie .lang file error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I'm trying to get my custom story's description to work, as well as text to appear on notes, descriptions of keys to appear and whatnot, but nothing I put in my .lang file seems to be working. The keys open the specified doors, so I dont believe my scripting is incorrect, but I just started, so Ill paste it here!

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "room101key", "room101", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("room101", false, true);
PlaySoundAtEntity("", "unlock_door", "room101", 0, false);
RemoveItem("room101key");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}

and for the .lang file:

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">The Shanus' first custom story. Enjoy!</Entry>
<CATEGORY Name="Journal">
<Entry Name="Note_TESTFINISH_Name">Congratulations!</Entry>
<Entry Name="Note_TESTFINISH_Text">Wahey! You finished my Amnesia custom story tester! Thanks for playing.</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_keyroom1">Guarded Door Key</Entry>
<Entry Name="ItemDesc_keyroom1">Maybe this unlocks that door in the corner of the room...</Entry>
<Entry Name="ItemName_room101key">EnSuite Room Key</Entry>
<Entry Name="ItemDesc_room101key">Picked up EnSuite Room Key</Entry>
</CATEGORY>
</LANGUAGE>

I'm not running through the dev setup because I dont know how to do that. I've been running it through Amnesia.exe, then selecting my profile, the custom story, and whatnot, but it isn't showing anything on the notes, the key when I pick it up, or even my custom story's description. Any help would be greatly appreciated. Angel
Forgot to end the category:

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">The Shanus' first custom story. Enjoy!</Entry>
</CATEGORY>
You're right with saying that, but after fixing it nothing has changed.
Might be wrong, but you seem to miss keyroom1 in the script. Also add OnStart().Also, you can just use asEntity and asItem in the UsedKeyOnDoor function. So basically:
void OnStart()
{
}
////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("", "room101key", "room101", "UsedKeyOnDoor", true);
AddUseItemCallback("", "keyroom1", "thedooritopens", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", asEntity, "room101", 0, false);
RemoveItem(asItem);
}
This way, you save the whole function of the other key. And doesn't the true at AddUseItemCallback already destroy the item? No need for RemoveItem, as far as I know. Might want to switch the Callbacks from OnEnter to OnStart, but it depends on what exactly you wanted to do with it.
For the problem itself, those are the only things I noticed, and I might be wrong. Good luck Smile

Edit: you seem to miss the extension for the sound file, too. So, it's unlock_door.snt.
(06-18-2012, 09:20 PM)FastHunteR Wrote: [ -> ]Might be wrong, but you seem to miss keyroom1 in the script. Also add OnStart().Also, you can just use asEntity and asItem in the UsedKeyOnDoor function. So basically:
void OnStart()
{
}
////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("", "room101key", "room101", "UsedKeyOnDoor", true);
AddUseItemCallback("", "keyroom1", "thedooritopens", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", asEntity, "room101", 0, false);
RemoveItem(asItem);
}
This way, you save the whole function of the other key. And doesn't the true at AddUseItemCallback already destroy the item? No need for RemoveItem, as far as I know. Might want to switch the Callbacks from OnEnter to OnStart, but it depends on what exactly you wanted to do with it.
For the problem itself, those are the only things I noticed, and I might be wrong. Good luck Smile
Well as I said before, the door opens and whatnot, and the key works fine, but when its picked up it says "Picked up" rather than "Picked up EnSuite Room Key". Also, it's name doesn't appear in the inventory, and when the note is picked up in the room it says nothing. Would changing it to that ^ affect the problem? (Forgot to mention, my custom story's description says nothing as of now, which is most annoying.)
Other than that, nothing seems to be wrong with the .lang file. You could check if the lang file is correctly placed and named, and if the Note in the editor has the name TESTFINISH under NoteText.
(06-18-2012, 09:35 PM)FastHunteR Wrote: [ -> ]Other than that, nothing seems to be wrong with the .lang file. You could check if the lang file is correctly placed and named, and if the Note in the editor has the name TESTFINISH under NoteText.
Placement of the file would seem like the obvious problem - it's in the "Tester" folder, which is a subfolder of "customstories". Not in the "maps" folder within the Tester folder - correct? "Tester" is the name of the folder which my custom story is in. (Also the file is named "extra_eng.lang")
(06-18-2012, 09:41 PM)theshanus Wrote: [ -> ]
(06-18-2012, 09:35 PM)FastHunteR Wrote: [ -> ]Other than that, nothing seems to be wrong with the .lang file. You could check if the lang file is correctly placed and named, and if the Note in the editor has the name TESTFINISH under NoteText.
Placement of the file would seem like the obvious problem - it's in the "Tester" folder, which is a subfolder of "customstories". Not in the "maps" folder within the Tester folder - correct? "Tester" is the name of the folder which my custom story is in. (Also the file is named "extra_eng.lang")
The correct name of the .lang file should be "extra_english.lang".
(06-18-2012, 10:22 PM)FastHunteR Wrote: [ -> ]
(06-18-2012, 09:41 PM)theshanus Wrote: [ -> ]
(06-18-2012, 09:35 PM)FastHunteR Wrote: [ -> ]Other than that, nothing seems to be wrong with the .lang file. You could check if the lang file is correctly placed and named, and if the Note in the editor has the name TESTFINISH under NoteText.
Placement of the file would seem like the obvious problem - it's in the "Tester" folder, which is a subfolder of "customstories". Not in the "maps" folder within the Tester folder - correct? "Tester" is the name of the folder which my custom story is in. (Also the file is named "extra_eng.lang")
The correct name of the .lang file should be "extra_english.lang".
Perfect! I was sure it was going to be something simple that I overlooked. Thank you, for your patience :] +1 rep for you buddy.
I'm glad it solved for you, good luck with the rest Smile