Hey all,
In short:
Is it possible to add sound to an area?
Explanation on why such a request:
So I'm working on a server map, I have Areas mod installed and it's working like a charm. I have several areas of which one I wanted a certain piece of background audio to make it a more tense area (I'm making this with Audacity, it'll be pretty dark). The audio file (ogg file) itself won't be huge, think of a maximum of 25mb and it's a map I want to continuously run on my own network for the others to play.
How would I go about this?
Dear regards,
Charlie. :)
Areas mod with Sound
Re: Areas mod with Sound
Of course, but keep in mind that the time it takes for new players to join a server highly increases when they have to download big media files.
In short:
Execute a minetest.sound_play while the player is inside the area.
For example with minetest.register_globalstep.
You can look it up in the official documentation.
https://github.com/minetest/minetest/bl ... .txt#L5597
https://github.com/minetest/minetest/bl ... i.txt#L830
https://github.com/minetest/minetest/bl ... i.txt#L906
https://github.com/minetest/minetest/bl ... .txt#L4759
The areas mod automatically changes the hud of players when they enter an area. You could copy this concept to play player bound sounds https://github.com/minetest-mods/areas/ ... hud.lua#L6.
Can your read this?
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Areas mod with Sound
25 Megabyte could pretty much be 99% of your server's media that will be transferred any time a player connects.
Re: Areas mod with Sound
Thanks very much, I will give it a try. I've been working a lot, so I haven't had the time to look at the forum, my apologies for the late response.cx384 wrote: ↑Mon Sep 13, 2021 12:06Of course, but keep in mind that the time it takes for new players to join a server highly increases when they have to download big media files.
In short:
Execute a minetest.sound_play while the player is inside the area.
For example with minetest.register_globalstep.
You can look it up in the official documentation.
https://github.com/minetest/minetest/bl ... .txt#L5597
https://github.com/minetest/minetest/bl ... i.txt#L830
https://github.com/minetest/minetest/bl ... i.txt#L906
https://github.com/minetest/minetest/bl ... .txt#L4759
The areas mod automatically changes the hud of players when they enter an area. You could copy this concept to play player bound sounds https://github.com/minetest-mods/areas/ ... hud.lua#L6.
Re: Areas mod with Sound
Who is online
Users browsing this forum: No registered users and 18 guests