Go to file
Zughy 7a32634ddc Callbacks implemented 2020-07-27 16:25:11 +02:00
locale Callbacks implemented 2020-07-27 16:25:11 +02:00
locations More areas can now be hidden separately, with a more responsive formspec 2020-07-23 15:28:38 +02:00
sounds Added sounds when teleporting (both for when is allowed and for when is not) 2020-07-20 21:07:23 +02:00
textures Graphic rework 2020-07-23 17:33:58 +02:00
LICENSE Add LICENSE 2020-06-16 23:01:43 +00:00
README.md Callbacks implemented 2020-07-27 16:25:11 +02:00
callbacks.lua Callbacks implemented 2020-07-27 16:25:11 +02:00
config.txt More areas can now be hidden separately, with a more responsive formspec 2020-07-23 15:28:38 +02:00
deserializer.lua Callbacks implemented 2020-07-27 16:25:11 +02:00
formspec.lua Bugfix: opaque overlay was shown onto empty buttons 2020-07-23 17:13:54 +02:00
init.lua Callbacks implemented 2020-07-27 16:25:11 +02:00
items.lua Check for privileges + option to not displaying an icon when the privileges condition is not satisfied 2020-06-21 17:13:28 +02:00
load_config.lua Custom buttons background 2020-07-23 16:20:28 +02:00
mod.conf Primo commit 2020-06-17 01:02:13 +02:00
player_manager.lua Callbacks implemented 2020-07-27 16:25:11 +02:00
privs.lua if a row only contains hidden items, it's not shown to the player | background customisation according to the rows 2020-07-23 02:19:26 +02:00

README.md

Magic Compass

Teleport system for Minetest (yes, GUI aspect will be improved)

Support my work

How to use it

Look for the "Magic Compass" item in your creative inventory, put it in your hand and left click it to open the locations menu

Customisation

Create new locations

Every icon in the menu is a location. Locations must be declared in a .txt document inside the locations folder like so:

Red Forest                  -- the name you want to show in the menu when hovering the icon
magiccompass_redforest.png  -- the associated texture
-3.5, 5.0, -20.5            -- where the player will be teleported
5			    -- (optional) cooldown before being able to use it again. Leave empty or put -1 for none
interact, myrpg_lv10        -- (optional) privileges required in order to use it. Use ", " to separate them or it won't work
HIDE			    -- (optional) whether to hide the icon to players who don't have the required privileges

The file name is important too, as it must start with a number followed by an underscore like 5_whatever name.txt.
The number indicates the position of the associated item in the grid (which scales according to the highest number declared), and empty spaces are generated automatically if the numbers of the items don't represent a full sequence.

Callbacks
  • magic_compass.register_on_use(function(player, ID, item_name, pos)): use it to run more checks BEFORE using the item. If it returns nil or false, the action is cancelled. If true, it keeps going
  • magic_compass.register_on_after_use(function(player, ID, item_name, pos)): use it to run additional code AFTER having been teleported
Graphic aspect

Edit config.txt to suit your needs!

Want to help?

Feel free to:

  • open an issue
  • submit a merge request. In this case, PLEASE, do follow milestones and my coding guidelines. I won't merge features for milestones that are different from the upcoming one (if it's declared), nor messy code
  • contact me on the Minetest Forum