[Mod] Compass GPS [compassgps]

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

[Mod] Compass GPS [compassgps]

by Kilarin » Thu May 29, 2014 05:48

Compass GPS version 2.7
This mod creates a customizable compass with user settable bookmarks and shared and admin bookmarks in multiplayer.

Echo created a compass mod back in 2012: https://forum.minetest.net/viewtopic.php?id=3785
PilzAdams made a modification of it, which I can not find the source to, I don't know how much of PilzAdams changes made it into the later versions of Echo's mod.
Then in 2013 TeTpaAka made a fork of the compass mod that he called compass+ https://forum.minetest.net/viewtopic.php?id=8117
This fork added the ability to "bookmark" specific places, and a gui so you could choose what point the compass should point to.

This is my fork of TeTpaAka's fork of Echo's mod. :)

The compass mod as it was is REALLY cool I love the way Echo managed to make the compass in your inventory actually change it's image to point in the direction of it's target

Image

And TeTpaAka's gui, file io, and coding for multiplayer games was simply amazing. But as I was learning from their awesome code, I saw some changes I'd like to make using these new ideas, as well as some things I learned while looking at other mods. So, with complete and total respect for the original awesome mods, and hopefully in the same spirit as theirs, I present my own fork of the fork. CompassGPS

The crafting recipe for a compass is unchanged:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
     , steel        ,
steel, mese fragment, steel
     , steel        ,

Image

Compass GPS introduces several other changes though. First of all, this mod adds a heads up display that indicates your current position, and the name of the bookmark the compass is pointing at, that bookmarks pos, as well as the distance to that bookmark.

Image

The hud updates constantly as long as the compass is in one of your active inventory slots, so you can always know where you are in relation to the target node, and how far away it is.

There is a GUI that pops up whenever you wield the compass and left click. I never played with a GUI in minetest before, so this was a new experience for me, I learned a lot and made quite a few changes:

Image

To create a new bookmark, type the name into the "bookmark:" field and click "Create Bookmark" (or just hit enter). To remove a bookmark, select it from the list and click "Remove Bookmark." A confirmation dialog will appear and the bookmark will only be removed if you click "YES".

The bookmark list has been expanded from a dropdown into a textlist to improve visibility. Select any bookmark in the list by clicking on it, and then click "Find Selected Bookmark" to make the compass (and hud) point at that location. "default" is always at the top of the list and will point to (0,0,0) or your bed from PilzAdams bed-mod, or home location as defined in the sethome-mod. (Setting default to your bed or sethome is old code, I modified it to make it work with my new version, but I cant take credit for the idea or basic structure.) The rest of the list are bookmarked locations that you have set and named

Just click in the "Sort by" box to change whether the bookmarks are sorted by name, or by distance from your current location. ("default" will still always be the first item in the list no matter which way you sort it)

Click in the "Dist" box to change whether the distance is calculated in 3d (including your distance in the vertical direction) or in 2d (x and z coords only, ignore vertical distance)

Down at the lower right of the screen, I'm certain you noticed the "Teleport to bookmark" button. That button appears if, and ONLY IF the player has teleport privileges. If they do, then they can select any bookmark out of the list, click on teleport, and be instantly transported to the location of that bookmark. Since the user already had teleport privileges, this just saved them some typing, it's not adding any new abilities.

If you click the "Settings" button in the upper right hand corner it brings up a screen where you can customize the appearance of your compass gps:

Image
(The two awesome new compass images are by Bas080 and Spootonium)

I figured the position of the hud text was likely to be something that people would want to customize, so here in the settings gui are the x and y coords for the hud text. Just enter the new coords where you want the hud text to appear and click "Change Hud"
The cords must be between 0 and 1 and represent a percentage of the screen, so x=0 would put the text at the far left of the screen, and y=0.98 would put the text almost at the bottom of the screen. The default is x=0.4 and y=0.01, and that is displayed right over the input boxes so the user can easily set them back to the default if they are having trouble placing the hud. If you change either the x or y coord to a number that is out of range (less than 0 or greater than 1) then the hud will not be displayed. That makes it easy to turn the hud off if you wish.
You can also change the color of the hud text by changing the value in the "Color" field here. Again, click "Change Hud" to make the update appear.

AND, there are three buttons here that allow you to select from 3 different styles of compass images. The basic compass image by Echo. A nice wooden compass image by Bas080. And a high resolution compass image by spootonium.

