Frictional Games Forum (read-only)
i feel like a newb. help me quick so i can regain self-esteem - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: i feel like a newb. help me quick so i can regain self-esteem (/thread-8202.html)



i feel like a newb. help me quick so i can regain self-esteem - SLAMnesia - 05-23-2011

Quote:////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "UsedKeyOnDoor", true);
}

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

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
here is my entire script, a basic key-unlock-door script and I'm having problems. If the script is perfect and its something in the editor I need to fix lemme know Big Grin i feel so like a nubcake posting this


RE: i feel like a newb. help me quick so i can regain self-esteem - Roenlond - 05-23-2011

The key you're trying to use needs to be called exactly like in the script:key_1 and the door: mansion_1. Script looks fine while skimmed over


RE: i feel like a newb. help me quick so i can regain self-esteem - SLAMnesia - 05-23-2011

ah sweet thanks!
the names were all correct but while intensively looking for mistakes i realized I named the .hps file after the wrong level >.> but you helped me find that thanks man