[Mod] Compass GPS [compassgps]

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

Re: [Mod] Compass GPS [compassgps]

by ShadowNinja » Post

Kilarin wrote:

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.

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

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!

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

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
Location: Netherlands

Re: [Mod] Compass GPS [compassgps]

by Bas080 » Post

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: 1721
Joined: Fri May 18, 2012 20:27

Re: [Mod] Compass GPS [compassgps]

by Topywo » Post

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

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

<sigh> Isn't it always RIGHT AFTER you put some code out in the public that the bug shows up? My son comes up to me, not 15 minutes after I put this out and says, "Dad, It's crashing." I was very careful to convert old bookmarks. What I hadn't done was to convert old settings. If you tried to run version 1.5 of this mod with a previous settings file, it would crash. I've corrected that now. It will handle old settings files just fine now.

So, if you downloaded this and it crashed on you. Please download again, and it should run fine.
Bas080 wrote:The one you mentioned in a pm, "CC BY-SA", is good.
Corrected in the readme now. thank you!
Bas080 wrote: It might be handy to search by player or by bookmark name.
My son was demanding the same thing. I guess with two of you, I should see if that could be added. :)

While I'm adding things. Would people be interested in adding a text field that could be displayed for each bookmark? Essentially a journal type entry that would let you type several lines of text that would display in a text box in the gui whenever you selected that particular bookmark.

So, for example, if you created a bookmark called "big cave", you could add text that would appear (in the gui, NOT the hud) when that bookmark was selected saying: "I explored most of this, found a lot of copper near the top, but there is a large unexplored region down below that appears to be rich in mese and diamonds" Or the admin bookmark "Spawn City" might have accompanying text saying "You can get basic equipment free at the miners union, and rent an apartment at the highrise to store your stuff"

Would that be useful? Or overall, just an annoyance because you can put enough of a description into the bookmark name to tell you what you wanted to know?
Topywo wrote: I hope to see it on a server.
If you want to test it in singleplayer mode, there is a variable at the top of the ini file: show_shared_on_singleplayer=false
Change that to true and shared and admin bookmark options will appear in single player. Of course, with only one player, they aren't much use. :) A better way to test them is to open two minecraft sessions, with one as server and the other as client.

If anyone puts this on a server, please let me know. I'd love to see the shared/admin bookmarks working in a real environment.

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

Compass GPS is now correctly uploaded to the MineTest Mod Database mmdb/mod/compassgps/

This should make it easy to install directly from MineTest. If you use it and like it (or not), please feel free to rate/review it there

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

Quick bug fix. The compass point_to was not saving in your settings, so you had to reselect what bookmark you wanted the compass pointing to each session.

Not very important, but patched if you want to download the new version.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [Mod] Compass GPS [compassgps]

by twoelk » Post

Kilarin wrote:Compass GPS version 1.6
This mod creates a customizable compass with user settable bookmarks and shared and admin bookmarks in multiplayer.
...
reading the name of this mod I wondered if you could supply a feature like "save bookmarks as *.gpx" ;-P
not that that would be of any use in real life gadgets but some slippymaps applications, such as the googlemap api or openlayers or leaflet to name a few, can read the gpx format among others and some of these applications have been used to display minetest maps. This might be an easy way to add layers to such an application.

User avatar
Echo
Member
Posts: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

Re: [Mod] Compass GPS [compassgps]

by Echo » Post

Kudos!

TeTpaAka
Member
Posts: 141
Joined: Sat Dec 28, 2013 21:54

Re: [Mod] Compass GPS [compassgps]

by TeTpaAka » Post

Good work!

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

Thank you TeTpaAka and Echo! But if its any good, its because it's built on top of your excellent code!
Last edited by Kilarin on Tue Feb 03, 2015 19:20, edited 1 time in total.

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

Re: [Mod] Compass GPS [compassgps]

by lightonflux » Post

With the recent dev release the compass flickers if you hold it in your hand.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

Re: [Mod] Compass GPS [compassgps]

by Evergreen » Post

lightonflux wrote:With the recent dev release the compass flickers if you hold it in your hand.
That's because it is replacing the item in your inventory every time it switches textures. No way to fix that (not that I know of anyway)

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

Re: [Mod] Compass GPS [compassgps]

