Compare commits
5 Commits
42c3b25ec9
...
9c075a305a
Author | SHA1 | Date |
---|---|---|
luk3yx | 9c075a305a | |
luk3yx | 03a1f07713 | |
luk3yx | 57555de697 | |
luk3yx | 597e53d30f | |
luk3yx | 11f5c72f24 |
25
README.md
25
README.md
|
@ -1,43 +1,34 @@
|
|||
# advmarkers (non-CSM)
|
||||
# advmarkers
|
||||
|
||||
A marker/waypoint mod for Minetest.
|
||||
A marker/waypoint mod for Minetest. Requires Minetest 5.0.0+, if you use Minetest 0.4 please try [this older version from June 2020](https://git.minetest.land/luk3yx/advmarkers/commit/25d7079069a53f2cece76ee2050bcdf690b4ea30).
|
||||
|
||||
Unlike the [CSM], this mod is standalone, and conflicts with the marker mod.
|
||||
|
||||
## How to use
|
||||
|
||||
`advmarkers` introduces the following chatcommands:
|
||||
This mod introduces the following chatcommands:
|
||||
|
||||
- `/wp`, `/mrkr`: Opens a formspec allowing you to display or delete waypoints. If you give this command a parameter (`h`/`here`, `t`/`there` or co-ordinates), it will set your HUD position to those co-ordinates.
|
||||
- `/add_wp`, `/add_mrkr`: Adds markers. You can use `.add_mrkr x,y,z Marker name` to add markers. Adding a marker with (exactly) the same name as another will overwrite the original marker.
|
||||
- `/clrwp`, `/clrmrkr`: Hides the currently displayed waypoint.
|
||||
- `/mrkr_export`: Exports your markers to an advmarkers string. Remember to not modify the text before copying it. You can use `/mrkr_export old` if you want an export string compatible with older versions of the advmarkers CSM (it should start with `M` instead of `J`). This old format does **not** work with this mod, so only use it if you know what you are doing!
|
||||
- `/mrkr_import`: Imports your markers from an advmarkers string (`.mrkr_import <advmarkers string>`). Any markers with the same name will not be overwritten, and if they do not have the same co-ordinates, `_` will be appended to the imported one.
|
||||
- `/mrkr_import`: Imports your markers from an advmarkers string (`/mrkr_import <advmarkers string>`). Any markers with the same name will not be overwritten, and if they do not have the same co-ordinates, `_` will be appended to the imported one.
|
||||
- `/mrkrthere`: Alias for `/mrkr there`.
|
||||
|
||||
If you die, a marker is automatically added at your death position, and will
|
||||
If you die, a waypoint is automatically added at your death position, and will
|
||||
update the "there" position.
|
||||
|
||||
### "Here" and "there" positions
|
||||
## "Here" and "there" positions
|
||||
|
||||
Both /wp and /add_wp accept "here"/"h" and "there"/"t" in place of
|
||||
co-ordinates. Using "here" will set the waypoint to your current position, and
|
||||
"there" will set it to the most recent co-ordinates that appear in chat (or
|
||||
your last death position).
|
||||
|
||||
## Chat channels integration
|
||||
|
||||
advmarkers works with the `.coords` command from chat_channels ([GitHub],
|
||||
[GitLab]), even without chat channels installed. When someone does `.coords`,
|
||||
advmarkers temporarily stores this position, and you can set a temporary marker
|
||||
at the `.coords` position with `/mrkrthere`, or add a permanent marker with
|
||||
`/add_mrkr there Marker name`.
|
||||
|
||||
## SSCSM support
|
||||
|
||||
With my [SSCSM] mod installed, advmarkers will register a server-sent CSM to
|
||||
reduce visible lag in the markers GUI.
|
||||
|
||||
[CSM]: https://git.minetest.land/luk3yx/advmarkers-csm
|
||||
[GitHub]: https://github.com/luk3yx/minetest-chat_channels
|
||||
[GitLab]: https://gitlab.com/luk3yx/minetest-chat_channels
|
||||
[SSCSM]: https://git.minetest.land/luk3yx/sscsm
|
||||
[SSCSM]: https://content.minetest.net/packages/luk3yx/sscsm
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
cloaking?
|
9
init.lua
9
init.lua
|
@ -26,12 +26,15 @@ local function pos_to_string(pos)
|
|||
end
|
||||
end
|
||||
|
||||
local function dir_ok(n)
|
||||
return type(n) == 'number' and abs(n) < 31000
|
||||
end
|
||||
local function string_to_pos(pos)
|
||||
if type(pos) == 'string' then
|
||||
pos = minetest.string_to_pos(pos)
|
||||
end
|
||||
if type(pos) == 'table' and abs(pos.x) < 31000 and abs(pos.y) < 31000 and
|
||||
abs(pos.z) < 31000 then
|
||||
if type(pos) == 'table' and dir_ok(pos.x) and dir_ok(pos.y) and
|
||||
dir_ok(pos.z) then
|
||||
return vector.round(pos)
|
||||
end
|
||||
end
|
||||
|
@ -511,7 +514,7 @@ local function get_coords(msg)
|
|||
end
|
||||
|
||||
-- Get global co-ords
|
||||
table.insert(minetest.registered_on_chat_messages, 1, function(_, msg)
|
||||
minetest.register_on_chat_message(function(_, msg)
|
||||
if msg:sub(1, 1) == '/' then return end
|
||||
local pos = get_coords(msg)
|
||||
if pos then
|
||||
|
|
Loading…
Reference in New Issue