In Multiplayer, there are now shared and admin bookmarks!
Image
If a player has the new "shared_bookmarks" privilege, then they will get the "Create Shared Bookmark" button and be able to create bookmarks that all players on the server can see and use. Shared bookmarks are preceded by *shared* and the name of the player that created them. There is a variable near the top of the init.lua called max_shared. This controls the maximum number of shared bookmarks that an individual player can create. It is set to 10 by default, but the server admin can change it to whatever they want. A player can delete their own shared bookmarks, but they can not delete anyone else's (unless they are an admin, then they can delete anyone's shared bookmarks)

If a player has the "privs" privilege, then they will get the "Create Admin Bookmark" button. Admin bookmarks are intended to allow the admins to mark important places in their world that they want everyone to be able to find. There are no limits on how many admin bookmarks can be created. Only Admins can delete admin bookmarks.

In a multiplayer game, all players get the "Show: Private, Shared, Admin" checkboxes. You can use these checkboxes to toggle which type of bookmarks show in your list. If you uncheck all three the system will automatically recheck "Private" for you.

The bookmark list is saved any time a user changes it. All of your other settings, the currently selected bookmark, sort order, distance function, and hud position and color, and compass type, are saved whenever a user leaves the game, and on game shutdown. So if you move the hud down to the lower right hand corner of the screen, and then quit, the hud will still be in the place you put it when you restart the game later.

The Chat Commands from the orignal compass mod still work, but only on private bookmarks. Chat commands available are:
list_bookmarks
set_bookmark <bookmark name>
find_bookmark <bookmark name>
remove_bookmark <bookmark name>

I also fixed a few bugs while I was working on this. There was a problem in the mod that caused compass to jump around in inventory if there were empty slots above it, that is fixed now. And there was also a problem with the bookmark list not being saved after you removed a bookmark if you didn't add a new bookmark afterwards. Now the bookmark list is saved whenever you change it, either adding or removing.

I tried to follow Echo and TeTpaAka's examples of how to properly code for multiplayer games, and all of the new settings should work just fine in a multiplayer game.

---- MAPS! ----

Thanks to a great idea and initial code from TeTpaAka CompassGPS now includes MAPS!
Maps allow you to store a bookmark that you can then give to another player and they can use the map to put that bookmark into their own list. They also enhance role playing/story possibilities since you can hide maps for players to find that will give them bookmarks they need to find their next goal.

Craft a blank map by putting 5 papers in an X pattern:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
paper,     ,paper
     ,paper,
paper,     ,paper

Image

To place a bookmark into a map, just right click while wielding the map, select any bookmark from your list, and click the "write to cgpsmap" button. You can also put your current position into the map (without having to first create a bookmark in your compassGPS)

The map icon now changes to have a red X on it, so you can tell it is a marked map. This map can be given to another player. To transfer the bookmark to their own compassgps, they right click while wielding the marked map and a formspec like this pops up:
Image
You can change the name of the bookmark to whatever you wish, click the "copy bookmark to your compassgps" button and the new bookmark is now available in your compassgps list.

To turn a marked map back into a blank map, just put it into the crafting grid.

Thanks to some nice code by Miner59 you can now mount a map on a wall! If you can dig on the position where the map is placed, you can take the map, otherwise you can add the bookmark saved in the map in your compassgps. This will make it possible on a multiplayer server to mount maps that everyone can use.

---------------------

The code is kinda a mess, because I was learning a lot of new things while working on it. I hope to do a clean up on it sometime in the near future, but I wanted to release it now so some people could start testing it. Please do not hesitate to offer critiques, criticism, or coding advice. I'm new to lua and minetest and could use the help.

And above all, if you run into a bug, please let me know!

Credits:
Original mod is by Echo and TeTpaAka, and probably PilzAdam. Cactuz_pl clockmod showed me how to write the hud to the screen. My son offered a lot of advice and suggested several changes. I got an example of how to sort lists in lua from Michal Kottman on StackOverflow. Big thanks to Bas080 and spootonium for providing some very nice alternate images for the compass gps mod! Also thanks to Topywo for the shared bookmarks idea, and to my son for several ideas, corrections, and testing help.
Map idea, image, and initial code by TeTpaAka. Store current position in map code contributed by Miner95
intllib support by TeTpaAka
Wall mounted maps by Miner59

