[Mod] Tunnelmaker [tunnelmaker]

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

[Mod] Tunnelmaker [tunnelmaker]

by kestral » Mon May 21, 2018 18:08

Easily create arbitrarily curved tunnels for the Advanced Trains mod.

  • This is a new release that adds digging up and down, to more easily support advtrains slope track.
  • Note that support for tunneling through water was dropped.

For using to place advtrains track, this mod assumes familiarity with how that track gets placed. This mod can just as easily create tunnels that are not supported by advtrains. For more information, see the documentation on the advtrains website, or on my github site listed below.

Features
  • Digs "arched" tunnels (5 nodes wide and 5 nodes tall) in all sixteen possible advtrains track directions with one click.
  • New: Also digs up or down in the eight possible advtrains slope track directions.
  • Fills in tunnel floor (central 3 nodes wide) with stone. Outside of tunnels this can be used to clear ground, provide cuts and fills, and …
  • Not new, but now much easier to do: Build simple stone bridges. However, bridge support columns will need to be added manually.
  • Requires "tunneling" privilege, checks protections, and only works in creative mode.

Screenshots:
Image

Image


Instructions:
  • Unzip tunnelmaker-master.zip to .minetest/mods directory.
  • Rename tunnelmaker-master to tunnelmaker
  • Enable tunnelmaker mod in configure.
  • Run minetest with creative mode enabled.
  • Give player tunneling privileges, i.e. (/grant <player> tunneling).
  • To acquire, use (/give <player> tunnelmaker:1). There's also a crafting recipe in documentation.
  • Point to floor, point character in direction want to dig, and right-click to tunnel.
  • Be careful, it digs away a lot of blocks, and there's no undo.
  • New:
    • To dig up or down hold sneak key (shift) while right-clicking. This will cycle through dig modes: 'U' for up, 'D' for down, and blank for default horizontal.
    • Then release sneak key and right-click to dig tunnel. (Mode will reset after each dig, or if player turns or moves.)
  • Left-click acts like a wooden pickaxe, for making minor adjustments.

All possible inventory icons:
Image

License: CC0
Dependencies: default
Code and documentation: https://github.com/kestral246/tunnelmaker
Download: https://github.com/kestral246/tunnelmaker/archive/master.zip
Last edited by kestral on Fri Jul 20, 2018 18:28, edited 1 time in total.
 

User avatar
orwell
Member
 
Posts: 719
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: Tunnelmaker

by orwell » Mon May 21, 2018 20:33

Hey, that looks cool!
May I link this in my mod's topic?
I haven't tried it yet, but looking at the screenshot, I see a problem. You just dig away nodes, but do not stabilize the tunnel walls and ceiling, so gravel might fall down on the tracks.
However, this definitely has potential!
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Tue May 22, 2018 21:25

Yes, please link in your mod topic. Thanks.

I also thought about the problem you brought up, which gave me some ideas to improve my code. Now I check the ceiling for blocks that can fall, before I dig, and convert them to cobblestone. Also while debugging this, it pointed out another issue I had with tunneling through blocks that can fall, which I also fixed.

Thanks for the comments. I've had a lot of fun with the advtrains mod.
 

Cage
Member
 
Posts: 59
Joined: Mon Oct 24, 2016 21:07

Re: Tunnelmaker

by Cage » Wed May 23, 2018 04:38

I really like this mod. Been wanting a mod that would do this although I was using DigAll to do the same thing. Now with this mod it makes it easy to dig tunnels. Only problem I found is that it doesn't play nice with DigAll. Seems to be a conflict between the two. So I just disable one or the other depending on my needs.
 

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Thu May 24, 2018 18:01

Glad you liked it. I updated the mod so it now works with digall. I changed the digging function from dig_node to node_dig, based on checking which function matyilona200 used for the tunneltest mod. Thanks matyilona200! However, make sure that digall is disactivated before tunneling, or you'll create quite a mess.

Besides working with digall, this change also means that when tunneling, this mod will now pull in one copy of each type of block dug into the inventory, but only if it's not already there. It still digs if the inventory is full, but no blocks are collected. It also works the same for 0.4.16 and 0.5.0-dev—no more raining blocks in 0.5.0-dev.
 

User avatar
orwell
Member
 
Posts: 719
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: Tunnelmaker

by orwell » Fri May 25, 2018 20:27

How does it behave with protection?
minetest.is_protected()
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Sat May 26, 2018 02:05

Yes, I test for minetest.is_protected before executing node_dig and set_node functions, but to be honest, I haven't tested these protection features for a while.
 

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Mon Jun 18, 2018 03:19

I've added a new feature to tunnelmaker. I started updating the code to deal with the possibility of accidentally tunneling into water. Some of the digging patterns ended up being different, but when there is no water, the tunnel will end up almost exactly the same as before. (There are a couple of one-block fixes for slight imperfections in my older design.)

