Simple doors mod

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

Simple doors mod

by randomproof » Fri Dec 16, 2011 18:59

This is a proof of concept doors mod.

March 2012 (Updated for new code changes)
Jan 2012 (Updated for new code changes)


License: Public Domain

Gitorious Link:
https://gitorious.org/randomproofs-minetest-mods/doors/trees/master

Adds two new nodes, "door_wood" and "doorhandle_wood". You make a door by adding regular door pieces and adding the handle node at the edge of the door. Make sure the handle node is only touching one regular door node horizontally or it will not be able to find the right pivot point. Also, make sure there are empty nodes where the door will move to or it will not move. To open or close punch the handle with your hand. Minimum door width is 2 and no maximum. There can be a short lag between when the door moves and the updated nodes are sent to the client. Door should open away from you.

How to make door pieces:
Image

How to make doorhandle pieces:
Image

Here is a door:
Image

Opened inward:
Image

View of opened door from inside:
Image

Closed door from inside:
Image

Door opened outward
Image
Last edited by randomproof on Mon Mar 19, 2012 23:10, edited 1 time in total.
 

MarkTraceur
Member
 
Posts: 103
Joined: Sat Dec 03, 2011 05:41

by MarkTraceur » Fri Dec 16, 2011 19:22

Awesome! It's still a little buggy (a 2x3 door for me doesn't move the block above the handle), but very good. Do you think you can make it look slimmer with the signlike drawtype?
Mods: https://gitorious.org/marktraceur-minetest-mods
IRC: marktraceur on freenode
 

MarkTraceur
Member
 
Posts: 103
Joined: Sat Dec 03, 2011 05:41

by MarkTraceur » Fri Dec 16, 2011 19:25

Also, your crafting recipe shouldn't use steel_ingot as a node, it's a craft item :)
Mods: https://gitorious.org/marktraceur-minetest-mods
IRC: marktraceur on freenode
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Dec 16, 2011 20:04

MarkTraceur wrote:Also, your crafting recipe shouldn't use steel_ingot as a node, it's a craft item :)

Yea, I saw that and fixed it.

MarkTraceur wrote:Awesome! It's still a little buggy (a 2x3 door for me doesn't move the block above the handle), but very good. Do you think you can make it look slimmer with the signlike drawtype?

I did this kinda quick and it is not the best it could be. I was thinking of using a different drawtype but I just wanted to get it working before I started worrying about how it looks. I'll need to see a picture of the door that isn't working, because I've tried different sizes and shapes (they need not be rectangular, but handle must be at farthest point from pivot point and placed last).
Last edited by randomproof on Fri Dec 16, 2011 20:05, edited 1 time in total.
 

MarkTraceur
Member
 
Posts: 103
Joined: Sat Dec 03, 2011 05:41

by MarkTraceur » Fri Dec 16, 2011 22:00

randomproof wrote:placed last


That's my problem. Thanks.
Mods: https://gitorious.org/marktraceur-minetest-mods
IRC: marktraceur on freenode
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Dec 16, 2011 22:57

MarkTraceur wrote:
randomproof wrote:placed last


That's my problem. Thanks.


When you place the door handle it finds all the regular door pieces and calculates the 2 possible open positions. That is why it must be placed last. It may be possible to calculate the open position dynamically. I did it the way I did so as t save the beginning position, without that it could go all the way around. Now that I think about it, I need to add a check to make sure the moving door doesn't clobber pre-existing blocks.
Last edited by randomproof on Sat Dec 17, 2011 01:32, edited 1 time in total.
 

User avatar
darket
Member
 
Posts: 34
Joined: Sun Nov 27, 2011 10:35

by darket » Sat Dec 17, 2011 02:58

actually how to remove them ??????
 

MasterZEN91
New member
 
Posts: 5
Joined: Sat Dec 17, 2011 06:12

by MasterZEN91 » Sat Dec 17, 2011 06:18

My homie has you mod on his server, very nice i might add, but the texture is so i uno, not right. Not to be a arse but can we use a texture i made till we get yours?

