Mods/TurtleMiner/Tutorial

From Minetest Wiki
Jump to navigation Jump to search

TurtleMiner

This is a short tutorial to get you started with TurtleMiner.
Note: there have been a lot of things planned and announced, but only some basics are actually working right now,


Links / Forks


Install

Install Minetest

Minetest 0.4.15 will be released shortly, so for this tutorial, we use the current dev-version.

Download: minetest-0.4.14-8a7dc83 2016-12-05.

Update:
The current version of Minetest is 0.4.16, so we can get the program from the regular download-page.
Unpack that archive into a directory of <our choice (e.g. E:\games), and run minetest,exe in the bin - directory,


Install Mods

Update: you can get the 'original' turtle-mod from https://github.com/BiLachner/TurtleMiner

  • Download the turtle-mod from github: master.zip
    • Unpack that archive into your directory minetest/mods/
    • Rename it to just "turtleminer" (i.e. remove "-master")
  • Download the editor-mod from github: master.zip
    • Unpack that archive into your directory minetest/mods/
    • Rename it to just "editor" (i.e. remove "-master")

Enable Mods

  • Start minetest
Note: in main-menu, tab "Mods": "Turtleminer" is listed as one of the installed mods
  • in tab "Singleplayer": Create a new game (say with mapgen v7, seed 2), or select an existing one
  • press the button "Configure"
  • Scroll down the list of mods,
    • Select "editor", check the "enabled"-checkbox.
    • Select "turtleminer", check the "enabled"-checkbox.
  • Press the Save-button

Get Turtle / creative-mode

  • Select the game you created in the above section
  • Check the checkbox for "creative mode"
  • Press Play-button to start the game
Check your settings:
  • Press F5 to activate debug --> note coordinates of your position
  • Press F5 again to switch off debugging
  • Press F10 to open chat
  • Type "/mods" --> editor and turtleminer should be listed
  • Type "/privs" --> interact, basic_privs, shout, privs
  • Type "/sethome" - note: you don't have the privilege for /sethome and /home
  • Type "/giveme torch" - note: you don't have the privilege to get stuff
  • Type "/time"
  • Type "/help"
  • Type "/help privs"
  • Press ESC to close chat
  • Press I to open inventory
Note your normal inventory at the bottom is empty
Note the creative-inventory filled with stuff at the top
  • Click the "All"-tab
  • Enter "tu" in the search-field, click "?"-button --> all turtles should be listed
  • Get one of the turtles, and the remote1 and put them onto your hotbar
(the 'hotbar' is the top row of your inventory)
(1) If the texture for the remote is missing, get it from an old revison on github
and place that file into the texture-directory of the turtleminer-mod.
Or use any small picture you like (e.g. sword or screwdriver):
From the directory games/minetest_game/mods/default/textures
copy a file (e.g. default_tool_mesesword.png)
to the directory mods/turtleminer/textures
and rename it to turtleminer_remotecontrol.png

Get Turtle / normal mode

  • Select the game you created for working with the turtles
  • Uncheck the checkbox for "creative mode"
  • Press Play-button to start the game
  • Press F10 to open chat
  • Type "/mods" --> editor and turtleminer should be listed
  • Type "/privs" --> interact, basic_privs, shout, privs
  • Type "/giveme torch" - note: you don't have the privilege to get stuff
  • Type "/grantme give"
  • Type "/giveme torch" - now a torch should get added to your inventory
  • Type "/giveme turtleminer:wild" - you should get a turtle in your inventory
  • Type "/giveme turtleminer:remotecontrol"

also:

  • Type "/giveme turtleminer:digging_turtle"
  • Type "/giveme turtleminer:inv_turtle"
  • Type "/giveme turtleminer:wlan_turtle"
  • Type "/giveme turtleminer:tech_turtle"
  • Press ESC to close chat
Note
I recommand the digging_turtle, because it has better visibility

Operation

Handling

  • Select a turtle on your hotbar (use the mousewheel, or keys 1-9)
  • Rightclick on the ground --> turtle is placed on the spot you clicked
  • Enter a name for your turtle (say, "T1")
Note: in creative-mode, after placing, the turtle (as well as any other item)
stays in the inventory, so you have an unlimited supply
  • Do it again: put another turtle on some other spot, give it some other name (e.g. "T2")
  • Point with crosshair at your turtles
Note the text "T1 (owned by singleplayer)"
  • Rightclick one of your turtles
    • without editor-mod --> nothing happens
    • with active editor-mod --> edit-dialog opens
  • Leftclick a turtle --> the turtle is mined / dug.
