Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia custom story problem
Author Message
KodiakZ Offline
Junior Member

Posts: 4
Joined: May 2012
Reputation: 0
Post: #1
Question Amnesia custom story problem
So I'm working on a Amnesia custom story but I'm stuck. I've made a key to open a specific door, but it will not work. The key is for a map changing door. My key is called Key_1 and my door is called Door_1. I cannot seem to get it to work. Here's my code:


////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Key_1", "Door_1", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Door_1", false);
PlaySoundAtEntity("", "unlock_door", "Door_1", 0, false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
}

Any help will be appreciated! Thanks for reading!
05-12-2012 03:11 PM
Find all posts by this user Quote this message in a reply
EXAWOLT Offline
Member

Posts: 117
Joined: Apr 2012
Reputation: 3
Post: #2
RE: Amnesia custom story problem
I had the same problem bro.
My solution was to create 2 level doors, one fake that's locked
and another un-active unlocked door wich will lead you further.
add useitem callback with the key on the fake door, and call SetEntityActive("fake", false);
and make the real door appear SetEntityActive("real", true);

simply nuff said




05-12-2012 04:44 PM
Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 275
Joined: Apr 2012
Reputation: 15
Post: #3
RE: Amnesia custom story problem
Is the door in question a level door (i.e., it's name is level_wood or something like that) or is it a swing door (i.e., it's name is mansion_1 or something like that).

If it's a LevelDoor, then the SetLevelDoorLocked function is working as intended.
If it's a SwingDoor, then you need to use the SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects); function.

Is your key named "Key_1"?
Is your door named "Door_1"?

EXAWOLT Wrote:I had the same problem bro.

My solution was to create 2 level doors, one fake that's locked

and another un-active unlocked door wich will lead you further.

add useitem callback with the key on the fake door, and call SetEntityActive("fake", false);

and make the real door appear SetEntityActive("real", true);
^^ Yeah, sorry no offense but ignore this.

If done correctly you only need the key and the door, nothing else is needed and you're just making life more difficult for yourself.

Check me out at my youtube channel: http://www.youtube.com/user/Putmalk?feature=mhee

I post videos of my Amnesia creations.
(This post was last modified: 05-12-2012 11:28 PM by Putmalk.)
05-12-2012 11:26 PM
Find all posts by this user Quote this message in a reply
KodiakZ Offline
Junior Member

Posts: 4
Joined: May 2012
Reputation: 0
Post: #4
RE: Amnesia custom story problem
(This post was last modified: 05-13-2012 10:18 AM by KodiakZ.)
05-13-2012 10:16 AM
Find all posts by this user Quote this message in a reply
pandasFTW Offline
Member

Posts: 71
Joined: Feb 2012
Reputation: 2
Post: #5
RE: Amnesia custom story problem

War is sweet, to those who have never experienced it
-Aristotle
(This post was last modified: 05-13-2012 10:35 AM by pandasFTW.)
05-13-2012 10:32 AM
Find all posts by this user Quote this message in a reply
KodiakZ Offline
Junior Member

Posts: 4
Joined: May 2012
Reputation: 0
Post: #6
RE: Amnesia custom story problem
Ok, so. I've just made a new door, and it's a level door. (Called Level_Celler_1) So I'm testing to see if it works now. Wow! it worked! Thanks!

Holy **** IT WORKED! Thank you dude! Big Grin
(This post was last modified: 05-13-2012 11:05 AM by KodiakZ.)
05-13-2012 11:02 AM
Find all posts by this user Quote this message in a reply
FlyingFruitcake Offline
Junior Member

Posts: 18
Joined: May 2012
Reputation: 0
Post: #7
RE: Amnesia custom story problem
I used this code, but I used it in ''Run when entering map''
///Run when entering map///
void OnEnter() {
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);}
void KeyOnDoor(string &in asItem, string &in asEntity){     
SetSwingDoorLocked("door_1", false, true);     
PlaySoundAtEntity("", "unlock_door", "door_1", 1, false);    
RemoveItem("key_1");
}


Make sure your door and key have the same name as in the code...

Always watch your back...
05-13-2012 11:07 AM
Find all posts by this user Quote this message in a reply
KodiakZ Offline
Junior Member

Posts: 4
Joined: May 2012
Reputation: 0
Post: #8
RE: Amnesia custom story problem
It already had. I checked for spelling mistaked missing , and stuff. But when i made a new door and didn't rename it just so its called original name it worked. Now my only problem is note text not showing and name of key not showing.
05-13-2012 11:10 AM
Find all posts by this user Quote this message in a reply
pandasFTW Offline
Member

Posts: 71
Joined: Feb 2012
Reputation: 2
Post: #9
RE: Amnesia custom story problem
(05-13-2012 11:02 AM)KodiakZ Wrote:  Ok, so. I've just made a new door, and it's a level door. (Called Level_Celler_1) So I'm testing to see if it works now. Wow! it worked! Thanks!

Holy **** IT WORKED! Thank you dude! Big Grin
glad to hear it worked out for ya Smile

War is sweet, to those who have never experienced it
-Aristotle
05-13-2012 11:10 AM
Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 275
Joined: Apr 2012
Reputation: 15
Post: #10
RE: Amnesia custom story problem
I would suggest not renaming doors when level editing (especially if you're new).

LevelDoors:
level_wood
level_celler
level_dungeon
level_hub
level_orb_room_door
level_wood_double
level_cistern

SwingDoors:
mansion
metal
castle
cellar
prison
prison_section
elevator_door
hatch_ceiling
hatch_drainage
hatch_metal01
sewer_arched

Special (use SetMoveObjectState)
castle_portcullis
castlebase_secret_door
hatch_large
safety_large_vert
safety_normal_vert


Hope this helps!

Check me out at my youtube channel: http://www.youtube.com/user/Putmalk?feature=mhee

I post videos of my Amnesia creations.
05-13-2012 01:58 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)