links are:
Knob:http://tinypic.com/view.php?pic=ic8cqh&s=5
No knob:http://tinypic.com/view.php?pic=2igj1w3&s=5
There small and just under where it says TAGS: click to add tags

Zen
Last edited by MasterZEN91 on Sat Dec 17, 2011 06:32, edited 1 time in total.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Sat Dec 17, 2011 16:30

MasterZEN91 wrote:My homie has you mod on his server, very nice i might add, but the texture is so i uno, not right. Not to be a arse but can we use a texture i made till we get yours?

links are:
Knob:http://tinypic.com/view.php?pic=ic8cqh&s=5
No knob:http://tinypic.com/view.php?pic=2igj1w3&s=5
There small and just under where it says TAGS: click to add tags

Zen


Feel free to do whatever you want with this code. I made the textures really quick so as to be very obvious.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Sat Dec 17, 2011 16:32

darket wrote:actually how to remove them ??????

You can remove with a tool, like an axe. I tried to make the handle only respond to being hit with an empty hand.
 

lordawe
Member
 
Posts: 34
Joined: Sat Nov 12, 2011 11:13

by lordawe » Sat Dec 17, 2011 22:49

This is COOL mod. I've already implemeted it. But it destroys blocks nearby as you mention it and also, if i destroy door blocks and touch the knob with anything but axe - voila! - door opens with full blocks so I can "clone" door blocks without the knob easily... this should be fixed.

I would destroy the door in reverse order. To remove it you should destroy the knob first, otherwise the door would be unbreakable...

Is it possible to make signs open with door when placed? it would be even cooler!
Thank you for this mod!
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Sun Dec 18, 2011 18:42

lordawe wrote:... But it destroys blocks nearby as you mention it and also, if i destroy door blocks and touch the knob with anything but axe - voila! - door opens with full blocks so I can "clone" door blocks without the knob easily... this should be fixed.

I would destroy the door in reverse order. To remove it you should destroy the knob first, otherwise the door would be unbreakable...

Is it possible to make signs open with door when placed? it would be even cooler!
Thank you for this mod!

Good ideas. I've been thinking of having it work a little differently so I will look into these issues in the next few days.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Tue Dec 20, 2011 20:24

Version 2 is up on Gitorious. It is almost a complete rewrite. Eveerything is calculated when the handle is hit, so the handle doesn't have to be placed last and you can change the shape of the door without causing problems. The next update will include more door types.

NOTE: If you used the old version you will have to reset all the old doors. If they are in the closed position already you just need to remove and replace the handle pieces.
Last edited by randomproof on Tue Dec 20, 2011 20:30, edited 1 time in total.
 

User avatar
RAPHAEL
Member
 
Posts: 627
Joined: Tue Nov 01, 2011 09:09

by RAPHAEL » Wed Dec 21, 2011 00:02

randomproof wrote:Version 2 is up on Gitorious. It is almost a complete rewrite. Eveerything is calculated when the handle is hit, so the handle doesn't have to be placed last and you can change the shape of the door without causing problems. The next update will include more door types.

NOTE: If you used the old version you will have to reset all the old doors. If they are in the closed position already you just need to remove and replace the handle pieces.

Doesn't seem to load.

This is what the debug says with doors mod in the mods folder. With it outside Minetest loads:
18:27:32: ERROR[main]: Some exception, what()="LuaError: Stack is over 30 (reality check)
18:27:32: ERROR[main]: stack traceback:"
18:27:32: ERROR[main]: error_message = Some exception, what()="LuaError: Stack is over 30 (reality check)


minetest-0.4.dev-20111209-1-win32
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Wed Dec 21, 2011 01:34

RAPHAEL wrote:
randomproof wrote:Version 2 is up on Gitorious. It is almost a complete rewrite. Eveerything is calculated when the handle is hit, so the handle doesn't have to be placed last and you can change the shape of the door without causing problems. The next update will include more door types.

