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
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#5
RE: Amnesia Level Editor Key Script Not Working

(08-09-2012, 09:26 AM)Seragath Wrote: I've always found the .LANG to be silly and not able to listen to you even though everything is correct. I checked the "AddUseItemCallback" And the last one is a bool. (True/false) for auto destroying the item when used. I guess that means it's removed after it's been used or breaks up like the crowbar does. So having another script to remove the key when you've put this to true could confuse the engine. Or it has nothing to do with it at all..I've not really tested locked doors myself yet. (Yeah I know stupid, huh ?)



And I believe you must have:
void OnStart()
{
}

I think.. Blush
OnStart means something will happen when the player first enters the map
OnEnter mean something will happen when the player enters the map (so, everytime)

(08-08-2012, 11:28 PM)youngblood128 Wrote: 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:



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.


Main Hall Key
Opens Main Hall Door.


Danger!
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!
Escape!
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.


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.






///////////////////////////// try this

</LANGUAGE>


<CATEGORY Name ="Inventory">
<Entry Name="ItemName_Key_1">YourKeyName</Entry>
<Entry Name="ItemDesc_Key_1">"YourKeyDescription"</Entry>
</CATEGORY>

</LANGUAGE>


If this doesn't work, try to run the leveleditor as admin and edit it.
Also, make sure you save the lang and the script.

[Image: 25F7U37.png]
(This post was last modified: 08-09-2012, 10:41 PM by Melvin.)
08-09-2012, 10:39 PM
Website Find


Messages In This Thread
RE: Amnesia Level Editor Key Script Not Working - by Melvin - 08-09-2012, 10:39 PM



Users browsing this thread: 1 Guest(s)