[Mod] Weather (Snow, Rain) [weather]

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

[Mod] Weather (Snow, Rain) [weather]

by Jeija » Post

Introducing: The weather mod (WIP)

Image
Image

At the moment it contains rain and snow. Snow will pile up if you uncomment a section in snow.lua where it says only for faster PCs.

It randomly starts and stops raining / snowing.
You can also manually control the precipitation using

Code: Select all

/setweather rain
/setweather snow
/setweather none
(requires weather privilege)

Download
as .zip | as .tar.gz

GitHub
Project page
Clone link

Make sure you are running the latest Git of Minetest and enable particles!

Dependencies: none
License:
  • Code: LGPL
  • Textures:
  • Snow cover: WTFPL
  • Rain / Snow: CC-BY-SA 3.0, credit goes to TeddyDesTodes, from his weather branch
Redstone for minetest: Mesecons (mesecons.net)

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

A little suggestion for snow:

Code: Select all

-- Snow cover
for i=1,8 do
    local snow_box =
    {
        type  = "fixed",
        fixed = {-0.5, -0.5, -0.5, 0.5, -0.5 + i/8., 0.5}
    }
    minetest.register_node("weather:snow_cover"..tostring(i), {
        tiles = {"weather_snow_cover.png"},
        drawtype = "nodebox",
        paramtype = "light",
        node_box = snow_box,
        selection_box = snow_box,
        groups = {not_in_creative_inventory = 1, crumbly = 3, attached_node = 1},
        drop = {}
    })
end

minetest.register_alias("weather:snow_cover","weather:snow_cover1")
--[[ Enable this section if you have a very fast PC]]
minetest.register_abm({
    nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"},
    neighbors = {"default:air"},
    interval = 10.0, 
    chance = 80,
    action = function (pos, node, active_object_count, active_object_count_wider)
        if weather == "snow" then
            if minetest.registered_nodes[node.name].drawtype == "normal"
            or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then
                local np = addvectors(pos, {x=0, y=1, z=0})
                if minetest.env:get_node_light(np, 0.5) == 15 and minetest.env:get_node(np).name=="air" then
                    minetest.env:add_node(np, {name="weather:snow_cover1"})
                end
            end
            local np = addvectors(pos, {x=0, y=1, z=0})
            if minetest.env:get_node_light(np, 0.5) == 15 then
                if node.name:find("weather:snow_cover")~=nil and node.name:sub(-1)~="8" then
                    minetest.env:set_node(pos,{name="weather:snow_cover"..tostring(1+tonumber(node.name:sub(-1)))})
                else
                    if minetest.env:get_node(np).name=="air" then
                        minetest.env:add_node(np, {name="weather:snow_cover1"})
                    end
                end
            end
        end
    end
})

The snow stacks, with 8 layers per node.
Last edited by Nore on Sun Mar 24, 2013 17:50, edited 1 time in total.

User avatar
snakevenom
Member
Posts: 119
Joined: Sat Sep 22, 2012 12:56
Location: worthing

by snakevenom » Post

my computer just had a heart attack

cool though
Last edited by snakevenom on Sun Mar 24, 2013 18:07, edited 1 time in total.

User avatar
Splizard
Member
Posts: 227
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard
Location: New Zealand
Contact:

by Splizard » Post

Can I modify this for snow mod (GPL3/later)?
Games: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

My code is WTFPL.
Last edited by Nore on Mon Mar 25, 2013 05:29, edited 1 time in total.

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

My code is LGPL, so yes, that's possible. But make sure you give credit to me and TeddyDesTodes.
Redstone for minetest: Mesecons (mesecons.net)

User avatar
Splizard
Member
Posts: 227
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard
Location: New Zealand
Contact:

by Splizard » Post

Jeija wrote:My code is LGPL, so yes, that's possible. But make sure you give credit to me and TeddyDesTodes.
Alright thanks.
Games: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

User avatar
Dopium
Member
Posts: 233
Joined: Sat Jun 09, 2012 15:43
Location: Australia

by Dopium » Post

Awesome this is what i been waiting for, too cool man.
+1

Edit: What to rename the folder to? I cant get it to work is same deal with animals aswell, none the other mods i use have this problem

debug: 20:14:52: ERROR[main]: Server: Failed to load and run C:\Documents and Settings\Dopium\Desktop\Latest Minetest 0.4.4 Complete With Mods Working\Minetest 0.4.5\minetest-0.4.5\bin\..\mods\minetest\weather\init.lua
20:14:52: ERROR[main]: ModError: Failed to load and run C:\Documents and Settings\Dopium\Desktop\Latest Minetest 0.4.4 Complete With Mods Working\Minetest 0.4.5\minetest-0.4.5\bin\..\mods\minetest\weather\init.lua
Last edited by Dopium on Mon Mar 25, 2013 09:57, edited 1 time in total.
Running @1.19 MHz, 128 bytes of RAM and interchangeable 4kb ROM carts!

