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
.Lang File Help (FIXED) Can't use key on door.
Author Message
Darkaroth Offline
Junior Member

Posts: 11
Joined: Feb 2012
Reputation: 0
Post: #1
(FIXED) Can't use key on door.
Hey all.

I'm trying to make a amnesia custom map (started yesterday) and for some reason my key won't work on the door.
What's wrong?

This is the script:
////////////////////////////
// Run when entering map
void OnStart()
{
AddEntityCollideCallback("Player", "scriptmusic","scriptmusic", true, 0);
AddEntityCollideCallback("Player", "CloseDoor1", "CollideCloseDoor1", true, 1);
AddUseItemCallback("", "key1", "Door_1", "UsedKeyOnDoor", true);
}

void scriptmusic(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("19_event_brute.ogg", true, 1.00, 0, 5, true);
}
if (alState == -1)
{
StopMusic(10, 5);
}

}

void CollideCloseDoor1(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorLocked("mansion_2", true, true);
}

void UsedKeyOnDoor(string &in item, string &in door)
{
    SetSwingDoorLocked("Door_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "Door_1", 0, false);
    RemoveItem("key1");
}


and this is the .lang file:
    
        key
        key

sorry for my english ( secondary language )
(This post was last modified: 02-06-2012 09:06 PM by Darkaroth.)
02-06-2012 07:11 PM
Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 868
Joined: Aug 2011
Reputation: 26
Post: #2
RE: Can't use key on door.
Interact syntax in wiki were:
void MyFunc(string &in asEntity)


No idea where u got yours...

The Interrogation
Chapter 1

My tutorials
(This post was last modified: 02-06-2012 07:49 PM by Elven.)
02-06-2012 07:49 PM
Find all posts by this user Quote this message in a reply
Darkaroth Offline
Junior Member

Posts: 11
Joined: Feb 2012
Reputation: 0
Post: #3
RE: Can't use key on door.
Thanks, copied it from some video on youtube.
(02-06-2012 07:49 PM)Elven Wrote:  Interact syntax in wiki were:
void MyFunc(string &in asEntity)


No idea where u got yours...
i fixed the name on the key. But it still won't open the door for some reason. What else could be the problem?
(This post was last modified: 02-06-2012 07:58 PM by Darkaroth.)
02-06-2012 07:51 PM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 801
Joined: Jul 2011
Reputation: 65
Post: #4
RE: Can't use key on door.
The problem is Elven gave you the incorrect syntax.

You want
void UsedKeyOnDoor(string &in asItem, string &in asEntity)

02-06-2012 09:00 PM
Find all posts by this user Quote this message in a reply
Darkaroth Offline
Junior Member

Posts: 11
Joined: Feb 2012
Reputation: 0
Post: #5
RE: Can't use key on door.
(02-06-2012 09:00 PM)Obliviator27 Wrote:  The problem is Elven gave you the incorrect syntax.

You want
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
Thanks alot, worked like a charm !
02-06-2012 09:06 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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