[CSM] Distancer

User avatar
Clyde
Member
 
Posts: 42
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.

Commands:
  • .marker | Shows you the current stored Marker.
  • .marker -s | Set's the Marker to your current Position.
  • .marker -m | Shows you the Distance between your current Position and the (valid) Marker.
  • .marker -p | Shows you a vector of the Distance between your current Position and the (valid) Marker.
  • .marker -w X,Y,Z | Writes a manual given Position to the Marker. Example: .marker -w 50,-10,100 - Set's the Marker to the Position 50,-10,100.

Other Commands:
  • .show_mapblock | Shows you the Mapblocknumber of your current Position.
  • .who_is_online | Lists the Names of the (online) Player.
  • .distancer_version | Shows you the Version of the Mod.
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 mod.conf.

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

=======================================================================

Only for Version 5.x.x.


Image

Additional Commands:
  • .dhud on|off | Turns all HUD's of Distancer on or off.
  • .dhud_mapblock on|off | Turns the HUD for the current Mapblock on or off.
  • .dhud_measure on|off | Turns the HUD to measure distances on or off.
  • .dhud_waypoint on|off | Turns the HUD for the Waypoint on or off.
  • .dhud_waypoint -c <color> | Changes the Color of the Waypoint to <color> (like green) or shows the available colors.
  • .dhud_change | Shows you the current Position of the HUD.
  • .dhud_change -r | Resets the Position of the HUD to default.
  • .dhud_change -w .x,.y | Set's the Position of the HUD to the given Values. A Value of 0 left the Position unchanged.
  • .dhud_speed | Shows you the current Refreshspeed of the HUD in Seconds.
  • .dhud_speed Number | Changes the Refreshspeed of the HUD in Seconds. 0 turns the HUD off.

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".
Download:
Source:
https://github.com/acmgit/distancer

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

Have Fun with it.
Greetings, Clyde.
Last edited by Clyde on Mon Jan 14, 2019 15:26, edited 13 times in total.
 

nrz
Developer
 
Posts: 127
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: 42
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: 42
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: 42
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: 2026
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
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: 42
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: 42
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde
 

User avatar
Lone_Wolf
Member
 
Posts: 2026
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
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: 42
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: 42
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.
 


Return to Client-side modding



Who is online

Users browsing this forum: No registered users and 0 guests