NOTE: If you used the old version you will have to reset all the old doors. If they are in the closed position already you just need to remove and replace the handle pieces.

Doesn't seem to load.

This is what the debug says with doors mod in the mods folder. With it outside Minetest loads:
18:27:32: ERROR[main]: Some exception, what()="LuaError: Stack is over 30 (reality check)
18:27:32: ERROR[main]: stack traceback:"
18:27:32: ERROR[main]: error_message = Some exception, what()="LuaError: Stack is over 30 (reality check)


minetest-0.4.dev-20111209-1-win32


I wonder if you could put the whole debug.txt from when you try to load it. I can't think of were this error is coming from unless it is because you have a lot of mods running at once.
Last edited by randomproof on Wed Dec 21, 2011 01:38, edited 1 time in total.
 

User avatar
RAPHAEL
Member
 
Posts: 627
Joined: Tue Nov 01, 2011 09:09

by RAPHAEL » Wed Dec 21, 2011 15:46

randomproof wrote:I wonder if you could put the whole debug.txt from when you try to load it. I can't think of were this error is coming from unless it is because you have a lot of mods running at once.

http://minetest.weareonesoul.com/debug.txt
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
 

mcburgerbob
Member
 
Posts: 141
Joined: Wed Dec 14, 2011 19:50

by mcburgerbob » Wed Dec 21, 2011 18:07

cool mod! Minetest really needs doors.
MY CAKE!
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Wed Dec 21, 2011 20:16

RAPHAEL wrote:
randomproof wrote:I wonder if you could put the whole debug.txt from when you try to load it. I can't think of were this error is coming from unless it is because you have a lot of mods running at once.

http://minetest.weareonesoul.com/debug.txt


Looking at were it crashed (scriptapi.cpp line 85 from line 2716) it looks like you may have a lot of mods running and I think that is causing the lua stack to overflow. I'm not sure if you are building from source but try upping the numbers in the realitycheck() function and anywhere you see "assert(lua_checkstack(L, 20));" in the scriptapi.cpp function and see if that fixes the problem.

Funny thing that the code sets the stack size to at least 20 (which is the default in the lua code) but errors where it is over 30.
Last edited by randomproof on Wed Dec 21, 2011 20:18, edited 1 time in total.
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Thu Dec 22, 2011 04:03

Won't load up for me. There is an error with the lua file.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
19:57:51: INFO[main]: Server: Loading mod "randomproofs_minetest_mods_doors"
19:57:51: INFO[main]: Loading and running script from C:\Users\###\Desktop\minetest-0.4.dev-20111209-1-win32\bin\..\data\mods\randomproofs_minetest_mods_doors\init.lua
19:57:51: ERROR[main]: Error loading mod "randomproofs_minetest_mods_doors": LuaError: Name "doors:door_wood" does not follow naming conventions: "modname:" or ":" prefix required)
19:57:51: ERROR[main]: stack traceback:
19:57:51: ERROR[main]:     [C]: in function 'register_node'
19:57:51: ERROR[main]:     ...\data\mods\randomproofs_minetest_mods_doors\init.lua:1: in main chunk
19:57:51: ERROR[main]: Server: Failed to load and run C:\Users\###\Desktop\minetest-0.4.dev-20111209-1-win32\bin\..\data\mods\randomproofs_minetest_mods_doors\init.lua
BanManager: saving to C:\Users\###\Desktop\minetest-0.4.dev-20111209-1-win32\bin\..\world\ipban.txt
AuthManager: saving to C:\Users\###\Desktop\minetest-0.4.dev-20111209-1-win32\bin\..\world\auth.txt
19:57:51: ERROR[main]: ModError: Failed to load and run C:\Users\###\Desktop\minetest-0.4.dev-20111209-1-win32\bin\..\data\mods\randomproofs_minetest_mods_doors\init.lua
19:57:51: ERROR[main]: error_message = ModError: Failed to load and run C:\Users\###\Desktop\minetest-0.4.dev-20111209-1-win32\bin\..\data\mods\randomproofs_minetest_mods_doors\init.lua
19:57:51: ERROR[main]: Check debug.txt for details.
19:57:51: INFO[main]: Created main menu


