The secret door - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: The secret door (/thread-17566.html) |
The secret door - The chaser - 08-07-2012 Hello everyone: I have a problem. In the main story, at the beggining, after reading the note from Daniel to himself, you must use a lever. That lever moves a shelf, but moves a secret door too. That secret door is just as a castle wall. I wanted to use that with a button but i don't know what could the script be. Is just different? Well, i will put the script in here, if there's something wrong. ///////////////////////////////////////////////////////////////////////////// void OnStart () { SetLocalVarInt("Var1", 0); SetEntityPlayerInteractCallback("button_simple_1", "Secret_move", true); SetEntityCallbackFunc("key_study_1", "Monster"); SetEntityConnectionStateChangeCallback("Lever_1", "func_shelf"); } void Monster (string &in asEntity, string &in type) { 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) { AddLocalVarInt("Var1", 1); SD(); } void func_shelf(string &in asEntity, int alState) { if (alState == 1) { SetMoveObjectState("shelf_secret_door_rot_1",1.0f); PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false); return; } } void SD() { if(GetLocalVarInt("Var1") == 1) { SetSwingDoorLocked("prison_1", false, true); PlaySoundAtEntity("", "unlock_door.snt", "prison_1", 0.5f, false); } } void OnEnter () { } void OnLeave () { } /////////////////////////////////////////////////////// Is simple: A button opens the secret door (yes, the script doesn't say that, i know) behind the secret door there is a lever that moves a shelf. Behind that shelf there is a corridor, you push a button and a door opens. How i could script that? I have a limited experience (i know the basics, like triggering monsters, keys, and other things) but the secret door escapes to my understanding. PS: My english isn't the best, but i do what i can RE: The secret door - The Shanus - 08-07-2012 Perhaps just use addforceprop or whatever function for it to move the shelf? That seems pretty simple - I dont see why it shouldnt work. What I don't understand is why you want a button, a lever, and a button straight after each other. It seems a bit pointless to me? A bit repetitive too. Just have a hidden button/ lever somewhere in the room which moves the shelves, and have the shelf move so that you can go to the door at the end, instead of having to do the same thing over and over. RE: The secret door - Adny - 08-07-2012 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 ._. |