License:
Original code by Echo, PilzAdam, and TeTpaAka is WTFPL. My changes are CC0 (No rights reserved)
textures: original compass textures: CC BY-SA by Echo
compass b textures: CC BY-SA by Bas080 (slight modifications by Kilarin)
compass c textures: CC BY-SA by Andre Goble mailto:spootonium@gmail.com
(slight modifications by Kilarin)
map texture: CC BY-SA by TeTpaAka (slight modifications by Kilarin for blank map)

Dependencies:
default is the only requirement.
PilzAdams Beds mod and the sethome-mod are supported if you have them.

Incompatibilities:
This mod will clash with both the original compass and compass+ mods. They should not be installed and enabled at the same time as compassgps. HOWEVER, compassgps is 100% compatible with the bookmarks file from the compass+ mod. So if you were using compass+ and switch to compassgps you will NOT lose your previous bookmarks.

github source:
https://github.com/Kilarin/compassgps

Download:
https://github.com/Kilarin/compassgps/archive/master.zip

To install:
Simply unzip the file into your mods folder, then rename the resulting folder from compassgps-master to compassgps
OR, simply install it directly from minetest using the online mod repository.

Mod Database:
If you use this mod, please consider reviewing it on the MineTest Mod Database.
https://forum.minetest.net/mmdb/mod/compassgps/

Changelog:
2.7 bug fix: in a catastrophic server crash, compassgps_settings or bookmarks file could exist, but be empty. When the file exists but is empty, the table it is loaded into ends up as nil instead of empty and that causes the server to crash on startup. NOT GOOD! With bug fix, if file exists but is empty, server will start but not crash and new contents for empty file will be created. a message will appear in the debug informing server owner to restore bookmarks from backup if possible.
2.6 bug fix from myoung008, type causing crashes when entering bad color.
2.5 bug fix from TeTpaAka fix bug when static_spawnpoint is invalid
2.4 wall mounted maps by Miner59
2.3 intllib support by TeTpaTka so CompassGPS will work with different languages now!
2.2 current position option in bookmark list when writing to map (Miner95 contribution)
2.1 cgpsmap_marked notincreative and defaults to default on /giveme
2.0 maps so you can exchange bookmarks between players (TeTpaAka initial contribution)
1.9 corrected undeclared global variables to avoid warnings.
1.8 changed register_craft to compassgps:0 for unified inventory compatibility
1.7 fixed bug causing crash on first load of formspec in multiplayer
1.6 fixed compass point_to not saving
1.5 shared/admin bookmarks. confirm dialog for remove.
1.4 corrected teleport button priv
1.3 multiple compass types
1.2 rounding of position corrected
1.1 switched core to minetest
1.0 Initial release
Last edited by Kilarin on Fri Jul 31, 2015 20:42, edited 19 times in total.
 

User avatar
LemonLake
Member
 
Posts: 46
Joined: Sat May 10, 2014 18:27
GitHub: LemonLake
IRC: Lemmmy
In-game: Lemmmy

Re: [Mod] Compass GPS [compassgps]

by LemonLake » Thu May 29, 2014 07:26

I love the modifications, love the idea and love the whole mod! Great work! Can't wait to see more from you.
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

Re: [Mod] Compass GPS [compassgps]

by Topywo » Thu May 29, 2014 08:53

Left clicking gives me an errror (core = nil), but then my version is from before 8 may 2014, so it doesn't recognize that variable.

If I understand correctly this compass mod works for 'yourself' as minetestplayer. Do you think it is possible to make something like a 'shared' compass? (for players to share with each other or a 'server' compass, so the administrator/moderators can share the points of interest).
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Thu May 29, 2014 12:06

Glad you like it LemonLake!

Topywo wrote:Left clicking gives me an errror (core = nil), but then my version is from before 8 may 2014, so it doesn't recognize that variable.

Yikes! Thats what I get for pulling an example straight out of default. I had no clue that was brand new code. Sorry about that. I've rewritten that section as:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
  local player_privs
  if core then player_privs = core.get_player_privs(name)
  else player_privs = minetest.get_player_privs(name)
  end


So now it should only call core if core is defined. Could have just gone with minetest.get_player_privs, but I'm assuming there was some good reason they switched it to core. This is uploaded to git, so if you pull a fresh copy you should be able to run the code. (Assuming I didn't make any other stupid mistakes like that one) :)

Topywo wrote:If I understand correctly this compass mod works for 'yourself' as minetestplayer. Do you think it is possible to make something like a 'shared' compass? (for players to share with each other or a 'server' compass, so the administrator/moderators can share the points of interest).

