Frictional Games Forum (read-only)
[SCRIPT] 1 working key, 1 unworking - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] 1 working key, 1 unworking (/thread-12253.html)



1 working key, 1 unworking - irockpeople1 - 01-01-2012

I have tried alot of things to get the 2nd key to work, but i can't semm to fix it. here is my hps file:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "BedroomKey", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "StorageRoomKey", "mansion_2", "Door", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("BedroomKey");
}
void Door(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0, false);
RemoveItem("StorageRoomKey");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
}
what am I doing wrong?



RE: 1 working key, 1 unworking - Statyk - 01-01-2012

Where did you put "StorageRoomKey" in the key's tab in the LeveEditor? It could be in the wrong spot or spelled incorrectly...


RE: 1 working key, 1 unworking - irockpeople1 - 01-01-2012

(01-01-2012, 10:27 PM)Statyk Wrote: Where did you put "StorageRoomKey" in the key's tab in the LeveEditor? It could be in the wrong spot or spelled incorrectly...


I put it in the CutomSubItemTypeName



RE: 1 working key, 1 unworking - Statyk - 01-02-2012

I'm not sure if this is it, but put it as the internal name. Where it says something like "item_key_01"


RE: 1 working key, 1 unworking - irockpeople1 - 01-02-2012

FINNALY after many tries. The key works. Big Grin