The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia Level Editor Key Script Not Working
youngblood128 Offline
Junior Member

Posts: 10
Threads: 2
Joined: Aug 2012
Reputation: 0
#1
Amnesia Level Editor Key Script Not Working

Hey I was really looking for some help on my script, I used a layout to make it so that a key works on a certain door I've seen tutorials and tried it using that layout but it didn't work i revised it and fixed some errors but it still doesn't work(in depth explanation at bottom)and I also tried typing it from scratch and looking at various videos and searching the forums I am still stuck here is my coding.
extra_english.lang file:

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You awake in your room to discover that some form of darkness followed you one night you had a case of amnesia and connot remember the horrors of that night whatever it is...it wants you, it is your job to discover his secret and stop the darkness.</Entry>
</CATEGORY>
<CATEGORY Name="inventory">
<Entry Name="ItemName_Key1">Main Hall Key</Entry>
<Entry Name="ItemDesc_Key1">Opens Main Hall Door.</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_01_Name">Danger!</Entry>
<Entry Name="Note_01_Text">Brother! Are you ok I hope you are we heard noises outside and when we went to investigate you were lying on the the floor screaming "man and chain" we took you upstairs to your room so that you could rest about 30 minutes later a death was reported people said they were being attacked by a man covered in chains you know something about this...everybody is dying!...I want you to be save I'm going to barracade the door to protect you I'm going out I want to help the people who I hear with distant screams don't worry about me just be safe and stop whatever this is! </Entry>
<Entry Name="Note_02_Name">Escape!</Entry>
<Entry Name="Note_02_Text">Trapped in this room monster outside he seems to be blocking everyone from leaving I had a plan but its too late due to over growth of bushes, trees and plants half of the castle is covered in plants so we boarded up the windows weeks ago to prevent plants from coming into the castle; with some kind of dagger and a crowbar you might be able to escape I had a crowbar but I dropped it in the prison...I hear him! Good luck to whom ever reads this...you'll need it.</Entry>
</CATEGORY>
</LANGUAGE>
my maps.hps file

void OnEnter()
{
AddUseItemCallback("", "Key_1", "Main1", "UsedKeyOnDoor", true);
}


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


void OnLeave()
{

}
--------------------------------
That's the coding I just started, with my key name is key_1 and its sub name is key1 and the door is called
Main1 what happens is that when I pick up the key it says "picked up" but it has no name and no description and it doesn't unlock the door and help would be great thanks.


08-08-2012, 11:28 PM
Find


Messages In This Thread
Amnesia Level Editor Key Script Not Working - by youngblood128 - 08-08-2012, 11:28 PM



Users browsing this thread: 1 Guest(s)