Page 1 of 1

Is it possible to change map mod settings during an event?

Posted: Wed Apr 14, 2021 11:54 am
by ZwerOxotnik
https://lua-api.factorio.com/1.1.30/events.html#on_runtime_mod_setting_changed wrote: player_index :: uint (optional): The player who changed the setting or nil if changed by script.
I don't notice a way to change a setting in events by scripts.

Re: Is it possible to change map mod settings during an event?

Posted: Wed Apr 14, 2021 12:43 pm
by eradicator
'tis a bit obscure to find because it's listed as [read-only] on the LuaSettings page.
Concepts.html#ModSetting wrote: ModSetting

Table with the following fields:

value :: uint or double or boolean or string: The value of the mod setting. The type depends on the setting.

Note: Runtime settings can be changed through console commands and by the mod that owns the settings by writing a new table to the ModSetting.

Re: Is it possible to change map mod settings during an event?

Posted: Wed Apr 14, 2021 1:25 pm
by ZwerOxotnik
Oh, thank you.