Page 1 of 1
[0.16.51] LuaGameScript.map_settings API documentation
Posted: Thu Oct 11, 2018 10:13 pm
by Muppet9010
The documentation under LuaGameScript for map_settings states it is read only. However it appears it can be changed in a test of pathing settings. Also under Concepts for MapSettings it states they can be changed.
Re: [0.16.51] LuaGameScript.map_settings API documentation
Posted: Fri Oct 12, 2018 3:35 pm
by Rseding91
Thanks for the report however the API documentation is correct.
You can't write directly to map_settings:
Will produce an error.
You can write to things *on* map settings - but you can't write the map_settings value itself.
Re: [0.16.51] LuaGameScript.map_settings API documentation
Posted: Fri Oct 12, 2018 6:17 pm
by steinio
Re: [0.16.51] LuaGameScript.map_settings API documentation
Posted: Tue Oct 30, 2018 12:04 am
by Muppet9010
could the documentation be amended to specify this Rseding to make it clearer?
that the game.map_settings references a table of editable values, but the table itself is not editable.
I know it seems minor, but for those of us not intricately familiar with Factorio the API documentation is our best direction on how to approach things. It took me a while to find the references that said the values of the table could be changed after seeing that game.map_settings itslef is read only.
sorry for late reply, missed the notification of reply.
Re: [0.16.51] LuaGameScript.map_settings API documentation
Posted: Tue Oct 30, 2018 11:39 am
by Rseding91
At the moment it's not a simple change to make the documentation script mark things that work that way as working that way. From the scripts perspective something is read, write, read/write, or a method. It doesn't understand that something can be read and then have values on it written. It just documents the immediate property/method as to how the immediate class its on exposes it.