Tweak fog effect, add puddle variants, imrove frost HUD

This commit is contained in:
Till Affeldt 2020-04-24 01:36:58 +02:00
parent 32ab2c4d23
commit 677382c142
50 changed files with 174 additions and 69 deletions

View File

@ -15,7 +15,7 @@ You can find respective rights and conditions in the attached [LICENSE](https://
The entire source code is available on [Github](https://github.com/t-affeldt/regional_weather).
### Particles
- Hail textures: *CC BY-SA (4.0)* made by me
- Hail textures: *CC BY-SA (3.0)* made by me
- Snow flake textures: *CC BY-SA (3.0)* by paramat, found in snowdrift mod at https://github.com/paramat/snowdrift
- Snow composite texture: *CC BY-SA (3.0)* by Piet Affeldt, created from aforementioned snow flakes by paramat (please credit original artist as well)
- Rain textures: *CC BY-SA (3.0)* by Piet Affeldt (an original design for this mod)
@ -31,11 +31,11 @@ The entire source code is available on [Github](https://github.com/t-affeldt/reg
- Hail sound: *CC0* by ikayuka from https://freesound.org/people/ikayuka/sounds/240742/
### HUD Overlays
- Original texture for frost hud: *CC0* by Simon Matzinger from https://freestocktextures.com/texture/winter-snow-frozen,995.html, edits by me under *CC0* as well
- Original texture for sandstorm hud: *CC0* from https://freestocktextures.com/texture/dirty-baking-paper,1202.html, edits by me under *CC0* as well
- Frost HUD: *CC BY-SA (3.0)* by Piet Affeldt
- Original texture for sand storm HUD: *CC0* from https://freestocktextures.com/texture/dirty-baking-paper,1202.html, edits by me under *CC0* as well
### Assets in screenshots
- All screenshots and editing by me: *CC BY-SA (4.0)*
- All screenshots and editing by me: *CC BY-SA (3.0)*
- Lato Font (for the Logo): *OFL* by Łukasz Dziedzic from http://www.latofonts.com/lato-free-fonts/
- Liberation Fonts (for the text): *OFL*, see https://github.com/liberationfonts/liberation-fonts
- Used texture pack: Polygonia (128px edition) *CC BY-SA (4.0)* by Lokrates. See https://forum.minetest.net/viewtopic.php?f=4&t=19043

View File

@ -6,6 +6,7 @@ climate_api.register_abm({
nodenames = { "fire:basic_flame" },
interval = 10,
chance = 2,
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,

View File

@ -27,6 +27,7 @@ climate_api.register_abm({
neighbors = { "air" },
interval = 10,
chance = 2,
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,
@ -46,6 +47,7 @@ climate_api.register_abm({
neighbors = { "air" },
interval = 15,
chance = 4,
catch_up = true,
conditions = {
min_height = regional_weather.settings.min_height,

View File

@ -1,13 +1,13 @@
-- code of this file is partially taken from and otherwise inspired by
-- mymonths on https://github.com/minetest-mods/mymonths (licensed under DWYWPL)
-- contributers available at https://github.com/minetest-mods/mymonths/graphs/contributors
-- all changes of mine remain under LGPL v3
local BLOCK_NAME = "regional_weather:puddle"
local MIN_DISTANCE = 12
local BLOCK_PREFIX = "regional_weather:puddle_"
local VARIANT_COUNT = 30
local MIN_DISTANCE = 2
if not regional_weather.settings.puddles then
minetest.register_alias(BLOCK_NAME, "air")
for i=1,VARIANT_COUNT do
for r=0,270,90 do
minetest.register_alias(BLOCK_PREFIX .. i .. "_" .. r, "air")
end
end
return
end
@ -16,27 +16,59 @@ local node_box = {
fixed = {-0.5, -0.5, -0.5, 0.5, -0.49, 0.5}
}
minetest.register_node(BLOCK_NAME, {
tiles = { "weather_puddle.png" },
drawtype = "nodebox",
pointable = false,
buildable_to = true,
floodable = true,
walkable = false,
sunlight_propagates = true,
paramtype = "light",
use_texture_alpha = true,
node_box = node_box,
groups = {
not_in_creative_inventory = 1,
crumbly = 3,
attached_node = 1,
slippery = 1,
flora = 1,
water = 1
},
drop = "",
})
for i = 1,VARIANT_COUNT do
for rotation = 0,270,90 do
for flip = 0,1 do
local name = BLOCK_PREFIX .. i .. "_" .. rotation
local texture = "weather_puddle." .. i .. ".png^[opacity:128"
if flip == 1 or rotation > 0 then
texture = texture .. "^[transform"
end
if flip == 1 then
name = name .. "_flipped"
texture = texture .. "FX"
end
if rotation > 0 then
texture = texture .. "R" .. rotation
end
minetest.register_node(name, {
tiles = { texture },
drawtype = "nodebox",
pointable = false,
buildable_to = true,
floodable = true,
walkable = false,
sunlight_propagates = true,
paramtype = "light",
use_texture_alpha = true,
node_box = node_box,
groups = {
not_in_creative_inventory = 1,
crumbly = 3,
attached_node = 1,
slippery = 1,
flora = 1,
water = 1,
regional_weather_puddle = 1
},
drop = "",
})
end
end
end
minetest.register_alias("regional_weather:puddle", BLOCK_PREFIX .. "14_0")
local function get_random_puddle()
local index = math.random(1, VARIANT_COUNT)
local rotation = math.random(0, 3) * 90
local flip = math.random(0, 1)
local name = BLOCK_PREFIX .. index .. "_" .. rotation
if flip == 1 then
name = name .. "_flipped"
end
return name
end
-- Makes Puddles when raining
climate_api.register_abm({
@ -45,6 +77,7 @@ climate_api.register_abm({
neighbors = { "air" },
interval = 10,
chance = 50,
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,
@ -60,17 +93,19 @@ climate_api.register_abm({
action = function (pos, node, env)
if minetest.get_node(pos).name ~= "air" then return end
if minetest.find_node_near(pos, MIN_DISTANCE, BLOCK_NAME) then return end
minetest.set_node(pos, {name = BLOCK_NAME})
if minetest.find_node_near(pos, MIN_DISTANCE, "group:regional_weather_puddle") then return end
local puddle_name = get_random_puddle()
minetest.set_node(pos, {name = puddle_name})
end
})
-- Makes puddles dry up when not raining
climate_api.register_abm({
label = "remove rain puddles",
nodenames = { BLOCK_NAME },
nodenames = { "group:regional_weather_puddle" },
interval = 5,
chance = 5,
catch_up = true,
action = function (pos, node, env)
if env.humidity < 55 then
@ -79,4 +114,4 @@ climate_api.register_abm({
minetest.set_node(pos, {name = "regional_weather:snow_cover_1"})
end
end
})
})

View File

@ -1,8 +1,3 @@
-- code of this file is partially taken from and otherwise inspired by
-- mymonths on https://github.com/minetest-mods/mymonths (licensed under DWYWPL)
-- contributers available at https://github.com/minetest-mods/mymonths/graphs/contributors
-- all changes of mine remain under LGPL v3
local BLOCK_PREFIX = "regional_weather:snow_cover_"
if not minetest.get_modpath("default")
@ -66,7 +61,8 @@ climate_api.register_abm({
},
neighbors = { "air" },
interval = 15,
chance = 20,
chance = 30,
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,
@ -100,7 +96,8 @@ climate_api.register_abm({
"group:regional_weather_snow_cover"
},
interval = 15,
chance = 15,
chance = 25,
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,
@ -125,6 +122,7 @@ climate_api.register_abm({
nodenames = { "group:regional_weather_snow_cover" },
interval = 15,
chance = 10,
catch_up = true,
conditions = {
min_heat = 30

View File

@ -7,6 +7,7 @@ if farming ~= nil and farming.mod == "redo" then
nodenames = { "farming:soil" },
interval = 8,
chance = 2,
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,
@ -27,6 +28,7 @@ else
nodenames = { "group:field" },
interval = 8,
chance = 2,
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,

View File

@ -7,9 +7,9 @@ local function generate_effects(params)
local override = {}
local wind = climate_api.environment.get_wind()
local skybox = {priority = 0}
local skybox = {priority = 10}
skybox.cloud_data = {
density = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98),
density = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.75),
speed = vector.multiply(wind, CLOUD_SPEED),
thickness = climate_api.utility.rangelim(params.base_humidity * 0.2, 1, 18)
}
@ -29,7 +29,7 @@ local function generate_effects(params)
}
end
--override["climate_api:skybox"] = skybox
override["climate_api:skybox"] = skybox
local movement = params.player:get_player_velocity()
local movement_direction

View File

@ -1,20 +1,24 @@
local name = "regional_weather:fog"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_humidity = 40,
max_humidity = 50,
max_windspeed = 2,
min_heat = 40,
max_heat = 50
}
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_fog.png",
z_index = -200
}
effects["climate_api:skybox"] = {
sky_data = {
clouds = true
},
cloud_data = {
density = 1,
color = "#ffffffff",
color = "#ffffff00",
thickness = 40,
speed = {x=0,y=0,z=0}
},
@ -25,7 +29,7 @@ local function generate_effects(params)
local override = {}
override["climate_api:skybox"] = {
cloud_data = {
height = params.player:get_pos().y
height = params.player:get_pos().y - 20
}
}
return climate_api.utility.merge_tables(effects, override)

31
ca_weathers/fog_heavy.lua Normal file
View File

@ -0,0 +1,31 @@
local name = "regional_weather:fog_heavy"
local conditions = {
min_height = regional_weather.settings.min_height * 0.9,
max_height = regional_weather.settings.max_height * 0.9,
min_humidity = 43,
max_humidity = 47,
max_windspeed = 1.5,
min_heat = 43,
max_heat = 47
}
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_fog.png^[opacity:100",
z_index = -200
}
effects["climate_api:skybox"] = {
sky_data = {
type = "plain",
base_color = "#c0c0c08f"
},
cloud_data = {
color = "#ffffffc0",
},
priority = 51
}
climate_api.register_weather(name, conditions, effects)

View File

@ -36,11 +36,12 @@ local effects = {}
effects["climate_api:particles"] = {
min_pos = {x=-12, y=-4, z=-12},
max_pos = {x= 12, y= 1, z= 12},
falling_speed=-0.1,
amount=1,
exptime=5,
size=0.8,
texture="weather_pollen.png"
falling_speed = -0.1,
acceleration = {x=0,y=-0.03,z=0},
amount = 1,
exptime = 5,
size = 0.8,
texture = "weather_pollen.png"
}
climate_api.register_weather(name, conditions, effects)

View File

@ -43,6 +43,11 @@ effects["climate_api:particles"] = {
}
effects["climate_api:skybox"] = {
sky_data = {
type = "plain",
base_color = "#f7e4bfff",
clouds = true,
},
cloud_data = {
density = 1,
color = "#f7e4bfc0",
@ -53,12 +58,13 @@ effects["climate_api:skybox"] = {
}
local function generate_effects(params)
local override = table.copy(effects)
local override = {}
override["climate_api:skybox"] = {
cloud_data= {
height = params.player:get_pos().y
height = params.player:get_pos().y - 20
}
}
override = climate_api.utility.merge_tables(effects, override)
if params.daylight < 15 then
local result = {}
result["climate_api:skybox"] = override["climate_api:skybox"]

View File

@ -11,7 +11,7 @@ local conditions = {
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_ice.png",
file = "weather_hud_frost.png",
z_index = -100
}

View File

@ -34,7 +34,8 @@ end
-- import individual weather types
dofile(modpath.."/ca_weathers/ambient.lua")
dofile(modpath.."/ca_weathers/deep_cave.lua")
--dofile(modpath.."/ca_weathers/fog.lua")
dofile(modpath.."/ca_weathers/fog.lua")
dofile(modpath.."/ca_weathers/fog_heavy.lua")
dofile(modpath.."/ca_weathers/hail.lua")
dofile(modpath.."/ca_weathers/pollen.lua")
dofile(modpath.."/ca_weathers/rain.lua")

BIN
screenshot.2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
screenshot.3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 KiB

BIN
screenshot.4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 KiB

View File

@ -1,7 +1,31 @@
regional_weather_damage (Storms and hail cause damage to players) bool true
regional_weather_snow_layers (Place snow layers on ground) bool true
regional_weather_puddles (Place rain puddles on ground) bool true
regional_weather_soil (Turn farmland wet during rain) bool true
regional_weather_fire (Extinguish fire during rain) bool true
[Features]
# If set to true, sand storms and hail will damage affected players over time.
regional_weather_damage (Cause player damage) bool true
# If set to true, snow layers will stack up during snowy weather.
regional_weather_snow_layers (Place snow layers) bool true
# If set to true, river water sources will freeze at low temperatures and melt when it gets warmer again.
# This process does not affect regular ice blocks because it adds its own temporary ones.
regional_weather_ice (Freeze river water) bool true
# If set to true, water puddles will form during rain or when snow layers have melted.
regional_weather_puddles (Place rain puddles) bool true
# If set to true, rain will cause dry farmland to turn wet.
regional_weather_soil (Hydrate farmland) bool true
# If set to true, fires will be extinguished during rain showers.
regional_weather_fire (Extinguish fire) bool true
[World Configuration]
# No visual effects will be applied above this height.
# This value defaults to normal cloud height (120 nodes above sea level).
regional_weather_max_height (Maximum height of weather effects) int 120
# No visual effects will be applied below this height.
# This will prevent unwanted visuals within large underground caves.
regional_weather_min_height (Minimum height of weather effects) int -50

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB