Door Open/Close Depending on Situation - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Door Open/Close Depending on Situation (/thread-4509.html) Pages:
1
2
|
Door Open/Close Depending on Situation - Armored Cow - 09-18-2010 When the player steps into a trigger area, I want the door that they just walked through to slam shut (if they left it open) or creak open slowly (if they closed it). I can get the door to slam shut if it's open but am not really sure how to do it this way instead. Any help would be appreciated. RE: Door Open/Close Depending on Situation - Liag - 09-18-2010 You just need to use GetSwingDoorClosed() to check if the door is open or closed, and as for creaking it open slowly, check 00_rainy_hall.hps (beginning at line 817). RE: Door Open/Close Depending on Situation - Armored Cow - 09-18-2010 I looked at it but am still confused. For that section, the door was always closed so there was no need to check if it was closed or not. If I tell it to check for if it is closed or not, how do I distinguish which action to take? I know I need an "if" somewhere but am unsure what to do exactly. RE: Door Open/Close Depending on Situation - jens - 09-18-2010 Assuming you have created the area and the callback for entering into the area. GetSwingDoorClosed() will return a true or false when you use it, so if you do: Code: //Player enters the area, we check if door is closed or open RE: Door Open/Close Depending on Situation - Armored Cow - 09-18-2010 Thank you so much Jens! RE: Door Open/Close Depending on Situation - theDARKW0LF - 09-18-2010 I followed what Jens posted, but I get an error which states, "main (81, 9): ERR : No matching signatures to 'CreakOpen()' What gives? EDIT: Lol, it seems I didn't notice that there was more down the code box so I had only copied the top... RE: Door Open/Close Depending on Situation - Armored Cow - 09-18-2010 Actually I'm having troubles too. It's only slamming the door, whether it's already closed or open. Firstly, I have this in my void OnStart section: Code: //Callback to slam door Code: //Function called when player steps into area_lock_door RE: Door Open/Close Depending on Situation - theDARKW0LF - 09-18-2010 Yeah the creaking open of the door doesn't work for me either, only it slamming does. RE: Door Open/Close Depending on Situation - Pandemoneus - 09-18-2010 You have to experiment a bit with the values here. void TimerCreakDoor(string &in asTimer) { AddPropForce("castle_1", 1, 0, 0, "World"); } You might have to use -1, -2 or 2, just try it out. [edit] You also got a mistake in the code. Code: else Use: Code: else { You have to use { } when you use more than 1 line in if-, else-, for-clauses and so on. RE: Door Open/Close Depending on Situation - Armored Cow - 09-18-2010 No, Pandemoneus, the problem isn't that. It's still slamming the door. It's not just that the opening won't work, but that it doesn't even attempt to open it. |