[CSM] Distancer

Post Reply
User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

[CSM] Distancer

by Clyde » Post

Simple, short, Distancer.

Distancer is a Client-Side Mod, which should help you to build in Minetest.
This Mod measures distances or show's you the current Mapblock of your Position.

Complete reworked and a new command now available.
Added a dynamic Helpsystem.

General Commands:
  • .dis show_mapblock | Shows you the Mapblocknumber of your current Position.
  • .dis who | Lists the Names of the (online) Player.
  • .dis change_safe_dead | Turns the safe_dead on or off or show's the status of safe_dead.
Marker Commands:
  • .dis mark | Shows you the current stored Marker.
  • .dis mark -s | Set's the Marker to your current Position.
  • .dis mark -m | Shows you the Distance between your current Position and the (valid) Marker.
  • .dis mark -p | Shows you a vector of the Distance between your current Position and the (valid) Marker.
  • .dis mark -w X,Y,Z | Writes a manual given Position to the Marker. Example: .dis mark -w 50,-10,100 - Set's the Marker to the Position 50,-10,100.
HUD Commands:
  • .dis hud on|off | Turns all HUD's of Distancer on or off.
  • .dis hud_mapblock on|off | Turns the HUD for the current Mapblock on or off.
  • .dis hud_measure on|off | Turns the HUD to measure distances on or off.
  • .dis hud_waypoint on|off | Turns the HUD for the Waypoint on or off.
  • .dis hud_waypoint -c <color> | Changes the Color of the Waypoint to <color> (like green) or shows the available colors.
  • .dis hud_set | Shows you the current Position of the HUD.
  • .dis hud_set -r | Resets the Position of the HUD to default.
  • .dis hud_set -w .x,.y | Set's the Position of the HUD to the given Values. A Value of 0 left the Position unchanged.
  • .dis hud_speed | Shows you the current Refreshspeed of the HUD in Seconds.
  • .dis hud_speed Number | Changes the Refreshspeed of the HUD in Seconds. 0 turns the HUD off.
Source:
https://github.com/acmgit/distancer

Download:
Release for 5.x.x:
https://github.com/acmgit/distancer/archive/3.1.zip

Depends:
nothing

License:
GPL 3.0

How to install:
Move the folder to your clientmods directory of your minetest-folder.
Then activate the mod in your mods.conf.
Important: Not the mod.conf inside of the mod!!
Image

Additional Commands:

for Modwriter
With the Version 2.7 or higher, the Distancer has a API for other mods.

Var:
  • dst.ver | Version Number of the loaded Distancer.
  • dst.rev | Revision Number of the loaded Distancer.
  • dst.name | Name of the Mod.
API:
  • dst.send_pos(name, position) | name = playername, position = string like "0,0,0". Set's the Marker to the Position "x,y,z".
Older version:
Will not developed again anymore by the Author:

Download:
Release for >= 0.4.15:
https://github.com/acmgit/distancer/archive/1.0.zip

Have Fun with it.
Greetings, Clyde.
Last edited by Clyde on Sun Mar 22, 2020 21:37, edited 18 times in total.

nrz
Developer
Posts: 131
Joined: Sat Feb 07, 2015 17:16
GitHub: nerzhul
IRC: nrzkt
In-game: nrz
Location: France
Contact:

Re: [CSM] Distancer

by nrz » Post

Nice job,
Can you try to implement this using a CSM HUD ? It can be nice to au refresh data on screen using that

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Update: Command .waypoint renamed to .marker
nrz wrote:Nice job,
Thanks a lot.
nrz wrote: Can you try to implement this using a CSM HUD ? It can be nice to au refresh data on screen using that
Good idea, but ....
Does support the 0.4.x Clients of MT the CSM HUD?

If yes, then i do something wrong and get an Error, that i attempt to index a field, what is an nil-value ..
I tried it with:

Code: Select all

minetest.localplayer:hud_add(def)
and

Code: Select all

minetest.localplayer.hud_add(def)
Greetings, Clyde.

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Update:
New Release but only for MT 5.x.x.
Now the Distancer has a HUD, which can be turned on or off.

The new Commands for this Release are:

.distancer_hud_mapblock on|off
.distancer_hud_measure on|off

Greetings, Clyde.

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Update:
Version 2.2

Command to changes the Position of the HUD added.
.distancer_hud_change | Shows you the current Position of the HUD in Chat.
.distancer_hud_change -r | Reset's the Position of the HUD to default.
.distancer_hud_change -w .x,.y | Changes the Position of the HUD to the given Positions. A Value of 0 does nothing on the axis.
.distancer_hud_speed | Shows you the current Refreshspeed of the HUD in Seconds.
.distancer_hud_speed Number | Changes the Refreshspeed of the HUD in Seconds. 0 turns the HUD off.

