Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Door Question
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#1
Door Question

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!
(This post was last modified: 03-08-2012, 05:44 AM by Nevicar.)
03-07-2012, 11:00 PM
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#2
RE: Door Question

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.

The Nightmares v1.0 - Dreadful Fires WIP
03-08-2012, 02:03 AM
Find
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#3
RE: Door Question

Excellent, thanks! Will post results.
03-08-2012, 02:34 AM
Find
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#4
RE: Door Question

Disregard this, I apparently can't delete posts. :I
(This post was last modified: 03-08-2012, 03:49 AM by Nevicar.)
03-08-2012, 03:43 AM
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#5
RE: Door Question

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.

The Nightmares v1.0 - Dreadful Fires WIP
03-08-2012, 03:47 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Door Question

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.

Tutorials: From Noob to Pro
03-08-2012, 03:49 AM
Website Find
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#7
RE: Door Question

Decided to go a different path with how the door is going to interact. Marking this as solved, thanks for the help you two.
03-08-2012, 05:44 AM
Find




Users browsing this thread: 2 Guest(s)