rarkenin
Member
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Post

Dopium wrote:Awesome this is what i been waiting for, too cool man.
+1

Edit: What to rename the folder to? I cant get it to work is same deal with animals aswell, none the other mods i use have this problem

debug: 20:14:52: ERROR[main]: Server: Failed to load and run C:\Documents and Settings\Dopium\Desktop\Latest Minetest 0.4.4 Complete With Mods Working\Minetest 0.4.5\minetest-0.4.5\bin\..\mods\minetest\weather\init.lua
20:14:52: ERROR[main]: ModError: Failed to load and run C:\Documents and Settings\Dopium\Desktop\Latest Minetest 0.4.4 Complete With Mods Working\Minetest 0.4.5\minetest-0.4.5\bin\..\mods\minetest\weather\init.lua
Please post the error on the terminal window, below a line that says something like "Error from Lua:"
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.

User avatar
Dopium
Member
Posts: 233
Joined: Sat Jun 09, 2012 15:43
Location: Australia

by Dopium » Post

Says the same thing as the debug: ========== ERROR FROM LUA ===========
21:13:18: ERROR[main]: Failed to load and run script from
21:13:18: ERROR[main]: C:\Documents and Settings\Dopium\Desktop\Latest Minetest 0.4.4 Complete With Mods Working\Minetest 0.4.5\minetest-0.4.5\bin\..\mods\minetest\weather\init.lua:
21:13:18: ERROR[main]: ...minetest-0.4.5\bin\..\mods\minetest\weather\init.lua:6: I told you to run the latest GitHub!
21:13:18: ERROR[main]: stack traceback:
21:13:18: ERROR[main]: [C]: in function 'assert'
21:13:18: ERROR[main]: ...minetest-0.4.5\bin\..\mods\minetest\weather\init.lua:6: in main chunk
21:13:18: ERROR[main]: =======END OF ERROR FROM LUA ========
21:13:18: ERROR[main]: Server: Failed to load and run C:\Documents and Settings\Dopium\Desktop\Latest Minetest 0.4.4 Complete With Mods Working\Minetest 0.4.5\minetest-0.4.5\bin\..\mods\minetest\weather\init.lua
21:13:18: ERROR[main]: ModError: Failed to load and run C:\Documents and Settings\Dopium\Desktop\Latest Minetest 0.4.4 Complete With Mods Working\Minetest 0.4.5\minetest-0.4.5\bin\..\mods\minetest\weather\init.lua

Starting to pull my hair out over this i have changed the folder name many many times i have installed the sub directory still nothing. I really dont understand as i have installed 100's of mods before and the only 2 i have problems with is this and animals. Cant even see the difference these mods have to any others, doesnt matter if i use Adams builds either i get the same error. I know im over looking something simple but this is so frustrating
Running @1.19 MHz, 128 bytes of RAM and interchangeable 4kb ROM carts!

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
IRC: kaeza diemartin
In-game: kaeza diemartin
Contact:

by kaeza » Post

Dopium wrote:21:13:18: ERROR[main]: ...minetest-0.4.5\bin\..\mods\minetest\weather\init.lua:6: I told you to run the latest GitHub!
'nuff said
Your minetest is too old and does not have particle spawners.
EDIT: Ask PilzAdam to create a new build.
Last edited by kaeza on Mon Mar 25, 2013 10:54, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

User avatar
Dopium
Member
Posts: 233
Joined: Sat Jun 09, 2012 15:43
Location: Australia

by Dopium » Post

kaeza wrote:
Dopium wrote:21:13:18: ERROR[main]: ...minetest-0.4.5\bin\..\mods\minetest\weather\init.lua:6: I told you to run the latest GitHub!
'nuff said
Your minetest is too old and does not have particle spawners.
EDIT: Ask PilzAdam to create a new build.

Ok thanks for the help i did notice but thought Adams build was up to date, anyway i will ask, if not wait for 0.4.6. Thanks again.
Running @1.19 MHz, 128 bytes of RAM and interchangeable 4kb ROM carts!

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
IRC: kaeza diemartin
In-game: kaeza diemartin
Contact:

by kaeza » Post

Just tested this mod. It's pure Awesomeness™!
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

The build 57cbb8b-oregen contains the required functions.

User avatar
Dopium
Member
Posts: 233
Joined: Sat Jun 09, 2012 15:43
Location: Australia

by Dopium » Post

