[Mod] Geocaching [geocache]

User avatar
JoshMars
Member
 
Posts: 106
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

[Mod] Geocaching [geocache]

by JoshMars » Tue Dec 22, 2015 15:49

Really simple mod, adds an owned geocache block.

Any player can:
  • Right click block to view log.
  • Punch to sign log.

Image

Image
Download:
http://joshmars.net/minetest/geocache.tar.gz
License:WTFPL
Dependencies: None.
Last edited by JoshMars on Thu Dec 29, 2016 15:45, edited 4 times in total.
 

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

Re: [Mod] Geocaching [geocache]

by twoelk » Tue Dec 22, 2015 22:41

hehe, a "been there, done that" block

on the Landrush server on Mt Meru there is a sign that people have added their names to upon reaching the peak. Nice to see a mod following the same idea. Could be an interesting block to have in an achievement system.
 

User avatar
rubenwardy
Moderator
 
Posts: 5455
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Geocaching [geocache]

by rubenwardy » Tue Dec 22, 2015 22:53

It would be nice to see the times, and also to sort it as most recent first.
 

User avatar
JoshMars
Member
 
Posts: 106
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Geocaching [geocache]

by JoshMars » Wed Dec 23, 2015 02:31

rubenwardy wrote:It would be nice to see the times, and also to sort it as most recent first.

Is there a way to get timestamp from minetest?

As for sorting, I guess it would make sense for it to show recent first by default.
 

User avatar
JoshMars
Member
 
Posts: 106
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Geocaching [geocache]

by JoshMars » Wed Dec 23, 2015 02:38

Most recent is now listed first by default. I will make it toggleable later.
 

User avatar
rubenwardy
Moderator
 
Posts: 5455
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Geocaching [geocache]

by rubenwardy » Wed Dec 23, 2015 20:08

You don't get it from Minetest, you get it from Lua's os.date. A real life time stamp is much more readable than a in game timestamp.

Code: Select all
local date_str = os.date("%Y-%m-%d %H:%M")


will give something like "2015-12-23 20:06". That's the current time.

To show instead something like "100 Minetest Days ago", which I don't recommend, use minetest.get_gametime() or something, and store the game time with the signature, then make the strings when showing the formspec. Be warned that get_gametime() isn't reliable and is liable to being reset (eg: when env_meta.txt is corrupted, which happens a lot)

EDIT: I forgot to say, this is a cool idea and a nice mod.
 

User avatar
JoshMars
Member
 
Posts: 106
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Geocaching [geocache]

by JoshMars » Fri Dec 25, 2015 03:34

Added timestamp (thanks rubenwardy).
Example : "belinda on Dec 24 2015 10:30 PM"
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 2 guests