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
The secret door
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
RE: The secret door

I'm not 100% certain I understand exactly what you're trying to do. You want to press a button, that button opens a door, behind that door is a lever, when pulled the lever opens a secret shelf? Also, what't the name of the secret shelf? It appears that you are using 2 seperate names ("shelf_secret_door_rot_1" and "shelf_move_1"), or is that just an area you're using to play a sound at? Anyways, here's what I came up with:

When the player interacts with the button, the door will be unlocked. When the lever is pulled, the secret shelf will move:

void OnStart()
{
SetEntityPlayerInteractCallback("button_simple_1", "Secret_move", true);
SetEntityCallbackFunc("key_study_1", "Monster");
ConnectEntities("", "Lever_1", "shelf_secret_door_rot_1", false, 1, "func_shelf");
}

void Monster(string &in asEntity, string &in asType)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
}

void Secret_move(string &in asEntity)
{
SetSwingDoorLocked("prison_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "prison_1", 0.5f, false);
}

void func_shelf(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
}


void OnEnter ()
{

}

void OnLeave ()
{

}

Hope that helped ._.

I rate it 3 memes.
08-07-2012, 05:26 PM
Find


Messages In This Thread
The secret door - by The chaser - 08-07-2012, 12:23 PM
RE: The secret door - by The Shanus - 08-07-2012, 05:10 PM
RE: The secret door - by Adny - 08-07-2012, 05:26 PM



Users browsing this thread: 1 Guest(s)