WHAT I DID (along with some unrelated tutorial information on further development.)
I basically changed the script from void OnEnter to void OnStart.
Also, i added a function for your AddUseItemCallback. so when you use the item on the AddUseItemCallback, it will call the function of UsedKeyOnDoor, which:unlocks the door, plays the sound "unlock_door.snt" and removes the key item from your inventory
i also added some ""s here and there where theyre needed. true's and false's dont need "".
and i also changed some typos in your item names.
REMEMBER: you need to have a filetype for your sound which you want played.
the default filetypes of both sounds and music in amnesia is .ogg
a SOUND uses .snt files
MUSIC uses .ogg files
if you want a quick tutorial on filetypes, click the spoilerbutton below, if interested.
a .SNT file is a file which tells the script what sounds which are to be played.
example: lets say i have 6 sounds named "MYSOUND_1.ogg", "MYSOUND_2.ogg", "MYSOUND_3.ogg", "MYSOUND_4.ogg", "MYSOUND_5.ogg"
id probably want these sounds to play at random, to add some realism to the sounds (when you hit something, it doesnt make the same sound all the time, it maks a variety of sounds), so i make a .snt file for these sounds, named MYSOUND.snt
i open another .snt made already, and i copy its contents and paste it into mine. i customise the names of the sounds being played from "whatever_sounds_its_told_to_play_at_random" to "MYSOUND_1,2,3,4,5,6"
this will tell the game to play the MYSOUND sounds at random.
music doesnt need a .snt file to be played. to play music you just copy the script from the list on the wiki and type in the music name, with a .ogg filetype.
this script can be copied from my post if you wish. it should be functioning now.
Just remember what ive typed here, and i hope you'll learn from the things i have done and explained.
good luck on your story ^^
*insert creative signature here*
(This post was last modified: 05-08-2012 02:59 PM by darkadders.)