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
Help on locking level doors?
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#11
RE: Help on locking level doors?

paste the callback too, and where you placed it

Think, before you speak Google, before you post
07-12-2012, 01:02 AM
Find
Wyz Offline
Junior Member

Posts: 12
Threads: 3
Joined: Jul 2012
Reputation: 0
#12
RE: Help on locking level doors?

void OnStart()
{
SetPlayerLampOil(0);
PlayMusic("ambience_voice.ogg", true, 1, 5, 0, true);

//-------CALLBACKS-------
//////////////////////////

AddUseItemCallback("", "OldKey", "Atrium", "AtriumDoorUnlock", true);
}


//-------UNLOCKS-------
////////////////////////

void AtriumDoorUnlock(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Atrium", false);
PlaySoundAtEntity("", "unlock_door", "Atrium", 0, false);
RemoveItem("OldKey");
}

That's the section that's supposed to unlock my door, I get a "cannot use item this way!" message when I use the key, but the door unlocks when I pick the key up. Thanks

Also, as I pick up the key, I can audibly hear the door unlock in the next room. Maybe it's the order of my script? Could I separate my AtriumDoorUnlock function to happen once I use the key?
(This post was last modified: 07-12-2012, 04:19 PM by Wyz.)
07-12-2012, 02:09 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#13
RE: Help on locking level doors?

You have probably a callback somewhere that when you pick up the key it calls the function AtriumDoorUnlock. Have you written AtriumDoorUnlock inside the key's entity tab?

07-12-2012, 03:57 PM
Find
Wyz Offline
Junior Member

Posts: 12
Threads: 3
Joined: Jul 2012
Reputation: 0
#14
RE: Help on locking level doors?

(07-12-2012, 03:57 PM)SilentStriker Wrote: You have probably a callback somewhere that when you pick up the key it calls the function AtriumDoorUnlock. Have you written AtriumDoorUnlock inside the key's entity tab?
Yes, the callback func is listed on the key. Is that my problem? Because my callback is a useitem, could that be what you're saying, the unlock function is called as I pick it up?
07-12-2012, 04:19 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#15
RE: Help on locking level doors?

Yes the callback func in the key is called when the key is picked up so remove that and it should work Smile

07-12-2012, 08:26 PM
Find
Wyz Offline
Junior Member

Posts: 12
Threads: 3
Joined: Jul 2012
Reputation: 0
#16
RE: Help on locking level doors?

(07-12-2012, 08:26 PM)SilentStriker Wrote: Yes the callback func in the key is called when the key is picked up so remove that and it should work Smile
Thank you so much it worked!! Big Grin
07-12-2012, 09:10 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#17
RE: Help on locking level doors?

You're welcome Smile

07-12-2012, 09:35 PM
Find




Users browsing this thread: 2 Guest(s)