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
Unlocking Level Doors with Item Pick-Up.
mmeowwcat Offline
Junior Member

Posts: 7
Threads: 2
Joined: Sep 2013
Reputation: 0
#1
Unlocking Level Doors with Item Pick-Up.

Hello everybody, I am having some trouble with scripting. I am very new with scripting, but I have done some work and get what functions do, and how they do it. I also understand the .lang file fairly well also. So, my problem is, I want a level door that is usually locked, to become unlocked when I pick up the lantern. I have tried
SetLevelDoorLocked(string& asName, bool abLocked);
with the bool set to both true and false, with no difference, the door is still locked. If it helps, I have lantern set as the PlayerInteractCallBack, and in that function I have the code above, and a message that does display properly. Any help on this matter would be greatly appreciated.

Regards
mmeowwcat
(This post was last modified: 09-14-2013, 05:38 PM by mmeowwcat.)
09-14-2013, 04:44 AM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: Unlocking Level Doors with Item Pick-Up.

Are you sure that it's a lever door and not a swing door? Swing doors are the ones that you can push and pull open.

Also, ensure that you callbacks and items match. But if you still need help, post your script file.
(This post was last modified: 09-14-2013, 05:13 AM by Tomato Cat.)
09-14-2013, 05:13 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#3
RE: Unlocking Level Doors with Item Pick-Up.

Check the door's name, try to set it inactive with SetEntityActive to test.

09-14-2013, 05:19 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: Unlocking Level Doors with Item Pick-Up.

SetEntityPlayerInteractCallback("YOURITEM", "AfterPickUpLantern", true);
---
void AfterPickUpLantern(string &in asItem)
{
PlaySoundAtEntity("", "unlock_door", "YOURLEVELDOOR", 0, false);
SetLevelDoorLocked("YOURLEVELDOOR", false);
}

---*FOR SWINGDOOR*---
SetSwingDoorLocked("YOURSWINGDOOR", false, true);

Maybe this would work.
(This post was last modified: 09-14-2013, 03:01 PM by DnALANGE.)
09-14-2013, 02:38 PM
Find
mmeowwcat Offline
Junior Member

Posts: 7
Threads: 2
Joined: Sep 2013
Reputation: 0
#5
RE: Unlocking Level Doors with Item Pick-Up.

DnALANGE your answer actually worked, thank you so much. Also, thank you to everybody else who took time out of their day to try and help me out with this.
09-14-2013, 05:36 PM
Find




Users browsing this thread: 1 Guest(s)