Page 1 of 2

[Mod] Tunnel Boring Machine [0.4 beta] [tbm]

PostPosted: Sun Dec 09, 2012 19:07
by aldobr
It's a tunnel boring machine, wich IRL digs tunnels and places concrete slabs to reinforce them.

Operation:

Moves forward, breaking everything in front of it. Drops minerals from the stones that it breaks. Places stone blocks below it to make bridges. Places torches every 8th node to illuminate the tunnel. Places tracks behind automatically. Consumes 1 coal every for every 4 cycles. It refills its cobblestone stack from the cobblestone it breaks, but only if its stack is below 99.

You should put ONLY torches, cobblestone, rail and coal into its inventory.

Do not enable this machine on multiplayer, can be a severe source of grief. Carefull where you dig, the machine won't care about lava.

Version:
0.4 beta

License:
WTFPL

Depends:
default

Download:
http://ompldr.org/vZ25qbA/tbm.zip

Screenshots:

Image

Image

This is my second mod and the first to have much in the way of logic. I learned a lot about lua programming while doing this thing.

PostPosted: Wed Dec 12, 2012 07:33
by Leroy
Which version of minetest does it work with?

PostPosted: Wed Dec 12, 2012 07:53
by cornellius
Can You Make Video To Operate That Thankyou

PostPosted: Wed Dec 12, 2012 08:01
by Leroy
+1 But I dont know how to operate.

PostPosted: Wed Dec 12, 2012 10:16
by aldobr
Craft:

ironingot ironpickaxe ironingot
ironingot furnace ironingot
ironingot ironingot ironingot

how to operate:

Place it over the ground. Click into it as if it was a chest, put torches, cobble, rails and coal inside.

It should start operating immediately.

It will go forward in the direction you were looking at when you placed the machine. FORWARD.

PostPosted: Wed Dec 12, 2012 10:29
by Aqua
Nice!

PostPosted: Wed Dec 12, 2012 11:50
by cornellius
Wow Nice

PostPosted: Wed Dec 12, 2012 13:32
by webdesigner97
Cool!

PostPosted: Wed Dec 12, 2012 13:47
by cHyper
nice mod ...

i use the mod item_drop for automatic collection of the material when u walk over the rails...

my minetest version is 0.4.4 from celeron55...

PostPosted: Thu Dec 13, 2012 11:17
by Aqua
Any way for it to be like 10 times faster?

PostPosted: Thu Dec 13, 2012 11:52
by aldobr
I just need to adjust the interval parameter on the abm, but my computer is not a good reference. If someone else with a modern computer could tweak it until finding a reasonable speed...

When that machine operates my computer goes down to 9fps :P

its an Athlon XP with only 1GB of RAM and it runs a windows XP OS, the video card is a GeForce nForce 430. Very low end for today.

PostPosted: Thu Dec 13, 2012 13:12
by LorenzoVulcan
Not bad,but you need to reduce ABM's interval.

PostPosted: Thu Dec 13, 2012 16:25
by GJH105775
Cool. +1

PostPosted: Fri Dec 14, 2012 19:34
by snakevenom
needs to be in technic

PostPosted: Sun Mar 17, 2013 17:38
by 12Me21
It does not work at all. it just sits there and does nothing.

PostPosted: Sun Mar 17, 2013 20:34
by acridstone
12Me21 wrote:It does not work at all. it just sits there and does nothing.

It is the same here. Needs to be updated and maybe put on git?

PostPosted: Sun Mar 17, 2013 21:38
by Kacey
To cross lava and falls, use gravel. have it put down gravel when it is above air or liquids

PostPosted: Mon Mar 18, 2013 17:15
by Bas080
acridstone wrote:
12Me21 wrote:It does not work at all. it just sits there and does nothing.

It is the same here. Needs to be updated and maybe put on git?


However an annoying issue is when The tunnel is bored between two world on generate blocks. It only removes nodes from bottom block.

Except for that, it almost works like advertised. If you put this on github I can contribute to this project more easily. This mod can be so much more!

Possible features:
* Drill wears-out.
* Mined materials are gathered in "chest like node".
* Nodebox change so it looks more like a tbm.
Edit:
* Sounds
* Drilling animation (so you know if it's working or not
* On and off swith

PostPosted: Sun Mar 24, 2013 21:34
by acridstone
please put on git

PostPosted: Thu Mar 28, 2013 04:04
by aldobr
I dont have git on my computer and i dont know how to use git anyway...

The license is WTFPL, so anyone can do watever it wants to do with the code... ;)

I dont intend to mantain that mod anymore because there are more pressing things now in my real life (i am taking a course in eletromecanic that is pretty hard).

PostPosted: Tue Apr 02, 2013 16:20
by tbillon2003
in principle i like this mod but there are afew things that should be altered, and maybe they will reduce said havoc

