Frictional Games Forum (read-only)
Help! Keys - 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: Help! Keys (/thread-10925.html)



Help! Keys - Victor - 10-22-2011

I think I'm cursed... I've done EVERYTHING the guy in this tutorial did: http://www.youtube.com/watch?v=T4k5ILstUxc
But I can't make the fridgin' key work in the fudgin' door! Look at the .hps script:

////////////////////////////
// Run first time starting map
void onStart()
{
AddUseItemCallback("", "key", "door", "UsedKeyOnDoor", true);
}

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

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

}

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

}

Did you find anything? Please help! This is my 483764327846823th try on this, and the key doesn't appear to like the door.


RE: Help! Keys - JenniferOrange - 10-22-2011

The only thing that could be wrong is that the key name and door name is incorrect in the level editor. Go check that again, and make sure you hit ENTER after re-naming ANY object!


RE: Help! Keys - Victor - 10-22-2011

(10-22-2011, 08:58 PM)JenniferOrange Wrote: The only thing that could be wrong is that the key name and door name is incorrect in the level editor. Go check that again, and make sure you hit ENTER after re-naming ANY object!

Look at the pictures:
Help, please!



RE: Help! Keys - Statyk - 10-22-2011

(10-22-2011, 09:10 PM)Victor Wrote:
(10-22-2011, 08:58 PM)JenniferOrange Wrote: The only thing that could be wrong is that the key name and door name is incorrect in the level editor. Go check that again, and make sure you hit ENTER after re-naming ANY object!

Look at the pictures:
Help, please!
Click on the entities tab for each and check if the door is locked in the first place. If anything, could to take a screenshot of their "entity" tabs and post it here so we can help?





RE: Help! Keys - Brute - 10-22-2011

I found a mistake! But just a small Sad ...
NO:
PlaySoundAtEntity("", "unlock_door", "door", 0, false);
SO:
PlaySoundAtEntity("", "unlock_door.snt", "door", 0, false);

The sound doesn't play without this, at least by me. Sleepy

Side note: Brute is sleeeeeepy!


RE: Help! Keys - Victor - 10-22-2011

(10-22-2011, 09:56 PM)Statyk Wrote: Click on the entities tab for each and check if the door is locked in the first place. If anything, could to take a screenshot of their "entity" tabs and post it here so we can help?


(10-22-2011, 09:59 PM)Brute Wrote: I found a mistake! But just a small Sad ...
NO:
PlaySoundAtEntity("", "unlock_door", "door", 0, false);
SO:
PlaySoundAtEntity("", "unlock_door.snt", "door", 0, false);

The sound doesn't play without this, at least by me. Sleepy

Side note: Brute is sleeeeeepy!
Thanks, Brute Smile
And here it is the picture, Statyk...

Do you guys have got anything for me?



RE: Help! Keys - JenniferOrange - 10-23-2011

I have another suggestion!
void onStart() -> capitalize the 'O'.
void OnStart()
Tell me if that works!



RE: Help! Keys - palistov - 10-23-2011

First do what JenniferOrange suggested. If the OnStart() function isn't capitalized properly, it doesn't run. When it doesn't run, the key-door interaction isn't created. Ergo your key doesn't work! If you still can't get it to work, do this: Close Amnesia. Open the maps folder and if there is a .map_cache file, delete it. Restart Amnesia and see if that works. Cache files cause lots of issues >_>


RE: Help! Keys - Victor - 10-23-2011

(10-23-2011, 02:17 AM)JenniferOrange Wrote: I have another suggestion!
void onStart() -> capitalize the 'O'.
void OnStart()
Tell me if that works!

(10-23-2011, 02:46 AM)palistov Wrote: First do what JenniferOrange suggested. If the OnStart() function isn't capitalized properly, it doesn't run. When it doesn't run, the key-door interaction isn't created. Ergo your key doesn't work! If you still can't get it to work, do this: Close Amnesia. Open the maps folder and if there is a .map_cache file, delete it. Restart Amnesia and see if that works. Cache files cause lots of issues >_>
Wow! Thank you guys! Im gonna test it as soon as I can! Thanks!




RE: Help! Keys - Victor - 10-23-2011

Everything is working now! That explains why nothing I put there worked... I was copying and pasting the script base, and it was always the same mistake... Everytime! THANKS!