[0.16.51] LuaGameScript.map_settings API documentation

Bugs that are actually features.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

[0.16.51] LuaGameScript.map_settings API documentation

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] LuaGameScript.map_settings API documentation

Post by Rseding91 »

Thanks for the report however the API documentation is correct.

You can't write directly to map_settings:

Code: Select all

game.map_settings = {}
Will produce an error.

You can write to things *on* map settings - but you can't write the map_settings value itself.
If you want to get ahold of me I'm almost always on Discord.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [0.16.51] LuaGameScript.map_settings API documentation

Post by steinio »

Posila explained it to me this way: viewtopic.php?f=23&t=59647&p=356996#p357001
Image

Transport Belt Repair Man

View unread Posts

User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Re: [0.16.51] LuaGameScript.map_settings API documentation

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] LuaGameScript.map_settings API documentation

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”