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
key not unlocking door
peepeeboynotreal Offline
Junior Member

Posts: 17
Threads: 10
Joined: Jun 2012
Reputation: 4
#1
key not unlocking door

i use the key on a level door i loose my key but it dosen't unlock
heres my script:
void OnStart()
{
AddUseItemCallback("", "hubkey1", "portal", "portalunlock", true);
}
void portalunlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("portal", false, true);
PlaySoundAtEntity("", "unlock_door", "portal", 0, false);
RemoveItem("hubkey1");
}

my key is called hubkey1 and my door is called portal
any ideas?
06-22-2012, 06:54 AM
Find
Mooserider Offline
Member

Posts: 64
Threads: 11
Joined: Jan 2011
Reputation: 2
#2
RE: key not unlocking door

Your script seems fine to me, the only possible things I think of that would stop it from unlocking are
A) You've made a typo in the level editor and the names aren't matched up exactly, or
B) You need to delete the cache file. Delete "<mapname>.map_cache" and it should be good Smile

Edit: Also sorry but in the future you should probably post questions like this in the development support section Smile

Working on a FC: "Don't Let Go "
(This post was last modified: 06-22-2012, 07:49 AM by Mooserider.)
06-22-2012, 07:46 AM
Find
peepeeboynotreal Offline
Junior Member

Posts: 17
Threads: 10
Joined: Jun 2012
Reputation: 4
#3
Rainbow  RE: key not unlocking door

(06-22-2012, 07:46 AM)Mooserider Wrote: Your script seems fine to me, the only possible things I think of that would stop it from unlocking are
A) You've made a typo in the level editor and the names aren't matched up exactly, or
B) You need to delete the cache file. Delete "<mapname>.map_cache" and it should be good Smile

Edit: Also sorry but in the future you should probably post questions like this in the development support section Smile
done both of those things and its still not working.... Sad
06-22-2012, 11:31 AM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#4
RE: key not unlocking door

Wrong forum, moved.
06-22-2012, 11:36 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: key not unlocking door

SetSwingDoorLocked neither locks nor unlocks level doors; it is used for swing doors.

Tutorials: From Noob to Pro
(This post was last modified: 06-22-2012, 02:15 PM by Your Computer.)
06-22-2012, 02:14 PM
Website Find
SiderealStop Offline
Junior Member

Posts: 32
Threads: 3
Joined: Jun 2012
Reputation: 0
#6
RE: key not unlocking door

Quote:SetSwingDoorLocked neither locks nor unlocks level doors; it is used for swing doors.
To elaborate...If you're using a level door, one that moves you from one map to another, it does not swing open like a normal door that leads from one room to another on the same map. A normal door, I'm guessing, when 'unlocked' using SetSwingDoorLocked doesn't technically unlock it, it makes the door able to swing which makes it look like it's being 'unlocked'. I may be completely wrong there, but basically yeah - I'm pretty sure you can't unlock a level door using SetSwingDoorLocked. I'm not sure myself how to unlock a level door, so if that's what you're using then I can't help. Just wanted to elaborate on what Your Computer said. =3
06-22-2012, 05:01 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#7
RE: key not unlocking door

void SetLevelDoorLocked(string& asName, bool abLocked);
from the engine scripts page on the dev wiki.
06-22-2012, 05:04 PM
Find
Mooserider Offline
Member

Posts: 64
Threads: 11
Joined: Jan 2011
Reputation: 2
#8
RE: key not unlocking door

Oops sorry, didn't realise it was a level door.

Working on a FC: "Don't Let Go "
06-23-2012, 05:56 AM
Find




Users browsing this thread: 1 Guest(s)