The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Key Name and Description not working
Zaik Offline
Junior Member

Posts: 2
Threads: 1
Joined: Mar 2012
Reputation: 0
#1
Key Name and Description not working

After struggling a bit with this, and watching several tutorials on how the .lang file should be formatted I have decided it is time for some fresh eyes on this problem.

For reference, my .lang file contains exactly the following:

<LANGUAGE>
    <CATEGORY Name="CustomStoryMain">
              <Entry Name="Description">Just a brief description!</Entry>
    </CATEGORY>
    <CATEGORY Name="Inventory">
            <Entry Name="ItemName_key1">Master Key</Entry>
            <Entry Name="ItemDesc_key1">A key that will open all the doors in the mansion</Entry>
    </CATEGORY>
</LANGUAGE>

For now, the story description is just there for me to make sure the .lang file loads correctly, and it seems to do so as the text "Just a brief description!" does indeed appear on the custom story screen when selecting my story, as opposed to the "No description" that would appear could the .lang not load at all.

This leads me to believe that there is a problem with the identifier of the key (as the script that should allow it to open doors does not work either), however I have checked several times (and copy-pasted, to make sure there are no lowercase/uppercase shenangians) and the names do match.

In case it is relevant, here are the parts of the map code that the key is contained within that associates with the opening of doors:

void OnStart ()
{

    /////<SNIP>

    AddUseItemCallback("", "key1", "lockeddoor1", "func_unlockdoor", false);
    AddUseItemCallback("", "key1", "lockeddoor2", "func_unlockdoor", false);

    /////<SNIP>

}

/////<SNIP>

void func_unlockdoor (string &in item, string &in door)
{
    SetSwingDoorLocked(door, false, true);
    PlaySoundAtEntity("", "unlock_door", door, 0, false);
}

/////<SNIP>


Note that both the CustomSubItemTypeName identifier and the Name identifier are set to "key1", and the doors are called "lockeddoor1" and "lockeddoor2".


Side-note: I have also had occasions where the .lang file would not load. But copying it's contents, creating a new .lang file, and pasting the contents inside would make it load.
(This post was last modified: 03-09-2012, 01:44 PM by Zaik.)
03-09-2012, 01:24 PM
Find


Messages In This Thread
Key Name and Description not working - by Zaik - 03-09-2012, 01:24 PM



Users browsing this thread: 1 Guest(s)