[Mod] worldtime mod [1.01] [worldtime]

Bad_Command_
Member
 
Posts: 30
Joined: Sat Jun 23, 2012 01:17

[Mod] worldtime mod [1.01] [worldtime]

by Bad_Command_ » Thu Jun 28, 2012 23:32

Hi, announcing the worldtime mod. The mod is on github.

The worldtime mod adds some time managment functionality to minetest. It adds no new blocks or objects or behaviors, but instead is a library that can be used by other mods.

Downloads:
Version 1.01
Version 1.00

License:
LGPL 2.1 for code
No media

See the github wiki page for information about how to use the mod.
Last edited by Bad_Command_ on Thu Jul 05, 2012 05:47, edited 1 time in total.
 

cy
Member
 
Posts: 31
Joined: Sun Jun 24, 2012 17:25

by cy » Fri Jun 29, 2012 06:51

I would recommend you use the "minetest.after" function instead of registering something to run every server step.

minetest.after(10,worldtime_timechange);

Also your module should use local functions and variables, and at the bottom return the interface for other modules to use it. (i.e. a get world time function)

Honestly it seems that using the lua "os.time()" function to get the current Unix time would be the best thing to do in this situation. Isn't the elapsed time for active block modifiers based on that, and not on length of server execution?
My PGP key is 61EF 2214 3FC8 1C13 0406 B327 CECE ED18 4398 7815
 

Bad_Command_
Member
 
Posts: 30
Joined: Sat Jun 23, 2012 01:17

by Bad_Command_ » Fri Jun 29, 2012 08:06

This mod intentionally does not use os.time. It uses ... world time. World time only progresses while the map is running. The real time clock keeps ticking when the world is closed; this does not.

World time progresses every server step because time progresses with every server step.

I'll look in to better encapsulation for a following version.
Last edited by Bad_Command_ on Fri Jun 29, 2012 08:14, edited 1 time in total.
 

Bad_Command_
Member
 
Posts: 30
Joined: Sat Jun 23, 2012 01:17

by Bad_Command_ » Thu Jul 05, 2012 05:48

Version 1.01 released. This update fixes possible floating point underflow problems.
Last edited by Bad_Command_ on Thu Jul 05, 2012 06:24, edited 1 time in total.
 

User avatar
sfan5-bot
Member
 
Posts: 35
Joined: Thu Mar 28, 2013 11:19

by sfan5-bot » Thu Mar 28, 2013 16:54

[EE] No Dependencies found


Please fix these Mistakes and report this post, a moderator will delete it
If you believe I have made a Mistake contact sfan5
 


Return to Old Mods

Who is online

Users browsing this forum: No registered users and 23 guests

cron