Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help! Keys
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#1
Sad  Help! Keys

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.
(This post was last modified: 01-08-2013, 04:21 PM by Victor.)
10-22-2011, 08:51 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#2
RE: Help! Keys

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!

Ba-da bing, ba-da boom.
10-22-2011, 08:58 PM
Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#3
RE: Help! Keys

(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!


Attached Files
.jpg   FFFFFFFFFFFFUUUUUUUUUUUUUUU.jpg (Size: 135.14 KB / Downloads: 157)
(This post was last modified: 10-22-2011, 09:55 PM by Victor.)
10-22-2011, 09:10 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Help! Keys

(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?


10-22-2011, 09:56 PM
Find
Brute Offline
Member

Posts: 197
Threads: 10
Joined: Aug 2011
Reputation: 3
#5
RE: Help! Keys

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!





(This post was last modified: 10-22-2011, 10:00 PM by Brute.)
10-22-2011, 09:59 PM
Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#6
RE: Help! Keys

(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?


Attached Files
.png   FFFFFFFFFFFAAAAAAAAAAAAAAAAAAAAAA.png (Size: 146.94 KB / Downloads: 151)
(This post was last modified: 10-22-2011, 11:12 PM by Victor.)
10-22-2011, 10:12 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#7
RE: Help! Keys

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

Ba-da bing, ba-da boom.
10-23-2011, 02:17 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#8
RE: Help! Keys

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 >_>

10-23-2011, 02:46 AM
Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#9
RE: Help! Keys

(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!

10-23-2011, 03:18 AM
Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#10
RE: Help! Keys

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!
10-23-2011, 04:34 PM
Find




Users browsing this thread: 2 Guest(s)