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
[SOLVED] Newbie .lang file error
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#1
Question  [SOLVED] Newbie .lang file error

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

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-18-2012, 11:22 PM by The Shanus.)
06-18-2012, 08:17 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Newbie .lang file error

Forgot to end the category:

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">The Shanus' first custom story. Enjoy!</Entry>
</CATEGORY>
(This post was last modified: 06-18-2012, 08:34 PM by Statyk.)
06-18-2012, 08:34 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#3
RE: Newbie .lang file error

You're right with saying that, but after fixing it nothing has changed.

[Image: theshanusyoutube.jpg]
06-18-2012, 08:40 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#4
RE: Newbie .lang file error

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.
(This post was last modified: 06-18-2012, 09:25 PM by Cruzore.)
06-18-2012, 09:20 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#5
RE: Newbie .lang file error

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

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-18-2012, 09:25 PM by The Shanus.)
06-18-2012, 09:24 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#6
RE: Newbie .lang file error

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
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#7
RE: Newbie .lang file error

(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")

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-18-2012, 09:41 PM by The Shanus.)
06-18-2012, 09:41 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#8
RE: Newbie .lang file error

(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
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#9
RE: Newbie .lang file error

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

[Image: theshanusyoutube.jpg]
06-18-2012, 10:36 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#10
RE: Newbie .lang file error

I'm glad it solved for you, good luck with the rest Smile
06-18-2012, 10:40 PM
Find




Users browsing this thread: 1 Guest(s)