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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Door script error
Author Message
masken94 Offline
Junior Member

Posts: 5
Joined: May 2011
Reputation: 0
Post: #1
Door script error
I have made ​​a key that works for a door. But when I try to make a key to another another door, I get error. I do not know what I'm doing wrong.Huh
This is the script

////////////////////////////
/ / Run first time starting map
void onStart ()
{
AddUseItemCallback ("", "the_key", "the_door", "KeyOnDoor", true);
}

void KeyOnDoor (string & in asItem, string & in asEntity)
{
SetSwingDoorLocked ("the_door", false, true);
PlaySoundAtEntity ("", "unlock_door", "the_door", 0, true);
RemoveItem ("the_key");
}

////////////////////////////
/ / Run first time starting map
void onStart ()
{
AddUseItemCallback ("", "key_2", "derect", "usedkeyondoor", true);
}

void usedkeyondoor (string & in asItem, string & in asEntity)
{
SetSwingDoorLocked ("derect", false, true);
PlaySoundAtEntity ("", "unlock_door", "derect", 0, true);
RemoveItem ("key_2");
}
05-08-2011 07:31 PM
Find all posts by this user Quote this message in a reply
Simpanra Offline
Senior Member

Posts: 314
Joined: Mar 2011
Reputation: 0
Post: #2
RE: Door script error
///////////////////////////
/ / Run first time starting map
void onStart ()
{
AddUseItemCallback ("", "the_key", "the_door", "KeyOnDoor", true);
AddUseItemCallback ("", "key_2", "derect", "usedkeyondoor", true);
}

void KeyOnDoor (string & in asItem, string & in asEntity)
{
SetSwingDoorLocked ("the_door", false, true);
PlaySoundAtEntity ("", "unlock_door", "the_door", 0, true);
RemoveItem ("the_key");
}
void usedkeyondoor (string & in asItem, string & in asEntity)
{
SetSwingDoorLocked ("derect", false, true);
PlaySoundAtEntity ("", "unlock_door", "derect", 0, true);
RemoveItem ("key_2");
}






Mended it =)
05-08-2011 07:34 PM
Find all posts by this user Quote this message in a reply
masken94 Offline
Junior Member

Posts: 5
Joined: May 2011
Reputation: 0
Post: #3
RE: Door script error
Thank you. Now i don't get error now. but second key_2 wont work with derect.
05-08-2011 07:59 PM
Find all posts by this user Quote this message in a reply
Simpanra Offline
Senior Member

Posts: 314
Joined: Mar 2011
Reputation: 0
Post: #4
RE: Door script error
(05-08-2011 07:59 PM)masken94 Wrote:  Thank you. Now i don't get error now. but second key_2 wont work with derect.

are you sure you called it key_2 in the editor? It might be worth checking =)
05-08-2011 08:07 PM
Find all posts by this user Quote this message in a reply
masken94 Offline
Junior Member

Posts: 5
Joined: May 2011
Reputation: 0
Post: #5
RE: Door script error
(05-08-2011 08:07 PM)Simpanra Wrote:  
(05-08-2011 07:59 PM)masken94 Wrote:  Thank you. Now i don't get error now. but second key_2 wont work with derect.

are you sure you called it key_2 in the editor? It might be worth checking =)

Yes. but some how i did manage to get it work. Can it have something to do with the .lang file.
05-09-2011 09:02 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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