That is a fascinating idea. But instead of having a special "shared" or "server" compass, how about allowing "shared" or "server" bookmarks. "Shared" bookmarks could be created by anyone and everyone could see them whenever they enabled shared bookmarks. And "Server" bookmarks could only be created by the server admin but could still be seen by anyone whenever they enabled server bookmarks.

I like the idea. I can certainly see where it would be useful. But it will require quite a bit of recoding. I'll see what I can do.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

Re: [Mod] Compass GPS [compassgps]

by Evergreen » Thu May 29, 2014 13:36

This is a wonderful idea! The teleport to bookmark thing seems slightly cheaty though, maybe only allow teleportation if the player has the teleport priv? I might actually fork it and add it, I could use some practice.
 

ssieb
Member
 
Posts: 14
Joined: Mon Apr 08, 2013 19:51
GitHub: ssieb
IRC: ssieb

Re: [Mod] Compass GPS [compassgps]

by ssieb » Thu May 29, 2014 15:28

Evergreen wrote:This is a wonderful idea! The teleport to bookmark thing seems slightly cheaty though, maybe only allow teleportation if the player has the teleport priv? I might actually fork it and add it, I could use some practice.


Did you read the whole description...
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

Re: [Mod] Compass GPS [compassgps]

by Evergreen » Thu May 29, 2014 19:33

ssieb wrote:
Evergreen wrote:This is a wonderful idea! The teleport to bookmark thing seems slightly cheaty though, maybe only allow teleportation if the player has the teleport priv? I might actually fork it and add it, I could use some practice.


Did you read the whole description...

Oh sorry, I didn't evene notice that. :P
 

User avatar
lightonflux
Member
 
Posts: 384
Joined: Mon Nov 11, 2013 07:22
In-game: lof

Re: [Mod] Compass GPS [compassgps]

by lightonflux » Thu May 29, 2014 22:58

IMHO it looks to similar to the watch mod. Maybe we could change the texture to make both mods easier to distinguish.

Image

Maybe it could be beige with a wooden frame and a bronze or red pointer. Pic of nice looking compass from the web.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Fri May 30, 2014 02:38

My son was testing compassgps today and when I got home from work he pointed out to me that there is a problem with the way the mod rounds your position when creating bookmarks. I was operating under the assumption that when you move into a new node, say node x=100, as you first cross the line into the new node, your x coord would change to 100, when you hit the middle of the node the x coord would be 100.5, and it wouldn't change to 101 until you crossed the edge of the next node. And so I simply truncated the decimal portion of the position to get an even node number. This was dead WRONG.

The coords of the x=100 node are 100 at the exact center of the node. So you would be passing 99.5 when you first enter into the node, and 100.5 as you cross into the next node. The correct way to determine the node from your position is to round, not truncate.

So, easy fix. Version 1.2 is up on github now and it rounds the x and z coords correctly. While I was making that change, I modified the y coord to round to 1 decimal place. That way if you teleport to a bookmark you won't see that half node fall.

Please download the new version if you are using compassgps so that your bookmarks will be more accurate. it doesn't usually matter if the bookmark is off by one node, but might as well get it right.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Fri May 30, 2014 02:55

EvergreenTree wrote:Oh sorry, I didn't evene notice that

Ha! Don't worry about it. My description of the mod was probably too long. :)

lightonflux wrote:Maybe we could change the texture to make both mods easier to distinguish.

Not a bad idea. I'll see what I can do. Graphics are NOT my strong point, so if someone wants to present some prettified textures, I'd be more than happy to accept them. :)

speaking of future development:
This is my plan on the shared bookmarks idea. let me know if you folks think this will work:

I will add a new privilege "shared_bookmark" If someone has that priv, then they will get a button on the gui allowing them to create a shared bookmark. If someone has the "privs" privilege, (or basic_privs if people think that would be better) then they will get a button on the gui allowing them to create a server bookmark.

