mirror of
https://codeberg.org/tenplus1/ambience.git
synced 2024-12-25 02:00:28 +01:00
Added kilbiths smaller sounds and changed timings
This commit is contained in:
parent
2934b2700d
commit
fbb57432ee
@ -1,4 +1,9 @@
|
|||||||
# ambience
|
|
||||||
Ambience Lite mod for Minetest
|
Ambience Lite mod for Minetest
|
||||||
|
|
||||||
Based on Immersive Sounds .36 mod by Neuromancer and optimized to run on servers with new fire sounds added when Fire Redo mod is detected...
|
Based on Immersive Sounds .36 mod by Neuromancer and optimized to run on servers with new fire sounds added when Fire Redo mod is detected...
|
||||||
|
|
||||||
|
0.1 - Initial release
|
||||||
|
0.2 - Code change and new water sounds added
|
||||||
|
0.3 - Works with Fire Redo mod to provide fire sounds
|
||||||
|
0.4 - Code optimized
|
||||||
|
0.5 - Changed to kilbiths smaller sound files and removed canadianloon1, adjusted timings
|
||||||
|
31
init.lua
31
init.lua
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
--= Ambience lite by TenPlus1 (2nd March 2015)
|
--= Ambience lite by TenPlus1 (6th March 2015)
|
||||||
|
|
||||||
local max_frequency_all = 1000 -- larger number means more frequent sounds (100-2000)
|
local max_frequency_all = 1000 -- larger number means more frequent sounds (100-2000)
|
||||||
local SOUNDVOLUME = 1
|
local SOUNDVOLUME = 1
|
||||||
@ -10,21 +10,19 @@ local tempy = {}
|
|||||||
|
|
||||||
-- sound sets
|
-- sound sets
|
||||||
local night = {
|
local night = {
|
||||||
handler = {}, frequency = 20,
|
handler = {}, frequency = 40,
|
||||||
{name="hornedowl", length=2},
|
{name="hornedowl", length=2},
|
||||||
{name="wolves", length=4},
|
{name="wolves", length=4},
|
||||||
{name="cricket", length=6},
|
{name="cricket", length=6},
|
||||||
{name="deer", length=7},
|
{name="deer", length=7},
|
||||||
{name="frog", length=1},
|
{name="frog", length=1},
|
||||||
{name="raccoon", length=1}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local day = {
|
local day = {
|
||||||
handler = {}, frequency = 80,
|
handler = {}, frequency = 40,
|
||||||
{name="cardinal", length=3},
|
{name="cardinal", length=3},
|
||||||
{name="craw", length=3},
|
|
||||||
{name="bluejay", length=6},
|
{name="bluejay", length=6},
|
||||||
{name="canadianloon1", length=10},
|
{name="craw", length=3},
|
||||||
{name="canadianloon2", length=14},
|
{name="canadianloon2", length=14},
|
||||||
{name="robin", length=4},
|
{name="robin", length=4},
|
||||||
{name="bird1", length=11},
|
{name="bird1", length=11},
|
||||||
@ -33,14 +31,20 @@ local day = {
|
|||||||
{name="peacock", length=2}
|
{name="peacock", length=2}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local high_up = {
|
||||||
|
handler = {}, frequency = 40,
|
||||||
|
{name="craw", length=3},
|
||||||
|
{name="wind", length=9.5},
|
||||||
|
}
|
||||||
|
|
||||||
local cave = {
|
local cave = {
|
||||||
handler = {}, frequency = 80,
|
handler = {}, frequency = 60,
|
||||||
{name="drippingwater1", length=1.5},
|
{name="drippingwater1", length=1.5},
|
||||||
{name="drippingwater2", length=1.5}
|
{name="drippingwater2", length=1.5}
|
||||||
}
|
}
|
||||||
|
|
||||||
local beach = {
|
local beach = {
|
||||||
handler = {}, frequency = 20,
|
handler = {}, frequency = 40,
|
||||||
{name="seagull", length=4.5},
|
{name="seagull", length=4.5},
|
||||||
{name="beach", length=13},
|
{name="beach", length=13},
|
||||||
{name="gull", length=1}
|
{name="gull", length=1}
|
||||||
@ -152,7 +156,11 @@ local get_ambience = function(player)
|
|||||||
return {desert=desert}
|
return {desert=desert}
|
||||||
end
|
end
|
||||||
|
|
||||||
if player:getpos().y < -10 then
|
if pos.y > 60 then
|
||||||
|
return {high_up=high_up}
|
||||||
|
end
|
||||||
|
|
||||||
|
if pos.y < -10 then
|
||||||
return {cave=cave}
|
return {cave=cave}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -210,8 +218,8 @@ end
|
|||||||
|
|
||||||
-- check sounds that are not in still_playing
|
-- check sounds that are not in still_playing
|
||||||
local still_playing = function(still_playing, player)
|
local still_playing = function(still_playing, player)
|
||||||
|
|
||||||
if not still_playing.cave then stop_sound(cave, player) end
|
if not still_playing.cave then stop_sound(cave, player) end
|
||||||
|
if not still_playing.high_up then stop_sound(high_up, player) end
|
||||||
if not still_playing.beach then stop_sound(beach, player) end
|
if not still_playing.beach then stop_sound(beach, player) end
|
||||||
if not still_playing.desert then stop_sound(desert, player) end
|
if not still_playing.desert then stop_sound(desert, player) end
|
||||||
if not still_playing.night then stop_sound(night, player) end
|
if not still_playing.night then stop_sound(night, player) end
|
||||||
@ -222,7 +230,6 @@ local still_playing = function(still_playing, player)
|
|||||||
if not still_playing.lava then stop_sound(lava, player) end
|
if not still_playing.lava then stop_sound(lava, player) end
|
||||||
if not still_playing.smallfire then stop_sound(smallfire, player) end
|
if not still_playing.smallfire then stop_sound(smallfire, player) end
|
||||||
if not still_playing.largefire then stop_sound(largefire, player) end
|
if not still_playing.largefire then stop_sound(largefire, player) end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- player routine
|
-- player routine
|
||||||
@ -242,7 +249,6 @@ minetest.register_globalstep(function(dtime)
|
|||||||
still_playing(ambiences, player)
|
still_playing(ambiences, player)
|
||||||
|
|
||||||
for _,ambience in pairs(ambiences) do
|
for _,ambience in pairs(ambiences) do
|
||||||
|
|
||||||
if math.random(1, 1000) <= ambience.frequency then
|
if math.random(1, 1000) <= ambience.frequency then
|
||||||
if ambience.on_start and played_on_start == false then
|
if ambience.on_start and played_on_start == false then
|
||||||
played_on_start = true
|
played_on_start = true
|
||||||
@ -252,7 +258,6 @@ minetest.register_globalstep(function(dtime)
|
|||||||
play_sound(player, ambience, math.random(1, #ambience))
|
play_sound(player, ambience, math.random(1, #ambience))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
BIN
sounds/bird1.ogg
BIN
sounds/bird1.ogg
Binary file not shown.
BIN
sounds/bird2.ogg
BIN
sounds/bird2.ogg
Binary file not shown.
Binary file not shown.
BIN
sounds/craw.ogg
BIN
sounds/craw.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sounds/lava.ogg
BIN
sounds/lava.ogg
Binary file not shown.
Binary file not shown.
BIN
sounds/robin.ogg
BIN
sounds/robin.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sounds/wind.ogg
Normal file
BIN
sounds/wind.ogg
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user