PilzAdam wrote:The build 57cbb8b-oregen contains the required functions.
Yes sorry about that, however i am getting dummy image errors with pressure plates and some the mescon items. I have enable_texture_atlas = false but still have errors. Bare with me im am still a bit of a newbie with coding anyway here is the debug:
21:56:38: ERROR[main]: generate_image(): Could not load image "jeija_pressure_plate_stone_off.png" while building texture
21:56:38: ERROR[main]: generate_image(): Creating a dummy image for "jeija_pressure_plate_stone_off.png"
21:56:38: ERROR[main]: generate_image(): Could not load image "mesecons_piston_pusher_front_sticky.png" while building texture
21:56:38: ERROR[main]: generate_image(): Creating a dummy image for "mesecons_piston_pusher_front_sticky.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_sides_off.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_sides_off.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_tjunction_tb_on.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_tjunction_tb_on.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_tjunction_tb_off.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_tjunction_tb_off.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_curved_tb_on.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_curved_tb_on.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_curved_tb_off.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_curved_tb_off.png"
Font size: 8 17

My mesecons mod too old?
Running @1.19 MHz, 128 bytes of RAM and interchangeable 4kb ROM carts!

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

Dopium wrote:
PilzAdam wrote:The build 57cbb8b-oregen contains the required functions.
Yes sorry about that, however i am getting dummy image errors with pressure plates and some the mescon items. I have enable_texture_atlas = false but still have errors. Bare with me im am still a bit of a newbie with coding anyway here is the debug:
21:56:38: ERROR[main]: generate_image(): Could not load image "jeija_pressure_plate_stone_off.png" while building texture
21:56:38: ERROR[main]: generate_image(): Creating a dummy image for "jeija_pressure_plate_stone_off.png"
21:56:38: ERROR[main]: generate_image(): Could not load image "mesecons_piston_pusher_front_sticky.png" while building texture
21:56:38: ERROR[main]: generate_image(): Creating a dummy image for "mesecons_piston_pusher_front_sticky.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_sides_off.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_sides_off.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_tjunction_tb_on.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_tjunction_tb_on.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_tjunction_tb_off.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_tjunction_tb_off.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_curved_tb_on.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_curved_tb_on.png"
21:56:39: ERROR[main]: generate_image(): Could not load image "jeija_insulated_wire_curved_tb_off.png" while building texture
21:56:39: ERROR[main]: generate_image(): Creating a dummy image for "jeija_insulated_wire_curved_tb_off.png"
Font size: 8 17

My mesecons mod too old?
This happens if the textures dont exist. Maybe redownload mesecons.

User avatar
Dopium
Member
Posts: 233
Joined: Sat Jun 09, 2012 15:43
Location: Australia

by Dopium » Post

I re-downloaded mesecons but unfortunately still getting the same errors, could this have something to do with my OS? Edit: ok so now i have a really weird bug or something, i have noticed as soon as a install messecons to your build it changes the texture names. For example the mesecon torch on ground when intalled to the build is named JE2BEE~1. The weird part is im copy and pasting the mod and before installing its called jeija_torches_on. If i change the texture names it still doesnt recognize the item. I have no idea why this happens its got me stumped
Last edited by Dopium on Mon Mar 25, 2013 12:17, edited 1 time in total.
Running @1.19 MHz, 128 bytes of RAM and interchangeable 4kb ROM carts!

User avatar
Gabriele
Member
Posts: 19
Joined: Fri Mar 15, 2013 20:48

by Gabriele » Post

Nice work ;)

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
IRC: kaeza diemartin
In-game: kaeza diemartin
Contact:

by kaeza » Post

Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

User avatar
jordan4ibanez
Member
Posts: 1926
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

I had an awesome idea
[18:40:55] <jordan4ibanez> the rain and snow mod
[18:40:58] <jordan4ibanez> that can be improved!
[18:41:10] <jordan4ibanez> air can be mapgen aliased to weather block
[18:41:30] <jordan4ibanez> weather block can be an abm, if there is a block above it, it becomes air
[18:41:50] <jordan4ibanez> if there is air above a weather block it becomes air
[18:42:04] <jordan4ibanez> it doesn't have to be an abm, but called on_block_update or something
gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble gobble

User avatar
Ragnarok
Member
Posts: 217
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

by Ragnarok » Post

Jeija! This is amazing! =)

Matsetes
Member
Posts: 70
Joined: Tue Sep 11, 2012 23:36

by Matsetes » Post

Very good, I'll try that beautiful stuff!!!

User avatar
Traxie21
Member
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

Is it possible to make snow pile up from the particles instead of ABM's?

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

Traxie21 wrote:Is it possible to make snow pile up from the particles instead of ABM's?
No, there are no callbacks for particles to Lua to make them fast.

User avatar
Traxie21
Member
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

How about attaching particlespawners to entities?

Post Reply