Everyone will have a checkbox on the gui (we can do checkboxes, can't we?) for "shared bookmarks" and "server bookmarks" These will default to unchecked. If a user checks the "shared bookmarks" box, then their bookmark list will show (in addition to their own bookmarks) the "shared bookmarks" created by other users. If they check the "server bookmarks" then their bookmark list will show the server bookmarks created by the server admins.

The server bookmarks would be an easy way for the admins to mark important places on the map. Large cities etc. Anything that the admins would like everyone to know the location of.

The shared bookmarks will be for individual players to mark interesting spots or their house or anything that they want to recommend others go and see. Individual players should have a limit on how many shared bookmarks they can create. (say 20?) I could create tiered privs allowing user to create more or less shared bookmarks, but unless people think that would be particularly useful, it sounds like extra complication for no particular added benefit to me.

Admins should be able to delete server bookmarks and anyone's shared bookmarks. An individual user should only be able to delete their own bookmarks and the shared bookmarks that they have created.

Does this sound like it would be useful to you folks?
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

Re: [Mod] Compass GPS [compassgps]

by Topywo » Fri May 30, 2014 09:27

Kilarin wrote:Does this sound like it would be useful to you folks?


Yes!
 

User avatar
spootonium
Member
 
Posts: 94
Joined: Fri May 02, 2014 01:38

Re: [Mod] Compass GPS [compassgps]

by spootonium » Fri May 30, 2014 22:57

lightonflux wrote:IMHO it looks to similar to the watch mod. Maybe we could change the texture to make both mods easier to distinguish.


Delivrar! (Well, deliv-zip, but still...)
compass-textures.zip
Compass textures (12-direction).
(31.09 KiB) Downloaded 150 times


I'm also working on a 16-direction version, but I think going beyond that, even at 64x would be excessive.
I write code. Sometimes, it even works.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Fri May 30, 2014 23:19

These are AWESOME. Better than I believed possible at this scale!

Image

One question though, I think it's a little bit harder to tell instantly which direction it is pointing. Should we perhaps darken the compass line and emphasize the arrow point more? What do you think?
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

Re: [Mod] Compass GPS [compassgps]

by Bas080 » Fri May 30, 2014 23:46

Please use 16x16 textures when making something for the game. Leave it up to texture packs to make highres textures and such.

I made a texture that you might like. It shows the basic idea. Here it is.

Image
Image
Image
Image

And a zipfile of the files can be downloaded here:
https://dl.dropboxusercontent.com/u/419967/minetest/compass/compass_textures.zip
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Sat May 31, 2014 00:12

I like those as well.

Image

AND, I can set it up where the user can choose the compass they like best.
 

User avatar
spootonium
Member
 
Posts: 94
Joined: Fri May 02, 2014 01:38

Re: [Mod] Compass GPS [compassgps]

by spootonium » Sat May 31, 2014 06:10

Bas080 wrote:Please use 16x16 textures when making something for the game. Leave it up to texture packs to make highres textures and such.
(...)


I know, I know - "visual style" and all that. :sheepish grin: I still say that 32x is a better compromise. :P

@kilarin : Thanks. I'll try adjusting/sharpening for the 16-direction version, since it's close to finished.
I write code. Sometimes, it even works.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Sun Jun 01, 2014 23:04

Ok, got it coded that handles the new images (as well as letting you set the color of the hud text), making a few small adjustments, mainly getting new screen shots. :) and I'll have a new version up this evening.

@spoontonium: after coding this new part to deal with the new images, I am thinking that a 16 position compass would be difficult to integrate along with the 12 position compasses. not impossible, mind you, but difficult. And I'm not certain there would be that much benefit from it.

@Bas080: What is the license on your images?
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Mon Jun 02, 2014 00:15

New version (1.3) uploaded. See updates in original post.

Please give it a try and let me know what you think. It is completely compatible with the previous version. This version allows you to update the hud color, and to select between 3 compass models.

(No shared bookmarks yet, that will have to come later) :)
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

Re: [Mod] Compass GPS [compassgps]

by Bas080 » Mon Jun 02, 2014 08:17

The formspec could be more compact. I'll make sure to help with that once the shared bookmarks are implemented.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Mon Jun 02, 2014 11:38

Bas080 wrote:The formspec could be more compact.

Every time I squished things closer together, I would test with a smaller window and fields would start bumping into each other or overlapping. Would LOVE some help on getting everything to fit in better.
I'll be working on the shared bookmarks in my spare time this week, so should have something up pretty soon I hope.
 

User avatar
LemonLake
Member
 
Posts: 46
Joined: Sat May 10, 2014 18:27
GitHub: LemonLake
IRC: Lemmmy
In-game: Lemmmy

Re: [Mod] Compass GPS [compassgps]

by LemonLake » Mon Jun 02, 2014 11:42

Kilarin wrote:
Bas080 wrote:The formspec could be more compact.

Every time I squished things closer together, I would test with a smaller window and fields would start bumping into each other or overlapping. Would LOVE some help on getting everything to fit in better.
I'll be working on the shared bookmarks in my spare time this week, so should have something up pretty soon I hope.


