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
amnesia level editor key for locked door problem
carlos111897 Offline
Junior Member

Posts: 2
Threads: 1
Joined: Feb 2013
Reputation: 0
#1
amnesia level editor key for locked door problem

Hey guys i just wanted to ask for some help for my custom story. i need help with a key to unlock a specific door. ive written everything on the script but it doesnt seem to work it just says "unable to use on this object" or something like that.
i also wanted to know how to load into different maps such as when entering a door and a loading screen comes up.
So if you know please tell me and thank you in advance.

So heres my script:

////////////////////////////
// Run when entering map
void OnEnter()
{
void AddUseItemCallback("","monsterdoorkey_1", "bedroommansiondoor ", "UsedKeyOnDoor", true);
}

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




And my lang file(i dont know if i need to change it or the directory its ment to be placed in):

</LANGUAGE>


<CATEGORY Name ="Inventory">
<Entry Name="ItemName_monsterdoorkey_1">YourKeyName</Entry>
<Entry Name="ItemDesc_monsterdoorkey_1">"YourKeyDescription"</Entry>
</CATEGORY>

</LANGUAGE>



Thanks guy in advance.
02-19-2013, 03:42 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: amnesia level editor key for locked door problem

You shouldn't use void OnEnter(). Use void OnStart instead. I think that's the problem.
And you have to use level doors to change to other maps. Just click on the level door, click the entity tab, go to StartPos (Enter the name of your playerstart area in the other map). Click the '...' next to MapFile and select the map you want it to bring you to.
You could also use the ChangeMap command but using level doors makes more sense.
If you need help with commands, I'd recommend this site.

EDIT: And you used </LANGUAGE> in the beginning of your .lang file. Change it to <LANGUAGE>. And perhaps doing this: RemoveItem("monsterdoorkey_1"); could do something
(This post was last modified: 02-19-2013, 03:56 PM by OriginalUsername.)
02-19-2013, 03:47 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#3
RE: amnesia level editor key for locked door problem

(02-19-2013, 03:47 PM)Smoke Wrote: You shouldn't use void OnEnter(). Use void OnStart instead. I think that's the problem.
And you have to use level doors to change to other maps. Just click on the level door, click the entity tab, go to StartPos (Enter the name of your playerstart area in the other map). Click the '...' next to MapFile and select the map you want it to bring you to.
You could also use the ChangeMap command but using level doors makes more sense.
If you need help with commands, I'd recommend this site.

EDIT: And you used </LANGUAGE> in the beginning of your .lang file. Change it to <LANGUAGE>. And perhaps doing this: RemoveItem("monsterdoorkey_1"); could do something

The OnStart function will execute only the first time the player loads the map. OnEnter will execute everytime the player loads the map. So, it doesn't actually matter where carlos111897 has the callback.

Double check that the names for the key/door are the same in your script as they are in the level editor.

In Ruins [WIP]
02-19-2013, 05:10 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: amnesia level editor key for locked door problem

Check for .map_cache and check names-for the loading screen thing, put this in your void OnLeave():

void OnLeave()
{
SetupLoadScreen("TextCategory", "TextEntry", 1, "urimage.jpg");

}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
02-19-2013, 05:28 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#5
RE: amnesia level editor key for locked door problem

Oh geez, how could I have missed this...

PHP Code: (Select All)
////////////////////////////
// Run when entering map
void OnEnter()
{
void AddUseItemCallback("","monsterdoorkey_1""bedroommansiondoor ""UsedKeyOnDoor"true);
// a couple problems in the line above
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("bedroommansiondoor"falsetrue);
PlaySoundAtEntity("""unlock_door""bedroommansiondoor"0false);
RemoveItem(monsterdoorkey_1); // problem here too


In the line:
void AddUseItemCallback("","monsterdoorkey_1", "bedroommansiondoor ", "UsedKeyOnDoor", true);
Take out the void at the beginning of the line. Also, you had a space after bedroommansiondoor.

Also, you should change RemoveItem(monsterdoorkey_1) to RemoveItem("monsterdoorkey_1"). You needed to add quotations ("") around monsterdoorkey_1.

In Ruins [WIP]
02-20-2013, 08:47 AM
Find
carlos111897 Offline
Junior Member

Posts: 2
Threads: 1
Joined: Feb 2013
Reputation: 0
#6
RE: amnesia level editor key for locked door problem

(02-20-2013, 08:47 AM)NaxEla Wrote: Oh geez, how could I have missed this...

PHP Code: (Select All)
////////////////////////////
// Run when entering map
void OnEnter()
{
void AddUseItemCallback("","monsterdoorkey_1""bedroommansiondoor ""UsedKeyOnDoor"true);
// a couple problems in the line above
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("bedroommansiondoor"falsetrue);
PlaySoundAtEntity("""unlock_door""bedroommansiondoor"0false);
RemoveItem(monsterdoorkey_1); // problem here too


In the line:
void AddUseItemCallback("","monsterdoorkey_1", "bedroommansiondoor ", "UsedKeyOnDoor", true);
Take out the void at the beginning of the line. Also, you had a space after bedroommansiondoor.

Also, you should change RemoveItem(monsterdoorkey_1) to RemoveItem("monsterdoorkey_1"). You needed to add quotations ("") around monsterdoorkey_1.

Thank for your help but it still doesnt work Sad keeps on saying "unable to use item"
02-20-2013, 06:55 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: amnesia level editor key for locked door problem

Unable to use item means names are wrong. Check both the name of the key and the door. Wink

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
02-20-2013, 09:31 PM
Find




Users browsing this thread: 1 Guest(s)