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 a level door with a key error?
Hailfiretank Offline
Junior Member

Posts: 33
Threads: 12
Joined: Jun 2012
Reputation: 0
#1
Unlocking a level door with a key error?

Me again...

My problem now is that I want to unlock a level door with a key (not to remove the key from inventory though).

When I use the key on the door, it makes the unlocking sound, but does not unlock the door :/

I've been through all the scripting tutorials, and its not a problem connecting the two maps, as it works when the door is unlocked.

Here is my script for the map:

void OnStart()

{
SetEntityConnectionStateChangeCallback("secret_lever", "func_shelf");
AddEntityCollideCallback("Player", "door_slam", "slam", true, 1);
AddEntityCollideCallback("Player", "brute_spawn", "MonsterFunction1", true, 1);
AddEntityCollideCallback("brute_1", "brute_spawn", "NewPath", true, 1);
SetEntityCallbackFunc("key_kirk", "OnPickup");
AddUseItemCallback("", "key_kirk", "colonade", "Unlock", true);
}

void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret_door",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}

void slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_5", true, true);
SetSwingDoorLocked("castle_5", true, true);
PlaySoundAtEntity("", "react_pant.snt", "castle_5", 0, false);
PlaySoundAtEntity("", "00_laugh.snt", "castle_5", 0, false);
}

void OnPickup(string &in asEntity, string &in type)
{
PlayMusic("10_puzzle01.ogg", false, 1, 0.1, 10, false);
}

void MonsterFunction1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("brute_1", true);
AddEnemyPatrolNode("brute_1", "PathNodeArea_1", 0.01, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_2", 0.01, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_3", 0.01, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_4", 4, "");
}

void NewPath(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("brute_1", "PathNodeArea_5", 0.01, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_6", 0.01, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_7", 0.01, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_8", 4, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_9", 0.01, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_10", 0.01, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_11", 0.01, "");
}

void Unlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("colonade", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "colonade", 0.0f, false);
}

void OnEnter()
{
PlayMusic("02_amb_strange", true, 1, 5, 0, true);
}

The level door is named 'colonade', and the key is names 'key_kirk'.

Any help would be a appreciated. Sorry for all these different threads I keep making :/
(This post was last modified: 03-07-2013, 11:39 PM by Hailfiretank.)
03-07-2013, 11:30 PM
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#2
RE: Unlocking a level door with a key error?

Give me a minute
(This post was last modified: 03-07-2013, 11:48 PM by ExpectedIdentifier.)
03-07-2013, 11:48 PM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#3
RE: Unlocking a level door with a key error?

Use "SetLevelDoorLocked". "SetSwingDoorLocked" is for regular door only, not for level doors.

[Image: the-cabin-in-the-woods-masked-people.jpg]
03-07-2013, 11:49 PM
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#4
RE: Unlocking a level door with a key error?

PHP Code: (Select All)
SetLevelDoorLocked("colonade"false); 

Use that instead of

PHP Code: (Select All)
SetSwingDoorLocked("colonade"falsetrue); 





Dang, too slow Tongue
Should of refreshed the page first. Haha.
(This post was last modified: 03-07-2013, 11:55 PM by ExpectedIdentifier.)
03-07-2013, 11:55 PM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#5
RE: Unlocking a level door with a key error?

(03-07-2013, 11:55 PM)sonataarctica Wrote:
PHP Code: (Select All)
SetLevelDoorLocked("colonade"false); 

Use that instead of

PHP Code: (Select All)
SetSwingDoorLocked("colonade"falsetrue); 





Dang, too slow Tongue
Should of refreshed the page first. Haha.

Lol.

[Image: the-cabin-in-the-woods-masked-people.jpg]
03-08-2013, 12:12 AM
Find
Hailfiretank Offline
Junior Member

Posts: 33
Threads: 12
Joined: Jun 2012
Reputation: 0
#6
RE: Unlocking a level door with a key error?

Thanks guys! Big Grin
03-08-2013, 05:59 PM
Find




Users browsing this thread: 1 Guest(s)