Page 1 of 1

Sliding door mod

PostPosted: Sat Sep 06, 2014 09:36
by AutiCoder
Hi i'm thinking about a mod with sliding door(s) .
The idea is to take a door ( wood , metal , glass ) and make it slide to a side instead of turning open.
I was looking at the code of some door mods , but it's still hard to figure out how the node handling works .
( i'm new to lua ) .
Can someone explain to me how you control movement of nodes in lua ?
Thx

Re: Sliding door mod

PostPosted: Sat Sep 06, 2014 10:19
by kaeza
Nodes are a static part of the environment, so they can't "move".

Your options would be "faking" node movement by removing the "closed" sliding door, use an entity to animate the door, and add the "open" sliding door, or ditch animation completely and simply provide "open" and "closed" variants ("moving" a node in this case is done by removing the node at one position and adding it at another; needless to say, this does not have a "smooth" animation).

P.S: "I" "like" "quotes".

Re: Sliding door mod

PostPosted: Sat Sep 06, 2014 11:35
by Evergreen
kaeza wrote:Nodes are a static part of the environment, so they can't "move".

Your options would be "faking" node movement by removing the "closed" sliding door, use an entity to animate the door, and add the "open" sliding door, or ditch animation completely and simply provide "open" and "closed" variants ("moving" a node in this case is done by removing the node at one position and adding it at another; needless to say, this does not have a "smooth" animation).

P.S: "I" "like" "quotes".

I think sokomine's travelnet mod has sliding doors. Although, they are static. (no entity to "fake" the animation)

Re: Sliding door mod

PostPosted: Tue Sep 09, 2014 02:48
by Sokomine
Evergreen wrote:I think sokomine's travelnet mod has sliding doors. Although, they are static. (no entity to "fake" the animation)

That's right. The elevator doors - which come in glass and steel - "slide" open upon right-click. I don't think animation would be beneficial in this case. When playing on a server, opening/closing a door that way (by having only two stages) works good. Besides, the window shutters from my cottages mod may also be stacked and act as sliding doors.

It might be intresting to have a two-node wide sliding door, although that might be a bit complicated, as it'd either have to be a larger than one node nodebox (with resulting problems with the collusion box, thus the door not always blocking when closed) or two doors synced.

Re: Sliding door mod

PostPosted: Sat Sep 20, 2014 04:05
by AutiCoder
Thanks for the reply's , it's indeed kind of like the travelnet sliding doors but bigger
The idea is making the doors , just like a regular glass door that slides for supermarkets ect ...
So what i understand now is that i have to create an instance of a door 'closed' and an on-click event that deletes the door and creates a door next to the position where the door used to be when closed ...
I will mainly use them in pairs , so with a mirrored door .
How do i add mesecons support , so it can be controlled by a player controller ?
It would be awsome having automatic doors ;-)
I build city's most of the time , and such thing would be a great asset i think.