08-13-2012, 05:31 PM
Hello. I recently posted about how my stories weren't showing up, but that's sorted out. Here's my error: the extra_english.lang isn't working. I've tried editing it, but to no avail. Here are my scripts; I followed them from a video, as I'm new to coding. It could just be my ignorance.
01_tutorial.hps (the main map):
custom_story_settings.cfg:
extra_english.lang:
Additional Info: I have two keys. Their custom IDs are key1 an key2. The tutorial series is made by XXVengeanceFilmsXX on YouTube. Thanks in advance.
01_tutorial.hps (the main map):
Spoiler below!
void OnStart()
{
SetLocalVarInt("DoorLocked", 1);
AddUseItemCallback("", "key_study_1", "level_wood_1", "FUNCTION", true);
AddUseItemCallback("", "key_study_2", "mansion_1", "FUNCTION2", true);
SetEntityPlayerInteractCallback("mansion_1", "FUNCTION3", false);
}
void OnEnter()
{
}
void OnLeave()
{
}
void FUNCTION(string &in item, string &in door)
{
SetLevelDoorLocked("level_wood_1", false);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key_study_1");
}
void FUNCTION2(string &in item, string &in door)
{
SetSwingDoorLocked("mansion_1", false, true);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key_study_2");
SetLocalVarInt("DoorLocked", 0);
}
void FUNCTION3(string &in entity)
{
if(GetLocalVarInt("DoorLocked") == 1)
{
SetMessage("Messages", "doorlock2", 3);
}
}
{
SetLocalVarInt("DoorLocked", 1);
AddUseItemCallback("", "key_study_1", "level_wood_1", "FUNCTION", true);
AddUseItemCallback("", "key_study_2", "mansion_1", "FUNCTION2", true);
SetEntityPlayerInteractCallback("mansion_1", "FUNCTION3", false);
}
void OnEnter()
{
}
void OnLeave()
{
}
void FUNCTION(string &in item, string &in door)
{
SetLevelDoorLocked("level_wood_1", false);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key_study_1");
}
void FUNCTION2(string &in item, string &in door)
{
SetSwingDoorLocked("mansion_1", false, true);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key_study_2");
SetLocalVarInt("DoorLocked", 0);
}
void FUNCTION3(string &in entity)
{
if(GetLocalVarInt("DoorLocked") == 1)
{
SetMessage("Messages", "doorlock2", 3);
}
}
custom_story_settings.cfg:
Spoiler below!
<Main
Name="Testing Story"
Author="Zaffre"
ImgFile="preview.jpg"
StartMap="01_tutorial.map"
StartPos="PlayerStartArea_1"
/>
Name="Testing Story"
Author="Zaffre"
ImgFile="preview.jpg"
StartMap="01_tutorial.map"
StartPos="PlayerStartArea_1"
/>
extra_english.lang:
Spoiler below!
<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description>Testing grounds.</Entry>
</CATEGORY>
<CATEGORY Name="Messages">
<Entry Name="doorlock1">The heavy door is locked.</entry>
<Entry Name="doorlock2">The wooden door is locked.</entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_key1>A silver key coated with rust.</Entry>
<Entry Name="ItemName_key1>Rusty Key</Entry>
<Entry Name="ItemDesc_key2>A silver key. It looks new.</Entry>
<Entry Name="ItemName_key2>Silver Key</Entry>
</CATEGORY>
</LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description>Testing grounds.</Entry>
</CATEGORY>
<CATEGORY Name="Messages">
<Entry Name="doorlock1">The heavy door is locked.</entry>
<Entry Name="doorlock2">The wooden door is locked.</entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_key1>A silver key coated with rust.</Entry>
<Entry Name="ItemName_key1>Rusty Key</Entry>
<Entry Name="ItemDesc_key2>A silver key. It looks new.</Entry>
<Entry Name="ItemName_key2>Silver Key</Entry>
</CATEGORY>
</LANGUAGE>
Additional Info: I have two keys. Their custom IDs are key1 an key2. The tutorial series is made by XXVengeanceFilmsXX on YouTube. Thanks in advance.