[1.1.50] New API docs lack enum values

This subforum contains all the issues which we already resolved.
repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

[1.1.50] New API docs lack enum values

Post by repne-scasb »

Not sure where to report this as there does not seem to be a bug report section for the API docs.

The new Lua API docs page looks awesome but I noticed that values for enums on the Concepts page are missing. Compare 1.1.48 vs 1.1.49: from version 1.1.49 onwards the enum values are missing from the documentation.
robot256
Filter Inserter
Filter Inserter
Posts: 934
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.1.50] New API docs lack enum values

Post by robot256 »

This was probably intentional. The numeric values of the enums are theoretically subject to change without notice. It's much better to structure your code so the numeric values don't matter.

I got confused because you are talking about string parameters with a fixed set of valid options, not defines.* enumerations. You are correct that the information is missing.
Last edited by robot256 on Sun Jan 09, 2022 5:29 pm, edited 1 time in total.
repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by repne-scasb »

robot256 wrote: Sun Jan 09, 2022 4:59 pm This was probably intentional. The numeric values of the enums are theoretically subject to change without notice. It's much better to structure your code so the numeric values don't matter.
I'm not talking about those, it's the value list that is missing in its entirety, compare the linked definition
robot256
Filter Inserter
Filter Inserter
Posts: 934
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.1.50] New API docs lack enum values

Post by robot256 »

You are right, I misunderstood.

There is a thread for small documentation bugs where you could also post this: viewtopic.php?f=28&t=97880
repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by repne-scasb »

robot256 wrote: Sun Jan 09, 2022 5:30 pm You are right, I misunderstood.

There is a thread for small documentation bugs where you could also post this: viewtopic.php?f=28&t=97880
Thanks for that link! Although, it seems that it is mostly intended for suggestions on clarification, and less about bugs, so maybe this thread would not really fit, but I can post a link anyway.
curiosity
Filter Inserter
Filter Inserter
Posts: 474
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by curiosity »

repne-scasb wrote: Sun Jan 09, 2022 10:08 pm Thanks for that link! Although, it seems that it is mostly intended for suggestions on clarification, and less about bugs, so maybe this thread would not really fit, but I can post a link anyway.
With great reluctance I give you this link, but beg you: stop reposting this issue everywhere.
repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by repne-scasb »

curiosity wrote: Sun Jan 09, 2022 10:22 pm
repne-scasb wrote: Sun Jan 09, 2022 10:08 pm Thanks for that link! Although, it seems that it is mostly intended for suggestions on clarification, and less about bugs, so maybe this thread would not really fit, but I can post a link anyway.
With great reluctance I give you this link, but beg you: stop reposting this issue everywhere.
I'm sorry, what do you mean? Is this a known problem? I searched for 'enum' but can't find anything.
curiosity
Filter Inserter
Filter Inserter
Posts: 474
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by curiosity »

repne-scasb wrote: Sun Jan 09, 2022 11:21 pm I'm sorry, what do you mean? Is this a known problem? I searched for 'enum' but can't find anything.
It is known now. Posting about it once is enough.
robot256
Filter Inserter
Filter Inserter
Posts: 934
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.1.50] New API docs lack enum values

Post by robot256 »

And once again, you also wouldn't find it because it's not an "enum", it's a set of valid string literals. Factorio is written in C++, where an enum is a C type mapping symbol names to numbers, not a list of strings. Other actual enums are exposed in Lua, differently than this one.
repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by repne-scasb »

curiosity wrote: Mon Jan 10, 2022 12:52 am
repne-scasb wrote: Sun Jan 09, 2022 11:21 pm I'm sorry, what do you mean? Is this a known problem? I searched for 'enum' but can't find anything.
It is known now. Posting about it once is enough.
Ok sure, but go easy on me okay, comments like "With great reluctance I give you this link, but beg you: stop reposting this issue everywhere." don't really sound welcoming or anything. Someone asked me to post the issue on a different thread so I did, that's all.
repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by repne-scasb »

robot256 wrote: Mon Jan 10, 2022 2:34 am And once again, you also wouldn't find it because it's not an "enum", it's a set of valid string literals. Factorio is written in C++, where an enum is a C type mapping symbol names to numbers, not a list of strings. Other actual enums are exposed in Lua, differently than this one.
Ah okay yeah I guess that depends on what your definition of enum is. I was referring to them as enums as that is what the API docs call them, so that seemed the most logical to me, so more in the sense of 'enumeration' or how it is used in e.g. SQL than a C 'enum'. I didn't know about the other C-like enum variant exposed to Lua yet as I'm new to modding.
robot256
Filter Inserter
Filter Inserter
Posts: 934
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.1.50] New API docs lack enum values

Post by robot256 »

Oh wow, I never even knew that page had a table of contents with types in the list, since links always jump to the definition. Guess putting the type at the definitions would be another helpful change!
curiosity
Filter Inserter
Filter Inserter
Posts: 474
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by curiosity »

repne-scasb wrote: Mon Jan 10, 2022 10:37 am Ok sure, but go easy on me okay, comments like "With great reluctance I give you this link, but beg you: stop reposting this issue everywhere." don't really sound welcoming or anything. Someone asked me to post the issue on a different thread so I did, that's all.
Imagine spamming everywhere about your issue. That's my perspective. With that in mind, I was more welcoming than I'd consider reasonable (not to mention that I'm not obliged to be welcoming in the first place). I had given you the benefit of the doubt.

If someone asked you to post there, it sure wasn't anywhere I could see. And don't quote robot256's reply at me, they said that you could do it, not that you should.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by FuryoftheStars »

curiosity wrote: Mon Jan 10, 2022 2:19 pm Imagine spamming everywhere about your issue. That's my perspective. With that in mind, I was more welcoming than I'd consider reasonable (not to mention that I'm not obliged to be welcoming in the first place). I had given you the benefit of the doubt.

If someone asked you to post there, it sure wasn't anywhere I could see. And don't quote robot256's reply at me, they said that you could do it, not that you should.
This isn't spamming. They posted this one thread, with an opening comment that they weren't sure where to post something like this. When given the link to the correct already existing thread, they then posted once there. That's been it: 2 posts. Perfectly acceptable and I would've done the same in their shoes.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
curiosity
Filter Inserter
Filter Inserter
Posts: 474
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by curiosity »

FuryoftheStars wrote: Mon Jan 10, 2022 3:35 pm This isn't spamming. They posted this one thread, with an opening comment that they weren't sure where to post something like this. When given the link to the correct already existing thread, they then posted once there. That's been it: 2 posts. Perfectly acceptable and I would've done the same in their shoes.
The bug reports forum is not worse for the purpose of informing the devs about a bug, making the second post unnecessary. If it was worse, then yes, it would have been as you said.
repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Re: [1.1.50] New API docs lack enum values

Post by repne-scasb »

robot256 wrote: Mon Jan 10, 2022 1:45 pm Oh wow, I never even knew that page had a table of contents with types in the list, since links always jump to the definition. Guess putting the type at the definitions would be another helpful change!
Well you're in luck because they did just that in the new version ;)
enum.png
enum.png (8.43 KiB) Viewed 3724 times
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [1.1.50] New API docs lack enum values

Post by Bilka »

Hey, this was fixed, including retroactively for 1.1.50: https://lua-api.factorio.com/1.1.50/Con ... RenderType
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Resolved Problems and Bugs”