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
Leveldoor 'Locked' Key not working!
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#1
Leveldoor 'Locked' Key not working!

So i just made key to open a door. its a level door the key is gone when i use it but it is not opening.

AddUseItemCallback("", "cryptkey", "cryptdoor", "UsedKeyOnDoor", true);

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("cryptdoor", false, true);

PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);

RemoveItem("cryptkey");

}

keyname=cryptkey
doorname=cryptdoor

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
(This post was last modified: 02-15-2013, 04:11 PM by VeNoMzTeamHysterical.)
02-15-2013, 02:53 PM
Website Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#2
RE: Leveldoor 'Locked' Key not working!

You can't use SetSwingDoorLocked script for level doors.
Use SetLevelDoorLocked(string& asName, bool abLocked);

[Image: the-cabin-in-the-woods-masked-people.jpg]
02-15-2013, 03:01 PM
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#3
RE: Leveldoor 'Locked' Key not working!

(02-15-2013, 03:01 PM)No Author Wrote: You can't use SetSwingDoorLocked script for level doors.
Use SetLevelDoorLocked(string& asName, bool abLocked);

Thanks alot i didnt know Smile

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
02-15-2013, 03:37 PM
Website Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#4
RE: Leveldoor 'Locked' Key not working!

Your welcomeSmile

[Image: the-cabin-in-the-woods-masked-people.jpg]
02-15-2013, 03:45 PM
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#5
RE: Leveldoor 'Locked' Key not working!

(02-15-2013, 03:45 PM)No Author Wrote: Your welcomeSmile

So its gonna be

void UsedKeyOnDoor(string& asName, bool abLocked);

{

SetLevelDoorLocked("cryptdoor", false, true);

SetLevelDoorLockedSound("cryptdoor", "unlock_door");

RemoveItem("cryptkey");

}

if im right?

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
02-15-2013, 03:47 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Leveldoor 'Locked' Key not working!

no.
SetLevelDoorLocked("cryptdoor", false);

There is no effect, because it's no swingdoor.


also:
SetLevelDoorLockedSound("cryptdoor", "unlock_door");

I guess what you want is just to play the sound?


Just use:
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);

Trying is the first step to success.
(This post was last modified: 02-15-2013, 03:49 PM by FlawlessHappiness.)
02-15-2013, 03:49 PM
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#7
RE: Leveldoor 'Locked' Key not working!

(02-15-2013, 03:49 PM)BeeKayK Wrote: no.
SetLevelDoorLocked("cryptdoor", false);

There is no effect, because it's no swingdoor.


also:
SetLevelDoorLockedSound("cryptdoor", "unlock_door");

I guess what you want is just to play the sound?


Just use:
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);

You are a beast sir Big Grin

Why don't you make tutorials you will be a popular amnesia tutorial channel ;p

(02-15-2013, 03:49 PM)BeeKayK Wrote: no.
SetLevelDoorLocked("cryptdoor", false);

There is no effect, because it's no swingdoor.


also:
SetLevelDoorLockedSound("cryptdoor", "unlock_door");

I guess what you want is just to play the sound?


Just use:
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);

Lol it does not work... i cant use the key on the level door...
It is maybe because you get a key in the map before?
Or does that not matter?

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
(This post was last modified: 02-15-2013, 04:00 PM by VeNoMzTeamHysterical.)
02-15-2013, 03:51 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#8
RE: Leveldoor 'Locked' Key not working!

Nope. Doesn't matter.

This is how the script should look (Remember you cannot have 2 void OnStart):

void OnStart()
{
AddUseItemCallback("", "cryptkey", "cryptdoor", "UsedKeyOnDoor", true);

}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);

SetLevelDoorLocked("cryptdoor", false);

RemoveItem(asItem);
}


Remember to check that all names are correct with capitals!
It's important!


If it doesn't work, show us the error, and your full script.

Trying is the first step to success.
02-15-2013, 04:05 PM
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#9
RE: Leveldoor 'Locked' Key not working!

(02-15-2013, 04:05 PM)BeeKayK Wrote: Nope. Doesn't matter.

This is how the script should look (Remember you cannot have 2 void OnStart):

void OnStart()
{
AddUseItemCallback("", "cryptkey", "cryptdoor", "UsedKeyOnDoor", true);

}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);

SetLevelDoorLocked("cryptdoor", false);

RemoveItem(asItem);
}


Remember to check that all names are correct with capitals!
It's important!


If it doesn't work, show us the error, and your full script.

OMG it works now you got + rep'd sir Big Grin

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
02-15-2013, 04:10 PM
Website Find




Users browsing this thread: 2 Guest(s)