All Commands now starts with .distancer_XXXX.
Update of the HUD now about minetest.after().

Greetings Clyde.

User avatar
Lone_Wolf
Member
Posts: 2355
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [CSM] Distancer

by Lone_Wolf » Post

Clyde wrote:Update:
Version 2.2

Command to changes the Position of the HUD added.
.distancer_hud_change | Shows you the current Position of the HUD in Chat.
.distancer_hud_change -r | Reset's the Position of the HUD to default.
.distancer_hud_change -w .x,.y | Changes the Position of the HUD to the given Positions. A Value of 0 does nothing on the axis.
.distancer_hud_speed | Shows you the current Refreshspeed of the HUD in Seconds.
.distancer_hud_speed Number | Changes the Refreshspeed of the HUD in Seconds. 0 turns the HUD off.

All Commands now starts with .distancer_XXXX.
Update of the HUD now about minetest.after().

Greetings Clyde.
It might be a good idea to make the commands shorter. It's annoying to have to sit there and type a big long cmd just to do one simple little thing.
Suggestions:
  • Replace distancer_hud with dhud
  • Maybe replace change with s or set (Not really needed because `change` is pretty easy to type quickly)
Nice mod btw. It'll be useful for builders planning out their projects

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Hello,

i like your idea with the shorter commands, it's nothing what is carved in stone, so i think, i will do it so.
Thx for your proposal, Lone_Wolf.

Greetings Clyde.

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Update:

Commands now shorter .dhud ....
Command .dhud on|off added. Turns all HUD's of the Distancer on or off.

Greetings. Clyde.

User avatar
Lone_Wolf
Member
Posts: 2355
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [CSM] Distancer

by Lone_Wolf » Post

Clyde wrote:Update:

Commands now shorter .dhud ....
Command .dhud on|off added. Turns all HUD's of the Distancer on or off.

Greetings. Clyde.
Awesome. Thanks!

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

You're Welcome, Lone_Wolf ;-).

Update:
Hud for Waypoint added. You can see a Hud in red with <Marker> on the Screen.
Of course is this Hud on and off switchable.
.dhud_waypoint on|off

Greetings Clyde.

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Update: Only for MT 5.x.x
With Version 2.7, added a API to Distancer for Modwriter.

Var:
  • dst.ver | Version Number of the loaded Distancer.
  • dst.rev | Revision Number of the loaded Distancer.
  • dst.name | Name of the Mod.
API:
  • dst.send_pos(name, position) | name = playername, position = string like "0,0,0". Set's the Marker to the Position "x,y,z".
Greetings, Clyde.

Gundul
Member
Posts: 905
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia

Re: [CSM] Distancer

by Gundul » Post

Clyde wrote: How to install:
Move the folder to your clientmods directory of your minetest-folder.
Then activate the mod in your mod.conf.
Hi clyde, this works pretty good. At least once I figured out it is the mods.conf and not mod.conf :)
A player in Jungle wanted to have this to find boundaries of mapblocks for his technic stuff. It took us
a while to get it to work.

Maybe it should be mentioned also that mods.conf must be in the ~/.minetest/clientmods folder
and not in the folder of the mod. Also clientmods must be enabled in the client: /client/network/clientmodding = true
My servers: Jungle, Lilly in the valley, ZombieTest

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Hello Gundul,

of course, you're right, it's the mods.conf in the clientmods directory and not the mod.conf inside the mod.
Thanks for reporting this, i've fixed it and deactivated my little trap, sorry for this ;-).

And yes, some day's ago, i helped Pixalou with the install of this mod on linux mint and figured out, that he had the folder for the mods in /var and not in .minetest.
We was doing the same procedure and then he found a second minetest-folder in /var, there the mod was working.

Greetings, Clyde.

User avatar
Lone_Wolf
Member
Posts: 2355
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [CSM] Distancer

by Lone_Wolf » Post


User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Update: Version 3.1

Complete reworked code.
New function safe_dead added.
Easy to add commands for the Future.
Added a dynamic Helpsystem.

The new version has now a safe_dead-mode. When this mode is on and you die in the game, the distancer set's the waypoint to your position of death. But the distancer don't forget the old waypoint, so you can go back to your body, collect your bones and restore the waypoint to your old position.

The new version uses only one chat command to control the entire distancer.

Of course, you can every time turn on or off this mode.

Greetings, Clyde.

User avatar
Clyde
Member
Posts: 148
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Post

Update:

Not a new release, but i have fixed a silly bug, if you use the last release, update it with the repository.

Greetings, Clyde.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests