LuaEntityPrototype.hearable_distance

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

LuaEntityPrototype.hearable_distance

Post by eradicator »

What?

I'd like to override the distance at which a machine can be heared (mostly mining drills) (in data stage).

Why?

Some machines are loud, really loud. But the engine cuts off all sound for things more than ~16 tiles away. It would be nice if it was possible to override the distance over which the sound fades, so that it starts i.e. 200 tiles away and slowly gains volume as the player approaches.

(Weapon mods that add big explosives could also benefit from this.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaEntityPrototype.hearable_distance

Post by Rseding91 »

You can configure that distance in the config file under [sound][environment-audible-distance]. It defaults to 15.

Not you're going to have quick performance issues the bigger you make that since it's a radius for a square that it entity-searches over each tick.
If you want to get ahold of me I'm almost always on Discord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: LuaEntityPrototype.hearable_distance

Post by eradicator »

Thanks for the answer, however i don't want to increase it for *every* entity. Just one or two modded ones that are supposed to be "big and loud" (and there's only gonna be a very few of them). And changing my own config doesn't help with that. I don't care if it's on the entity itself, or if i have to fake it with play_sound or explosions or whatever, but i don't see a way to do fake it at all with what's available.

Not sure if that's completely unfeasible...
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding interface requests”