Sliding door mod

AutiCoder
New member
 
Posts: 3
Joined: Sat Sep 06, 2014 08:55
In-game: AutiCoder

Sliding door mod

by AutiCoder » Sat Sep 06, 2014 09:36

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
"Think , create , test , fail , and repeat until you succeed "
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Sliding door mod

by kaeza » Sat Sep 06, 2014 10:19

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".
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

Re: Sliding door mod

by Evergreen » Sat Sep 06, 2014 11:35

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)
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: Sliding door mod

by Sokomine » Tue Sep 09, 2014 02:48

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.
A list of my mods can be found here.
 

AutiCoder
New member
 
Posts: 3
Joined: Sat Sep 06, 2014 08:55
In-game: AutiCoder

Re: Sliding door mod

by AutiCoder » Sat Sep 20, 2014 04:05

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.
"Think , create , test , fail , and repeat until you succeed "
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron