Jump to content

Door should have a lua status function


Helik

Recommended Posts

In the video just released we saw that there was a button with a getState(), but not the door. Every item in the game should have a getState() function. Also every item should have tags and a list so I can do something like "close all exterior doors of the ship", "is there any door open?", etc.

 

Regards.

Link to comment
Share on other sites

Why need that getstate for a door? It's either open or closed.

I'm no programmer but isn't it faster and better just to close all doors when armosphere<0,5 instead of asking what state each door is in, then closing those open ones when atmosphere<0,5 ? 

 

Makes more sense to me.... 

Link to comment
Share on other sites

Also if you want the state of the door to affect things. You could have a bunch of lights turn on while a door is open, set off an alarm, etc. 

 

I totally agree, every object in the game that has states (of they can be on or off, that counts) needs to have a function to get it's current state. 

Link to comment
Share on other sites

This also helps if you want to script an airlock/security system. Check to see if the outer door is closed and only trusted people are in the airlock before the second door is opened

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...