When there is water near the tunnel, I put a glass wall around the tunnel anywhere it's boundary is touching the water. I also replace any water within the tunnel with air, and put a temporary glass endcap at the end of the tunnel to keep water out during the tunneling process.

What this means is that it is now possible to effectively dig tunnels through water. Now you can easily run trains to your underwater sea bases.

Image
 

Cage
Member
 
Posts: 59
Joined: Mon Oct 24, 2016 21:07

Re: Tunnelmaker

by Cage » Mon Jun 18, 2018 06:19

kestral I am really liking this mod. By the way I found that is plays nice with DigAll and haven't had to disable DigAll. Just have to be careful not to use the sneak key when using Tunnelmaker. I have found many uses for this mod other then just digging tunnels. Thank you for all your hard work on this mod.
 

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Thu Jun 21, 2018 21:13

I've added a couple of new features to tunnelmaker. Since the original purpose of this mod was to make it easier to lay advtrains track, I thought that it would be good if it played more nicely with already placed advtrains track.

  • It will no longer dig dtrack nodes. (Previously all dtrack nodes within the digging window were removed.)
  • If a dtrack node is selected, a y-offset of -1 is applied before calling the dig function. This will keep the digging at ground level. (Previously it would dig 1 node above the ground, and place fill around the track.)

This should hopefully make it more useful for laying advtrains track, but shouldn't have any impact on non-train related usages.
 

User avatar
orwell
Member
 
Posts: 719
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: Tunnelmaker

by orwell » Mon Jun 25, 2018 09:14

You should probably check for the group 'advtrains_track' instead of hardcoding nodes
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Wed Jun 27, 2018 03:56

I updated the code to test for: 'minetest.registered_nodes[name].groups.advtrains_track == 1'.

While testing I discovered one exception: one can't use tunnelmaker directly on ATC track. That particular track overrides tunnelmaker's right click. It's still recognized as advtrains_track though, so it won't be deleted when tunnelmaker digs over it.
 

hajo
Member
 
Posts: 596
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: Tunnelmaker

by hajo » Wed Jun 27, 2018 07:13

kestral wrote:new feature .. tunneling into water.

Does that feature handle other liquids too, such as lava and acid ?
 

User avatar
orwell
Member
 
Posts: 719
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: Tunnelmaker

by orwell » Wed Jun 27, 2018 08:19

kestral wrote:I updated the code to test for: 'minetest.registered_nodes[name].groups.advtrains_track == 1'.

While testing I discovered one exception: one can't use tunnelmaker directly on ATC track. That particular track overrides tunnelmaker's right click. It's still recognized as advtrains_track though, so it won't be deleted when tunnelmaker digs over it.

Try holding the Sneak key while clicking, it should work then
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Fri Jul 20, 2018 18:47

I updated first post to reflect the capabilities of the latest version of Tunnelmaker.
  • Added ability to dig up and dig down to support advtrains slope tracks.
  • Removed ability to dig tunnels through water.
This also makes it much easier to build simple stone bridges with the default fill feature. Before to make a bridge go down, one had to fly below the bridge to place an appropriate reference node. Now one just has to use the sneak key while right-clicking to set the digging mode to Down.

For these changes, I had to learn about using global variables in mods, and detecting keyboard input.

Hopefully my use of the sneak key won't interfere with too many other uses. Right now what I see is:
  • Can't set digging mode while flying — I don't see this as a problem.
  • Overrides digall use of sneak key when digging tunnels — This is probably for the better.
  • Can't use sneak key to override advanced trains ATC track's use of sneak key — It should be very rare to want to dig tunnel on one of these tracks.
 

kestral
Member
 
Posts: 32
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Thu Oct 18, 2018 21:28

I would like to thank Richard Jeffries for his video review of tunnelmaker. It's located at: https://www.youtube.com/watch?v=txE-WszHPaU.

I've watched several other of his minetest videos and they're very good. I've got many more on my list of ones I want to watch. Check them out.

As to tunnelmaker, I've added a few configuration variables to allow the user to enable or disable various features. Some of these might be useful for people who use tunnelmaker without advtrains. Using the default values shouldn't give any significant changes from before.

The biggest option is that tunneling through water can now be enabled again. I added back and improved the code to put in the glass enclosure around the tunnel.

The others give the ability to disable the placement of the cobblestone reference nodes; disable placing torches, or adjust their spacing; and enable the ability to dig up or down continuously without having the mode reset each time.

These configuration variables can be changed by editing tunnelmaker's init.lua, near the top of the file.
 

Mikola
Member
 
Posts: 11
Joined: Fri Nov 24, 2017 18:01
GitHub: Mikola314
In-game: mikola

Re: [Mod] Tunnelmaker [tunnelmaker]

by Mikola » Sat Dec 15, 2018 15:04

Hello.
Do you plan in the near future to make changes in fashion?
Do you have a desire to consider Pull Requests if it appears?
 


Return to Mod Releases



Who is online

Users browsing this forum: FaceDeer, Google [Bot], TenPlus1 and 8 guests