Sinth
Junior Member
Posts: 2
Threads: 1
Joined: Sep 2012
Reputation:
0
|
Keys & Doors
I'm fairly certain this topic has been discussed very often but I've searched through the recent threads involving this issue and I still haven't found a solution to my problem.
Here's the scripts:
EXTRA_ENGLISH.LANG:
<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="Absinthe Dreams">
<Entry Name="Description">This is just a test. Enjoy.</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_salvationkey">Key of Salvation</Entry>
<Entry Name="ItemDesc_salvationkey">A Key to your Salvation.</Entry>
</CATEGORY>
</LANGUAGE>
TEST1.HPS FILE:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "LockedDoor1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "LockedDoor1", 0.0f, false);
RemoveItem("key_1");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
------------------
The Key's name is "key_1", with the custom key name being "salvationkey".
The Door's name is "LockedDoor1", and has the "Locked" box checked.
When I pick up the key, the name and the description works fine. But the key doesn't work on the door. I just get the "The item cannot be used this way!" message.
I've been fiddling with this for hours trying to get it to work but to no avail. I've watched probably 5 video tutorials and I'm starting to feel like an idiot. :\
Anyone know what the problem could be? Is it my scripting?
It's my first map and my first script, so be gentle! ;u;
Thanks!
|
|
09-24-2012, 07:22 AM |
|