Areas mod with Sound

Post Reply
CharlieK
New member
Posts: 5
Joined: Mon Jun 15, 2020 15:20

Areas mod with Sound

by CharlieK » Post

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. :)

User avatar
cx384
Member
Posts: 654
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: Areas mod with Sound

by cx384 » Post

CharlieK wrote:
Sun Sep 12, 2021 11:24
In short:
Is it possible to add sound to an area?
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?

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Areas mod with Sound

by Linuxdirk » Post

CharlieK wrote:
Sun Sep 12, 2021 11:24
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.
25 Megabyte could pretty much be 99% of your server's media that will be transferred any time a player connects.

CharlieK
New member
Posts: 5
Joined: Mon Jun 15, 2020 15:20

Re: Areas mod with Sound

by CharlieK » Post

cx384 wrote:
Mon Sep 13, 2021 12:06
CharlieK wrote:
Sun Sep 12, 2021 11:24
In short:
Is it possible to add sound to an area?
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.
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.

CharlieK
New member
Posts: 5
Joined: Mon Jun 15, 2020 15:20

Re: Areas mod with Sound

by CharlieK » Post

Linuxdirk wrote:
Wed Sep 15, 2021 07:53
CharlieK wrote:
Sun Sep 12, 2021 11:24
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.
25 Megabyte could pretty much be 99% of your server's media that will be transferred any time a player connects.
This is correct, however I will run this on my own network, not through the internet. The download time will be negligible.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests