[Mod] Tunnelmaker [tunnelmaker]

kestral
Member
 
Posts: 38
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.

  • New Support for tunneling through water is back and enabled by default.
    New Multiple config options are now available at the beginning of the code, including height of tunnel and whether to include "arches".

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 Sun Dec 16, 2018 23:31, edited 2 times in total.
 

User avatar
orwell
Member
 
Posts: 755
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96
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: 38
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: 61
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: 38
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: 755
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96
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: 38
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: 38
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: 61
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: 38
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: 755
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96
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: 38
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: 755
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96
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: 38
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: 38
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: 15
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?
 

User avatar
Theone10
New member
 
Posts: 7
Joined: Mon Nov 12, 2018 18:02
GitHub: Theone10
IRC: Theone10
In-game: Theone10
 

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

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Sun Dec 16, 2018 23:45

Mikola, I'm not sure what you mean by changes in fashion.

I cannot change the width of the tunnels without starting the code over again, but I realized that I could change the height, and make the "arches" optional. The code now has new config variables to set both of these, which I have checked in.

I will consider other changes, but my first priority is to support laying advtrains track, while keeping the operation of this mod as simple as possible. There are plenty of other tunneling mods that have more features, but are much more complex to use.
 

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

Re: [Mod] Tunnelmaker [tunnelmaker]

by Mikola » Sat Dec 29, 2018 19:04

kestral, I redid this mod for myself and added some useful features.
https://github.com/Mikola314/tunnelmaker/tree/master-1.X.X
You can read and express your opinion: whether you want to deal with it or not.

At the moment, the README.md and LICENSE.txt has not been corrected.
There is a problem with licenses.
I used part of the code from the mod Xray https://forum.minetest.net/viewtopic.php?id=3191. This mod uses a GPLv3 license and when using this mod, the final project must also use a GPLv3 license.
Last edited by Mikola on Thu Feb 07, 2019 12:04, edited 1 time in total.
 

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

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Sun Dec 30, 2018 00:14

Mikola, I've downloaded your version and have started to look at it, but wow, you've really done a lot.

I'm definitely going to take a close look at all your changes, but it's going to take some time.
 

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

Re: [Mod] Tunnelmaker [tunnelmaker]

by Mikola » Sun Dec 30, 2018 09:41

I believe that the next step is to learn how to store the values of variables individually for each user in players.sqlite. This will allow you to quickly change the modes of operation of the mod and will remove the need to restart the server when changing the values of variables. Perhaps this should be done after the release minetest 5.0.

I hope that in the future it will be possible to make game trains from this mod, capable of creating embankments and bridges, creating tunnels and laying the railway.
 

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

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Thu Jan 03, 2019 20:35

Mikola, I've incorporated your version with changes in the experimental branch of my github repo. Take a look and see what you think, but note that it's still a work in progress.

For others, know that tunnelmaker 2.0 is in the works, with many new features on the way. Stay tuned for more news.
 

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

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Tue Jan 29, 2019 03:08

Tunnelmaker 2.0 Beta, now with support for making bike paths along with other new and exciting features, is now available for those who would like to try it.

I would like to thank Mikola, who contributed many of the new features listed below. Code is feature complete and seems pretty stable. Only planned work remaining is to better define configuration options. Looking for user feedback on which configuration options are most requested.

Browse beta code and documentation:
https://github.com/kestral246/tunnelmaker/tree/beta
Or if you have git repository use: git checkout beta

Download beta:
https://github.com/kestral246/tunnelmaker/archive/beta.zip

Changes from version 1.0
  • Advanced train mode updated with gravel embankments.
  • New bike path mode with cobblestone paths and slab slopes. Optionally supports angledstairs for improved diagonal slopes.
  • User Options menu to change options on the fly.
  • Choice of two path/bridge widths, along with lined tunnels.
  • Option to easily remove reference marks by just walking over them.
  • Option to remove tree cover while cutting paths through forests and jungles.
  • Now works both in creative and survival modes, but no longer returns any material to inventory while tunneling.
  • No longer has crafting recipe, use creative inventory or /give <player> tunnelmaker:tool1.

Controls
  • left-click: Dig node with one click.
  • shift-left-click: Bring up User Options menu.
  • right-click: Dig tunnel in direction player pointed.
  • shift-right-click: Cycle through vertical digging modes.

Dependencies
  • required: default, stairs
  • recommended: angledstairs

Examples
Lined tunnels, gravel embankment, and wide bridges (Switching to desert materials needs MT5.0):
Image

Bike path up the mountain (diagonal slope using optional angledstairs mod):
Image
 

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

Re: [Mod] Tunnelmaker [tunnelmaker]

by Mikola » Wed Jan 30, 2019 18:24

kestral, I am glad that my work and ideas were useful to you.
I am also glad that you managed to realize saving the tunnelmaker settings separately for each player using the invocation of the settings menu. This will greatly facilitate teamwork.

Are you planning major changes in the branch "beta" in the near future?

Is planned to be used Version 2.0 only with minetest 5.0 and higher?
What do you think about adding localization for players from different countries? I added the ability to translate and translate into Russian for Version 2.0-beta-7 - 2019-01-26 with the new function minetest.get_translator(), but it will only work with minetest 5.0 and higher.
If you are interested in it, I will add a Pull request.
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: Google [Bot] and 15 guests