in your code you have the tbm drop and item for anything thats not cobble, which means it drops 9 empty items for default:stone which is bad and really shouldnt be done becasue it causes stack overflows in the game.

this part of your code i changed and now it really only drops items that should be dropped >>>

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
 if current.name ~= "default:cobble" and current.name ~= "default:stone" and current.name ~= "default:sand" and current.name ~= "default:gravel" then   
                    local dropped = ItemStack({name=current.name}):get_definition().drop
                    local stack = ItemStack(dropped)
                                        local obj = minetest.env:add_entity(bpos, "__builtin:item")
                                        obj:get_luaentity():set_item(stack:to_string())
                    end
                                --end
                   minetest.env:dig_node(bpos)
           
                    end


the item drop thing really didnt need a function becasue its only called in one place, so putting it in a function isnt really nes. and i changed it to drop the item that it finds in the spot that it was found and thanks to gravity this places it on the ground, which fixed another problem i found with this code in that it would eat up a wall with 4 coal and i would only get one. any how just suggestions i have used this extensively and it went from crashing my server to working pretty well. im not familiar with how to code for this scripting language, give me a few more days and i will ahve found a better way to rule out all default:{terrain type} because really if it doesnt have an object you want in it it should be excluded from dropping anything :) thanks for the code start:)

and i know you said you dont want to maintain the mod but it also has some sort of glitch where every few blocks it leavs and arch see attached image. Image

PostPosted: Tue Apr 02, 2013 16:21
by tbillon2003
building i made with tunnel boring machine :)
Image

PostPosted: Tue Apr 02, 2013 16:31
by Likwid H-Craft
Nice Place should have it as map. umm How do I make it work. nvm found out I am doing wrong I put in, stone.
tbillon2003 wrote:building i made with tunnel boring machine :)
Image

PostPosted: Tue Apr 02, 2013 18:50
by tbillon2003
Nice Place should have it as map. umm How do I make it work. nvm found out I am doing wrong I put in, stone.


have it in a map? whats that mean, ive only been playing this game for a couple days. that is just tha back of my "mine" as it where i have a workshop and all sorts of things. i am working on setting up a server and weeding through all the mods. :)

as for making the tbm work it is persnikity

sometimes you have to set it and break it a couple times.

i have been over the code a few times but like i say ive never heard of lua until now, and its my first xperiance, i may re release this code as a different tbm that ideally has a bore size variable instead of the default 4x3 bore that it does now. but i dont understand how the whole offsets and such work. my tbm code right now is severly scaled back.

Also made sense of the part that the TBM misses, it is where the abm (i get that right?) is too fat way from the user the TBM embeds itself in the wall and then does not break the blocks and the hole at the bottom is where the tbm replaced itself with what eve block was there... is there a way to detect when the abm is too far from the user? this would solve this glitch. tell the TBM to stop before its too far away.


another cool image for you, 9 TBMS 600 units deep>>> L@@K at all that ore :)
Image

better than that would be for the tbm to break bricks before it moves forward. let me look at this, i cant remeber if it does it that way or if it moves forward first.

PostPosted: Tue Apr 02, 2013 22:13
by tbillon2003
Image

working on a real texture for it, this is just the basic i am gonna jump off the web here at the library for the day wanted to post what i got so far. textures for this cube is harder than spriting. JMHO

PostPosted: Tue Apr 02, 2013 22:42
by Likwid H-Craft
tbillon2003 wrote:Image

working on a real texture for it, this is just the basic i am gonna jump off the web here at the library for the day wanted to post what i got so far. textures for this cube is harder than spriting. JMHO


Hmm, Not bad if you get the, node the right size I think it will go.

This may help:
http://forum.minetest.net/viewtopic.php?id=5395

PostPosted: Wed Apr 03, 2013 14:03
by Silencer
12Me21 wrote:It does not work at all. it just sits there and does nothing.

Maybe it's because of your laggy computer or maybe the mod just don't really work well with your minetest

PostPosted: Tue Apr 09, 2013 04:39
by aldobr
and i know you said you dont want to maintain the mod but it also has some sort of glitch where every few blocks it leavs and arch see attached image.


This is because ABMs are disabled when they are far from players. This decreases server load, but generates this kind of artifact.

I never found a work around that, maybe the ABM needs an "Before disable" callback. Something like that can only be implemented in the C++ side of things...

PostPosted: Fri Apr 12, 2013 13:41
by Bas080
aldobr wrote:I never found a work around that, maybe the ABM needs an "Before disable" callback. Something like that can only be implemented in the C++ side of things...


minetest.after(time, func, ...) in lua doc will explain that it can be done without an abm.

PostPosted: Sat Apr 13, 2013 01:57
by aldobr
you cannot replace an ABM with a timer simple because an ABM has the position information, while the timer dont.