Jump to content
Helik

Door should have a lua status function

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.

Share this post


Link to post
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.... 

Share this post


Link to post
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. 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...