Page 1 of 1

[2.1.9] programmable speaker .alert_parameters.alert_message is read only?

Posted: Sun Jul 12, 2026 12:01 pm
by Icicubes
/c if game.player.selected then game.player.selected.alert_parameters.alert_message=game.player.selected.alert_parameters.alert_message.."what" end
The modding docs say this table is read and write, but at least this alert_message is read only (or broken) otherwise the command above would not silently fail for me (it doesn't change it).

Re: [2.1.9] programmable speaker .alert_parameters.alert_message is read only?

Posted: Sun Jul 12, 2026 12:12 pm
by Rseding91
You have to read the entire alert_parameters value into a local variable, modify what ever sub-values you want, then write the entire thing back in one go.

Re: [2.1.9] programmable speaker .alert_parameters.alert_message is read only?

Posted: Sun Jul 12, 2026 4:09 pm
by Icicubes
That still didn't fix my issue. My game disagrees with you.
202607~1.JPG
202607~1.JPG (365.17 KiB) Viewed 152 times

Re: [2.1.9] programmable speaker .alert_parameters.alert_message is read only?

Posted: Sun Jul 12, 2026 4:20 pm
by robot256
I can't read the script in your screenshot, it's too complicated. Try this script instead:

Code: Select all

/c game.print(serpent.block(game.player.selected.alert_parameters)); game.player.selected.alert_parameters = {alert_message = "Hello world", show_alert=true, show_on_map=true};  game.print(serpent.block(game.player.selected.alert_parameters))

Re: [2.1.9] programmable speaker .alert_parameters.alert_message is read only?

Posted: Sun Jul 12, 2026 4:22 pm
by boskid
Your code is still bugged, you are setting alert_message on a copy.

Code: Select all

.alert_parameters.alert_message = 
is bugged. In a correct code there will be

Code: Select all

.alert_parameters =
somewhere