That is, she is removed from her spot, and put into the inventory.
In creative-mode, the counter on the turtle in the inventory is not increased.

RC

  • Select the remote-control on your hotbar
  • Leftclick on some block of the landscape --> nothing happens, or that block is mined
  • Rightclick on a turtle --> a form appears, with remote-control - buttons.
Hover with the mouse over the buttons to see their functions.
  • Press the buttons to steer the turtle around.
Note: while the remote-control is on screen, the player cannot move
Note: the turtles can fly
Note: when the turtle digs something (say, a tree) that stuff is destroyed
So, mining or harvesting is not possible with the current version
Note: building doesn't work yet
  • press ESC to exit the rc-dialog

Editor

Editor with several programs for Turtleminer
  • Rightclick a turtle
    • without editor-mod --> nothing happens
    • with active editor-mod --> the editor-dialog opens

The editor has tabs for several files, and buttons "New", "Save", "Close", "Run", "Stop"

A small demo-program is already provided:

forward
forward
left
forward
forward

Press the "Run"-button to execute that program.

After the program has started, you can press ESC to exit the editor,
and watch the turtle.

The programs are saved to a file like "singleplayer.lua" in the directory turtlebot in the worlds-directory of your game.

Caution: this file with all the programs inside is only written when the player leaves the game !

That means, when minetest crashes, all changes are lost !

Commands

  • f or forward
  • b or backward
  • u or up
  • d or down
  • right or "turn right"
  • left or "turn left"
  • dig or "dig front"
  • "dig below"
  • build or "place front" (not working yet)
  • "place below"

Todo/Suggestions

? dig up / above
Only needs some simple patches in api.lua and scriptvm.lua,
just look for "below", and add similar lines with "above".
See my fork.
? build/place doesn't work
? build behind - for "painting" with the turtle
? select block to use for build/place
? comments
? print() / say()
? command-separator - for multiple commands per line
? call / include - code from other file
? different sounds for move/turn/dig/place

...

Example-programs

With the current state of the project, it can be argued if these can be really called 'programs',
rather than 'macros'.

Because there is no input/output, no variables, no arithmetic,
no conditions to query or check, no controlstructures, etc.

Nevertheless, the turtles can be useful as-is, see Digger.

Simple

Simple commands to 'replace' the remote-control with the code-editor:
just select the program for the function you want, and press the Run-button.

1Fwd
forward
1Turn
left
1Up
up
1Down
down
1digF
dig front
1digD
dig below

Digger

A collection of programs that help with mining.

The turtles have no inventory yet, and blocks mined by them are destroyed.
So the player needs to look out for ore-blocks that get exposed, and dig them himself.
Tunnel1Fwd

Dig a straight tunnel of height 2 forward, one step per run.

The player has a height of 2 blocks, so a passable tunnel must be 2 blocks high.
dig front
up
dig front
down
forward
Tunnel2x2

In a wider tunnel it is easier to see when blocks with ore get exposed.

dig front
up
dig front

left
dig front
down
dig front

right
forward
Tunnel3x3

Clear the 3x3 blocks on the wall in front of the turtle.

This version exploits that turtles can 'fly', to workaround 'cannot dig up'.
dig front
up
up
dig front
forward

left
dig front
left
left
dig front

dig below
down

dig front
left
left
dig front

down
dig front
left
left
dig front

left

Caution: opening walls into caves filled with water or lava can be dangerous !

Tunnel3x3a

Clear the 3x3 blocks on the wall in front of the turtle.

This version uses the 'dig above'-command, and doesn't need to fly.
dig above
up
dig front
forward
 
dig above
left
dig front
forward

dig above
left
left
dig below
forward

dig front
dig below
forward

dig above
left
left
dig below
down
 
forward
right
Dig3x3below

Clear the 3x3 blocks on the ground below the turtle.

dig below
down

dig front
forward
left

dig front
forward
left

dig front
forward

dig front
forward
left

dig front
forward

dig front
forward
left

dig front
forward
dig front

left
forward

Digs and move down, then runs/digs in a circle around that center position.

Dig1Downstairs

Dig ahead downstairs, one step per run.

up
dig front
down 
dig front

forward
dig below
down

The player has a height of 2 blocks, and above that needs a 3rd block of free space so he can jump up, e.g. to climb upstairs.

Dig1Upstairs

This program doesn't work with the current version of TurtleMiner, as there is no command for "dig above" yet.

(Just needs some simple patches in api.lua and scriptvm.lua)
dig above
up
dig above
dig front
forward