[CSM] Distancer

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

[CSM] Distancer

by Clyde » Sat Dec 15, 2018 19:04

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: 130
Joined: Sat Feb 07, 2015 17:16
Location: France
GitHub: nerzhul
IRC: nrzkt
In-game: nrz

Re: [CSM] Distancer

by nrz » Mon Dec 17, 2018 11:33

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Wed Dec 19, 2018 20:59

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Thu Dec 20, 2018 23:19

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Sat Dec 22, 2018 12:42

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: 2296
Joined: Sun Apr 09, 2017 05:50
Location: Not there, THERE!
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf

Re: [CSM] Distancer

by Lone_Wolf » Sat Dec 22, 2018 16:36

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Sun Dec 23, 2018 11:36

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde
 

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

Re: [CSM] Distancer

by Lone_Wolf » Fri Dec 28, 2018 23:47

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Fri Dec 28, 2018 23:56

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Mon Jan 14, 2019 15:31

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: 734
Joined: Thu Aug 27, 2015 10:55
Location: Europe/Asia
GitHub: berengma
IRC: Gundul

Re: [CSM] Distancer

by Gundul » Sat Aug 03, 2019 09:17

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [CSM] Distancer

by Clyde » Sat Aug 03, 2019 17:26

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: 2296
Joined: Sun Apr 09, 2017 05:50
Location: Not there, THERE!
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
 

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

Re: [CSM] Distancer

by Clyde » Sun Mar 22, 2020 00:30

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: 142
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde
 


Return to Client-side modding



Who is online

Users browsing this forum: No registered users and 1 guest