There is no other additional mods running than what was already in the 0.4dev.
Nor is there any other errors in the debug logfile.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Thu Dec 22, 2011 15:41

Gatharoth wrote:Won't load up for me. There is an error with the lua file.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
19:57:51: ERROR[main]: Error loading mod "randomproofs_minetest_mods_doors": LuaError: Name "doors:door_wood" does not follow naming conventions: "modname:" or ":" prefix required)


There is no other additional mods running than what was already in the 0.4dev.
Nor is there any other errors in the debug logfile.

Your error is because you changed the name of the mod's directory but not the prefix on the nodes. Just replace "doors:" with "randomproofs_minetest_mods_doors:"
Last edited by randomproof on Thu Dec 22, 2011 15:42, edited 1 time in total.
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Thu Dec 22, 2011 16:50

randomproof wrote:
Gatharoth wrote:Won't load up for me. There is an error with the lua file.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
19:57:51: ERROR[main]: Error loading mod "randomproofs_minetest_mods_doors": LuaError: Name "doors:door_wood" does not follow naming conventions: "modname:" or ":" prefix required)


There is no other additional mods running than what was already in the 0.4dev.
Nor is there any other errors in the debug logfile.

Your error is because you changed the name of the mod's directory but not the prefix on the nodes. Just replace "doors:" with "randomproofs_minetest_mods_doors:"


Okay Thanks :D. Anyway, when you download it (not clone it) it gets names "randomproofs_minetest_mods_doors". Just a FYI.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Thu Dec 22, 2011 18:43

Gatharoth wrote:Okay Thanks :D. Anyway, when you download it (not clone it) it gets names "randomproofs_minetest_mods_doors". Just a FYI.

Thanks, good to know.
Last edited by randomproof on Thu Dec 22, 2011 18:43, edited 1 time in total.
 

User avatar
MrThebuilder3
Member
 
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Fri Dec 23, 2011 02:19

how do you use the gates?
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Dec 23, 2011 15:15

MrThebuilder3 wrote:how do you use the gates?

Same as if they were door pieces. I've changed the inventory textures a little to make it easier to tell the gate from the gate handle nodes. I'm not good at textures and fence pieces are wrapped around the shape in a funny way.

Maybe after the holiday I will see if I can put together a video demoing the door pieces.
 

User avatar
MrThebuilder3
Member
 
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Fri Dec 23, 2011 16:20

i ment crafting...
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Fri Dec 23, 2011 17:24

MrThebuilder3 wrote:i ment crafting...


Normal: wood, wood, steel ingot
wood, wood, steel ingot

Handle: steel ignot, wood, steel ingot
wood, wood, wood

Note: this is in order from left to right and top from down in the craft menu.
 

User avatar
MrThebuilder3
Member
 
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Fri Dec 23, 2011 17:27

the gate not the door but nevermind
 

User avatar
dannydark
Member
 
Posts: 428
Joined: Fri Aug 12, 2011 21:28

by dannydark » Fri Dec 23, 2011 18:15

You do know you could have just looked in the lua file?

Gate:
Stick, Stick, Steel Ingot,
Stick, Stick, Steel Ingot

Handle:
Stick, Steel Ingot, Stick,
Stick, Stick, Stick
Last edited by dannydark on Fri Dec 23, 2011 18:15, edited 1 time in total.
 

User avatar
sycam
Member
 
Posts: 24
Joined: Thu Jan 05, 2012 10:57

by sycam » Sat Jan 07, 2012 08:19

can you please send my this mod because i can't get an account my email address is <censored>

(to anyone who has this mod)
sycam industry's yesterdays technology today
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sat Jan 07, 2012 09:20

sycam wrote:can you please send my this mod because i can't get an account my email address is <censored>

(to anyone who has this mod)

You must not create an Gitorious Account, use this Link
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

Next

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 63 guests

cron