Page 1 of 1

LuaEntityPrototype.hearable_distance

Posted: Fri Jun 14, 2019 7:12 pm
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.)

Re: LuaEntityPrototype.hearable_distance

Posted: Fri Jun 14, 2019 9:28 pm
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.

Re: LuaEntityPrototype.hearable_distance

Posted: Sat Jun 15, 2019 7:16 am
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...