by lightonflux » Post

But it didn't happen before (at least on my end). Looks a bit like tearing.

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

lightonflux wrote:But it didn't happen before (at least on my end). Looks a bit like tearing.
thats very interesting. they must have changed something in the engine that causes the replacement to flicker instead of happening quickly and smoothly.
Evergreen wrote:That's because it is replacing the item in your inventory every time it switches textures. No way to fix that (not that I know of anyway)
There are several mods that use this strategy to change the image for a tool. Screwdriver, clock, the compasses, bridgetool, etc. It's a hack, and a clumsy one in my opinion.

What I wish the brilliant devs could figure out how to do would be to allow a mod to override the image for a particular tool without having to replace it. It would be trivial to do it for the whole class of tools, but we need a way to modify the image for the particular compassgps, clock, or screwdriver that one player is carrying and not for every compassgps, clock or screwdriver in the game. And I'm afraid that might be complicated.

User avatar
LazerRay
Member
Posts: 147
Joined: Sun Jul 27, 2014 01:32
GitHub: LazerRay

Re: [Mod] Compass GPS [compassgps]

by LazerRay » Post

I think I discovered a bug with Compass GPS, I get this error message after some time playing the game:

ERROR[ServerThread]: ERROR: An unhandled exception occurred: Couldn't save env meta
compassgps writing settings

After the message shows up in the chat console, the game basically stops working, except for player movement.

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

Thank you very much for the report!

Important questions:
1: Has this happened more than once?
2: What were you doing when it happened?
3: When you restarted the game, did everything work, including were your bookmarks and compassgps settings all there?

The "compassgps writing settings" message comes from the compassgps.write_settings() function (logically enough). write_settings runs every time a player leaves the game, or on shutdown:

Code: Select all

minetest.register_on_leaveplayer(function(player)
  compassgps.write_settings()
  end)
minetest.register_on_shutdown(compassgps.write_settings)
I'm not certain what in the compassgps code would cause a crash trying to save env meta. Since compassgps.write_settings runs every time the server shuts down, its entirely possible that you experienced a crash unrelated to compassgps which caused the server to shut down, which triggered the compassgps.write_settings function to run.

Could you send me an excerpt from your debug file for around the crash (with at least 50 lines above and below the crash itself please).

again, thank you very much for the report and I appreciate your time and effort in helping me track down the problem.

User avatar
LazerRay
Member
Posts: 147
Joined: Sun Jul 27, 2014 01:32
GitHub: LazerRay

Re: [Mod] Compass GPS [compassgps]

by LazerRay » Post

The bug seems to occur at random times, weather I'm building something, checking a crafting guide, or using an item with an inventory. I don't have the compass crafted yet, I'm just getting things set up before exploring and mining.