Try adding true to the end of size, it makes the size always stay the same no matter the screen size
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Mon Jun 02, 2014 13:32

LemonLake wrote:Try adding true to the end of size, it makes the size always stay the same no matter the screen size

I'll try that, but wouldn't making the elements stay exactly the same size make this situation WORSE? MineTest tries to figure out everything in sizes relative to the current users screen size, which takes a lot of load off of the mod developer because you just have to make certain things aren't too crowded, and it will fit the elements in no matter what the resolution the user is running at. At least, I thought that was the idea.
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

Re: [Mod] Compass GPS [compassgps]

by cHyper » Mon Jun 02, 2014 20:07

awesome mod...
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Wed Jun 04, 2014 03:22

Thank you cHyper, although the majority of the credit goes to the original developers.

Shared bookmarks are coming along fine, BUT, while working on them this evening I discovered a bug. Looks like I owe Evergreen an apology. The documentation said that the teleport button only showed when you had the teleport priv, but apparently that was NOT working right. The Teleport button was showing up whether you had the teleport priv or not. I wanted to get that fixed PRONTO, so version 1.4 is now available for download from github and will correctly show the teleport button ONLY when you have the teleport priv.

If I can get a few more evenings free, I should have shared bookmarks working.
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

Re: [Mod] Compass GPS [compassgps]

by cHyper » Wed Jun 04, 2014 11:41

good work.. to all developers of this mod...
 

User avatar
ShadowNinja
Member
 
Posts: 194
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Compass GPS [compassgps]

by ShadowNinja » Thu Jun 05, 2014 01:28

Kilarin wrote:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
  local player_privs
  if core then player_privs = core.get_player_privs(name)
  else player_privs = minetest.get_player_privs(name)
  end


At this time the "core" namespace is only an implementation detail. It should ONLY be used by the Minetest core, including builtin. Mods should only use the "minetest" namespace. That is why the modding documentation mentions only the "minetest" namespace.
I play on my Minetest server and VanessaE's.
The best way to contact me is usually IRC (InchraNet, freenode).
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Thu Jun 05, 2014 02:43

ShadowNinja wrote:At this time the "core" namespace is only an implementation detail

Thanks for the info.
My flaw was that I didn't find an example of how to look up player privs in the documentation that quite answered all my questions. So I just scanned through the minetest lua code for an example, and picked one from there.

I'll know better next time!
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Tue Jun 10, 2014 15:05

Version 1.5 is out. And now you have shared and admin bookmarks in multiplayer games!

Image

Whew! It looks small in the changelog, but it required a major rewrite of how bookmarks are handled. But the new system is a big internal improvement in my opinion.

The original way bookmarks were stored in the old mod was to simply concatenate the players name and the bookmark name as the key in the table. That ensured that each bookmark was unique. BUT, since there was no separator between the playername and bookmark name, it meant that there was no way to tell what the actual playername was that created a bookmark except by comparing it to the current playername. This left the unlikely, but not impossible scenario where a player named "ElvisLives" could create bookmarks, and another player named "Elvis" would be able to see (and delete) not only his own bookmarks, but all of the ElvisLives bookmarks as well. That can't happen with the new bookmark structure.

The new structure stores the players name, the bookmark name, and the bookmark type in the bookmark along with the position. The mod is coded so that it is compatible with the old bookmarks and will convert them to the new format. So you won't lose any old bookmarks when you convert to the new version.

The only changes that will be noticed by singleplayer users are the confirmation dialog for remove bookmarks, and I fixed a bug that, under certain circumstances, could cause one compass to disappear when you were carrying two.

Please let me know if you find any problems!
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

Re: [Mod] Compass GPS [compassgps]

by Bas080 » Tue Jun 10, 2014 16:11

Kilarin, I forgot to mention the license for the png's I made for the 16x16 texture for this mod. The one you mentioned in a pm, "CC BY-SA", is good.

EDIT: The mod is looking great. I do notice that the amount of bookmarks can become a lot on public servers. It might be handy to search by player or by bookmark name.

I would like see servers use this. It won't interfere with possibly existing bookmarking functionality, thus leaving it up to the player to choose his/her favorite method of bookmarking.
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

Re: [Mod] Compass GPS [compassgps]

by Topywo » Tue Jun 10, 2014 17:16

Impressive. I'll try it out, but as Bas080 said, I hope to see it on a server.
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 35 guests

cron