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
Door script error
masken94 Offline
Junior Member

Posts: 5
Threads: 1
Joined: May 2011
Reputation: 0
#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
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#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
masken94 Offline
Junior Member

Posts: 5
Threads: 1
Joined: May 2011
Reputation: 0
#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
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#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
masken94 Offline
Junior Member

Posts: 5
Threads: 1
Joined: May 2011
Reputation: 0
#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




Users browsing this thread: 2 Guest(s)