Frictional Games Forum (read-only)
Door Question - 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: Door Question (/thread-13837.html)



Door Question - Nevicar - 03-07-2012

This is the situation:


I have a key that I pick up, and a door behind me. I want to code it to find out if the door is closed, to open it, and if it's open, to close it. I'm not sure if this would be an actual "if" statement, but the way I'm looking at it it would sound like one.

I'm just having trouble combining the functions to make one, or having one call the other.

Thanks!


RE: Door Question - Strembitsky - 03-08-2012

If the door is in state 1, set state 0. If it's in state 0, set to state 1. Have a timer to check these statements.

If you don't know how to make an if statement, use the wiki and study.


RE: Door Question - Nevicar - 03-08-2012

Excellent, thanks! Will post results.


RE: Door Question - Nevicar - 03-08-2012

Disregard this, I apparently can't delete posts. :I


RE: Door Question - Strembitsky - 03-08-2012

You don't have a timer to check it. You need a timer to check if it's open/closed every, lets say, .5 seconds.


RE: Door Question - Your Computer - 03-08-2012

A timer is not required if they're depending on player-area collision. Also, AddPropForce is required to open the door further than what SetSwingDoorClosed can.


RE: Door Question - Nevicar - 03-08-2012

Decided to go a different path with how the door is going to interact. Marking this as solved, thanks for the help you two.