Frictional Games Forum (read-only)

Full Version: I need help with my Custom Story fast!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there, community!

I have been into making Custom Stories and I want to make a really serious and a long one. But I got one problem. I want one key are gonna open a specefic swing door. I've watched tutorials and such, checked the "Locked" box in the Level Editor, but I can't make it work.. So, here's my code:

extra.english.lang
Spoiler below!

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are William, the gentleman. You have a weak memory where your location was, in your house. You woke up in a castle and you smell the stinky and dizzy smell.
-I need to escape, fast! I can't be here anymore!</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_PrisonIntro_Name">Read this!</Entry>
<Entry Name="Note_PrisonIntro_Text">If anybody sees this, then you are trapped! There is a shadow, no a monster patrolling in this castle. Watch out for him, if he sees you, escape, or atleast try! I also put a key around here that i made here, get it to unlock the door. Good luck my friend. [br]
</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_key1">This key maybe will lead me out from this stinky prison?</Entry>
<Entry Name="ItemName_key1">Handmade Rusty Key</Entry>
</CATEGORY>
</LANGUAGE>

00_castle.hps my HPS file
Spoiler below!

void OnStart()
{
AddUseItemCallback("", "key1", "castle_arched01_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}

void OnEnter()
{

}

void OnLeave()
{

}


I'm using Notepad ++, but it won't work. When I am In-Game and picks up the key, it does not say "Handmade Rusty Key" and I can't see the description of it in the inventory. I would love you guys if you could help me, thanks!
Hmm... if the description works it must be a general problem:

Go to the level editor and click the key. In there, put "key_1" in CustomSubItemName or something like that.
If there are .map_cache, delete them.
It did not work, it just says when I pick up the key: "Picked up" then I press tab holding my mouse cursor over the key it's just blank. When I try to unlock the door with the key it says: "Cannot use this item this way!" and how do I see if I have any .map_cache? I only see in my maps folder 00_castle.map and 00_castle.hps
(12-27-2012, 01:28 PM)The chaser Wrote: [ -> ]Hmm... if the description works it must be a general problem:

Go to the level editor and click the key. There, put "key1" in CustomSubItemName or something like that.
If there are .map_cache, delete them.
(12-27-2012, 03:04 PM)The chaser Wrote: [ -> ]
(12-27-2012, 01:28 PM)The chaser Wrote: [ -> ]Hmm... if the description works it must be a general problem:

Go to the level editor and click the key. There, put "key1" in CustomSubItemName or something like that.
If there are .map_cache, delete them.
Hmm..? I just changed it to Key_1 as you said, I had Key1 earlier, both doesn't work, and I cannot find any .map.cache