After restarting the game things work fine until the next crash, then nothing responds again (unable to open inventories, can't place or break blocks/nodes, interactive items stop working).

I've included the debug text from the last instance that crashed, there is nothing after the "compassgps writing settings" line since everything but player movement stopped working.

Code: Select all

21:11:58: ACTION[main]: [MOD]craft_guide -- loaded from C:\Users\Raymond\Documents\Game Mods\Minetest\minetest-0.4.10\bin\..\mods\craft_guide\craft_guide
[UnifiedDyes] Loaded!
[treecapitator] loaded after ca. 0.00s
compasgps reading bookmarks
compasgps reading settings
[Plantlife Library] Loaded
[Vines] Loaded!
[Moretrees] Loaded (2013-02-11)
[Poison Ivy] Loaded.
[Flowers] Loaded.
[OK] Mesecons
[buildtest] Mod loaded!
Pipeworks loaded!
Registered default:fence_wood and signs:sign_post
[Mod]Inbox Loaded!
Registered homedecor:fence_brass and homedecor:fence_brass_with_sign
Registered homedecor:fence_wrought_iron and homedecor:fence_wrought_iron_with_sign
[HomeDecor] Loaded!
[Bushes] Loaded.
21:11:59: ACTION[main]: [MOD]inventory_plus -- loaded from C:\Users\Raymond\Documents\Game Mods\Minetest\minetest-0.4.10\bin\..\mods\minetest-inventory_plus-master\inventory_plus
21:12:01: ACTION[main]:         .__               __                   __   
21:12:01: ACTION[main]:   _____ |__| ____   _____/  |_  ____   _______/  |_ 
21:12:01: ACTION[main]:  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
21:12:01: ACTION[main]: |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  |  
21:12:01: ACTION[main]: |__|_|  /__|___|  /\___  >__|  \___  >____  > |__|  
21:12:01: ACTION[main]:       \/        \/     \/          \/     \/        
21:12:01: ACTION[main]: World at [C:\Users\Raymond\Documents\Game Mods\Minetest\minetest-0.4.10\bin\..\worlds\Peaceful Retreat]
21:12:01: ACTION[main]: Server for gameid="minetest" listening on 0.0.0.0:62669.
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Malformed iTXt chunk
Irrlicht log: PNG warning: Interlace handling should be turned on when using png_read_image
Irrlicht log: PNG warning: Malformed iTXt chunk
21:12:15: ERROR[main]: generateImage(): Could not load image "buildtest_assembly.png" while building texture
21:12:15: ERROR[main]: generateImage(): Creating a dummy image for "buildtest_assembly.png"
21:12:15: ERROR[main]: generateImage(): Could not load image "buildtest_laser_top.png" while building texture
21:12:15: ERROR[main]: generateImage(): Creating a dummy image for "buildtest_laser_top.png"
21:12:15: ERROR[main]: generateImage(): Could not load image "buildtest_laser.png" while building texture
21:12:15: ERROR[main]: generateImage(): Creating a dummy image for "buildtest_laser.png"
21:15:12: ACTION[ServerThread]: singleplayer [127.0.0.1] joins game. 
Irrlicht log: Could not open file of texture: 21:15:12: ACTION[ServerThread]: singleplayer joins game. List of players: singleplayer

Irrlicht log: Could not open file of texture: 
Irrlicht log: Could not open file of texture: 
Irrlicht log: Could not open file of texture: 
Font size: 8 17
Irrlicht log: Could not open file of texture: character.png
Irrlicht log: Could not open file of texture: sheep.png
Irrlicht log: Could not open file of texture: UV_rat.png
Irrlicht log: Could not open file of texture: sheep.png
21:15:21: ACTION[ServerThread]: singleplayer places node xpanes:pane at (-21,5,27)
21:15:22: ACTION[ServerThread]: singleplayer places node xpanes:pane at (-21,5,26)
21:15:33: ACTION[ServerThread]: singleplayer digs default:junglewood at (-29,5,32)
21:15:36: ACTION[ServerThread]: singleplayer digs default:junglewood at (-29,5,31)
21:15:39: ACTION[ServerThread]: singleplayer digs default:junglewood at (-29,5,30)
21:15:45: ACTION[ServerThread]: singleplayer places node xpanes:pane at (-29,5,32)
21:15:45: ACTION[ServerThread]: singleplayer places node xpanes:pane at (-29,5,31)
21:15:46: ACTION[ServerThread]: singleplayer places node xpanes:pane at (-29,5,30)
21:16:00: ACTION[ServerThread]: singleplayer digs default:junglewood at (-29,5,26)
21:16:00: ACTION[ServerThread]: singleplayer digs default:junglewood at (-29,5,27)
21:16:00: ACTION[ServerThread]: singleplayer digs default:junglewood at (-29,5,28)
21:16:09: ACTION[ServerThread]: singleplayer places node xpanes:pane at (-29,5,26)
21:16:10: ACTION[ServerThread]: singleplayer places node xpanes:pane at (-29,5,27)
21:16:10: ACTION[ServerThread]: singleplayer places node xpanes:pane at (-29,5,28)
21:16:30: ACTION[ServerThread]: singleplayer moves stuff to chest at (-22,3,26)
21:16:36: ACTION[ServerThread]: singleplayer moves stuff to chest at (-22,3,28)
21:17:04: ACTION[ServerThread]: singleplayer moves stuff to chest at (-22,3,28)
21:17:06: ACTION[ServerThread]: singleplayer moves stuff to chest at (-22,3,28)
21:17:58: ERROR[ServerThread]: ERROR: An unhandled exception occurred: Couldn't save env meta
compassgps writing settings

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

LazerRay wrote: I don't have the compass crafted yet, I'm just getting things set up before exploring and mining.
Yep. I really think that what is happening is that something else is crashing.
If you don't have a compassgps crafted, then the compassgps doesn't DO anything except at load (loading settings) and shutdown (saving settings) You are crashing between those two. When you crash, the shutdown automatically triggers compassgps to try and save its settings (because of the register_on_shutdown I posted above)

Try this: Remove the compassgps mod (you aren't using it yet anyway) and see if the error still happens. I'm betting it will. And when it does, you'll get the same "Couldn't save env meta" error, but it won't be followed by a "compassgps writing settings" message anymore.

Of course, that will just prove the error is in a different mod, it won't clarify which. But it's a start.
One more thing to do, edit your minetest.conf and add debug_log_level = 4
That may give you more displays which might help clarify where the problem is.

User avatar
LazerRay
Member
Posts: 147
Joined: Sun Jul 27, 2014 01:32
GitHub: LazerRay

Re: [Mod] Compass GPS [compassgps]

by LazerRay » Post

You're right about the compass is not causing the crash, I think I found a possible cause in the debug text.

I get "INFO[ServerThread]: ServerEnvironment::saveMeta(): Failed to write C:\Users\Raymond\Documents\Game Mods\Minetest\minetest-0.4.10\bin\..\worlds\Peaceful Retreat\env_meta.txt" just before the "ERROR[ServerThread]: ERROR: An unhandled exception occurred: Couldn't save env meta" message, I'm hoping that there is a fix for this.

I'm attaching a copy of the debug text file to this post, incase there is more to the issue (the crash message is at lines 66346 and 66347 while using Notepad++)
Attachments
debug.zip
The text file is inside the ZIP
(442.06 KiB) Downloaded 75 times

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

yep, that looks like it to me. but I still don't understand what is trying to write to env_meta and crashing.
I would suggest posting this in the bugs forum.

Compassgps just writes its settings when the sever closes, so it will often be the last thing in the debug log after a crash.

Thank you for the research on this!

User avatar
LazerRay
Member
Posts: 147
Joined: Sun Jul 27, 2014 01:32
GitHub: LazerRay

Re: [Mod] Compass GPS [compassgps]

by LazerRay » Post

Looks like I'm not the only one who is getting the issue with env_meta failing to save, I found a bug report from another peson who is also getting the bug, sadly no one has posted a posible fix for it yet.

Tril
New member
Posts: 5
Joined: Fri Sep 12, 2014 16:22

Re: [Mod] Compass GPS [compassgps]

by Tril » Post

Hello,

Thank you for making this mod. I have a bug with multiplayer with latest Minetest.
The first time I left click while holding a compass on my server, I get the below server crash.
After the server restarts, using the compass works (to bring up the dialog box). Deleting compassgps_settings from the server's world directory causes the crash again.

Code: Select all

17:45:28: ACTION[ServerThread]: player Tril crafts compassgps:1
17:45:40: ACTION[ServerThread]: Tril uses compassgps:3, pointing at [nothing]
compassgps writing settings
17:45:41: ERROR[main]: ERROR: An unhandled exception occurred: /home/mine/.minetest/mods/compassgps/init.lua:1130: attempt to concatenate field '?' (a nil value)
17:45:41: ERROR[main]: stack traceback:
17:45:41: ERROR[main]:  /home/mine/.minetest/mods/compassgps/init.lua:1130: in function 'get_compassgps_formspec'
17:45:41: ERROR[main]:  /home/mine/.minetest/mods/compassgps/init.lua:1191: in function </home/mine/.minetest/mods/compassgps/init.lua:1
188>

In thread 7fc9dc9ee740:
/home/tril/src/minetest/src/main.cpp:1955: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 7fc9dc9ee740:
#0  int main(int, char**)
(Leftover data: #1  Dedicated server branch)
(Leftover data: #2  virtual void ServerMap::save(ModifiedState))
(Leftover data: #3  void ItemStack::serialize(std::ostream&) const)
Aborted

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: [Mod] Compass GPS [compassgps]

by Kilarin » Post

Thanks for trying the mod, and thanks for the bug report.
Is your init.lua modified in any way from the orginal? I'm trying to make certain I'm looking at the same line numbers that are in your debug output.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bombuzal and 21 guests