12-27-2012, 01:16 PM
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:
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>
<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
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!
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()
{
}
{
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!