Page 1 of 1

Forcing ProgrammableSpeakerParameters.playback_* booleans

Posted: Wed Nov 14, 2018 8:41 pm
by Pebble
Hi,

I've noticed on alot of servers that the ProgrammableSpeakers are disabled, cause bans, etc. and are just generally unappreciated because of the need to keep them from doing global playback on multiplayer.

I was looking for the right way to disable playback and still allow the global alerts that these entities have because they're so useful to me.

How could we go about forcing the playback_volume or playback_globally settings on all of these to false?

Re: Forcing ProgrammableSpeakerParameters.playback_* booleans

Posted: Thu Nov 15, 2018 11:49 am
by eradicator
Hook into on_*_built, on_entity_settings_pasted and on_gui_opened to force it back to non-global whenever a player changes it. Should be possible. You'll need a dynamic tick handler for watching the gui live as it changes unless you want to pay (cpu cost) for a constant background on_tick.

Or you could try using the permission system (/permissions ingame):
https://lua-api.factorio.com/latest/Lua ... ows_action

"change programmable speaker parameters" can disable:
playback_volume :: double
playback_globally :: boolean
allow_polyphony :: boolean

though only all at once.