mimilus wrote:It could be cool to have a turning image in the hud when the mouse is over for nodeboxes, and the same thing in the inventory.
10:38 //Ingame time, for 24h or "10:38 AM" for 12h time
Next sunset in: 5:25 //M:SS realtime
cactuz_pl wrote:Minetest time of day, in debug mode (or in HUD, in one of the corners). Optionaly time to next sunrise/sunset.10:38 //Ingame time, for 24h or "10:38 AM" for 12h time
Next sunset in: 5:25 //M:SS realtime
This would be very handy when you are waitnig for daylight. I know this can't be done by any mod and this is possible only by editing source files. What do you think about this?
local player_hud = { };
local timer = 0;
local function floormod ( x, y )
return (math.floor(x) % y);
end
local function get_time ( )
local secs = (60*60*24*minetest.env:get_timeofday());
local s = floormod(secs, 60);
local m = floormod(secs/60, 60);
local h = floormod(secs/3600, 60);
if ((minetest.env:get_timeofday()) >= (0.198)) then
time_to_sunrise = ((0.198*86400/72) + ((86400-(86400*minetest.env:get_timeofday()))/72));
else
time_to_sunrise = ((0.198*86400/72)-((60*60*24*minetest.env:get_timeofday())/72));
end
-- time to next sunrise in real-time seconds, 0.198 is time of sunrise in 0..1 range, 72" is world time speed const;
local a = floormod(time_to_sunrise, 60);
local b = floormod(time_to_sunrise/60, 60);
local c = floormod(time_to_sunrise/3600, 60);
return ("Time: %02d:%02d:%02d Next sunrise in: %02d:%02d:%02d"):format(h, m, s, c, b, a); --return ("%02d:%02d:%02d"):format(h, m, s);
end
minetest.register_globalstep(function ( dtime )
timer = timer + dtime;
if (timer >= 1.0) then
timer = 0;
for _,p in ipairs(minetest.get_connected_players()) do
local name = p:get_player_name();
local h = p:hud_add({
hud_elem_type = "text";
position = {x=0.35, y=0.900}; --position = {x=0.35, y=0.900};
text = get_time();
number = 0xFFFF00; --colour
});
if (player_hud[name]) then
p:hud_remove(player_hud[name]);
end
player_hud[name] = h;
end
end
end);cactuz_pl wrote:Thanks, kaeza!
Edit: I did it! It took me 2 hours. I know you could do it in 5 minutes but programming is something new for me. This code looks very ugly and bad, I'm noob. The most important thing is that this is working! (It shows time to next sunrise.) Thanks for code again, kazea.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_hud = { };
local timer = 0;
local function floormod ( x, y )
return (math.floor(x) % y);
end
local function get_time ( )
local secs = (60*60*24*minetest.env:get_timeofday());
local s = floormod(secs, 60);
local m = floormod(secs/60, 60);
local h = floormod(secs/3600, 60);
if ((minetest.env:get_timeofday()) >= (0.198)) then
time_to_sunrise = ((0.198*86400/72) + ((86400-(86400*minetest.env:get_timeofday()))/72));
else
time_to_sunrise = ((0.198*86400/72)-((60*60*24*minetest.env:get_timeofday())/72));
end
-- time to next sunrise in real-time seconds, 0.198 is time of sunrise in 0..1 range, 72" is world time speed const;
local a = floormod(time_to_sunrise, 60);
local b = floormod(time_to_sunrise/60, 60);
local c = floormod(time_to_sunrise/3600, 60);
return ("Time: %02d:%02d:%02d Next sunrise in: %02d:%02d:%02d"):format(h, m, s, c, b, a); --return ("%02d:%02d:%02d"):format(h, m, s);
end
minetest.register_globalstep(function ( dtime )
timer = timer + dtime;
if (timer >= 1.0) then
timer = 0;
for _,p in ipairs(minetest.get_connected_players()) do
local name = p:get_player_name();
local h = p:hud_add({
hud_elem_type = "text";
position = {x=0.35, y=0.900}; --position = {x=0.35, y=0.900};
text = get_time();
number = 0xFFFF00; --colour
});
if (player_hud[name]) then
p:hud_remove(player_hud[name]);
end
player_hud[name] = h;
end
end
end);
local player_hud = {}
local timer = 0
local function floormod(x, y)
return math.floor(x) % y
end
local function get_time()
local time = minetest.get_timeofday()
local secs = (60*60*24*time)
local s = floormod(secs, 60)
local m = floormod(secs/60, 60)
local h = floormod(secs/3600, 60)
local time_to_sunrise
if (time >= (0.198)) then
time_to_sunrise = 1200*(1.198 - time)
else
time_to_sunrise = 1200*(0.198 - time)
end
-- time to next sunrise in real-time seconds, 0.198 is time of sunrise in 0..1 range, 72" is world time speed const;
local a = floormod(time_to_sunrise, 60)
local b = floormod(time_to_sunrise/60, 60)
local c = floormod(time_to_sunrise/3600, 60)
return ("Time: %02d:%02d:%02d Next sunrise in: %02d:%02d:%02d"):format(h, m, s, c, b, a) --return ("%02d:%02d:%02d"):format(h, m, s);
end
minetest.register_globalstep(function(dtime)
timer = timer + dtime
if (timer >= 1.0) then
timer = 0
for _,p in pairs(minetest.get_connected_players()) do
local name = p:get_player_name()
local h = p:hud_add({
hud_elem_type = "text";
position = {x=0.35, y=0.900}; --position = {x=0.35, y=0.900};
text = get_time();
number = 0xFFFF00; --colour
})
if player_hud[name] then
p:hud_remove(player_hud[name])
end
player_hud[name] = h
end
end
end)Wuzzy wrote:I would like to see a reverse crafting guide.
Wuzzy wrote:I would like to see a reverse crafting guide.
A reverse crafting guide is a crafting guide. But it is not an ordinary one. Instead of providing you all recipes at once by selecting your desired result item, the user has to supply an item he/she/it has in posession as input. The reverse crafting guide then returns all the recipes which require this item. This ought to be the only way to get to know crafting recipes from the reverse crafting guide.
The benefit of this would be:
- The reverse crafting guide would not be a massive spoiler like the known crafting guides which disclose the best recipes and even items right from the start.
- The player may feel a sense of progression.
- Probably it is easier to use because the result lists would be smaller.
kerikter4of7 wrote:If we had a consolidated wiki for all the mods,
philipbenr wrote:Gambit wrote:Quicksand. We need it to make the desert a bit more adventurous/dangerous. You should be able to drown in it too. In some cases, the player could even sink through quicksand into a hidden cavern. From what I've can tell, there is no quicksand mod through out the entire forum; unless I've missed it.
Quite right. I've browsed 80& of modding general.
Quicksand
Bas080 wrote:So moving allot in quicksand makes you sink even faster. My suggestion is as follows.
player physics can be manipulated with the api. I say not moving will not make you sink. The faster you move the quicker you'll sink. Avoiding death means placing nodes beneath you (nerd poling). I guess that would be a start. For realism it would be cool to be able to pull yourself out by using a climable node. If that is possible then nerd poling should not be.
Related to this discussion: viewtopic.php?f=5&t=9244jp wrote:Enable pasting links/text in the chat. The URLs could be automatically "linkable" to web browser.
asd789 wrote:Could somebody make a mod, where are some blocks you can steer in the water (just like boats, but to build with)?
It would be very cool and allow to build driving sail ships or so.
Users browsing this forum: No registered users and 7 guests