Page 1 of 1

[1.1.50] New API docs lack enum values

Posted: Sun Jan 09, 2022 1:32 pm
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.

Re: [1.1.50] New API docs lack enum values

Posted: Sun Jan 09, 2022 4:59 pm
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.

Re: [1.1.50] New API docs lack enum values

Posted: Sun Jan 09, 2022 5:16 pm
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

Re: [1.1.50] New API docs lack enum values

Posted: Sun Jan 09, 2022 5:30 pm
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

Re: [1.1.50] New API docs lack enum values

Posted: Sun Jan 09, 2022 10:08 pm
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.

Re: [1.1.50] New API docs lack enum values

Posted: Sun Jan 09, 2022 10:22 pm
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.

Re: [1.1.50] New API docs lack enum values

Posted: Sun Jan 09, 2022 11:21 pm
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.

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 12:52 am
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.

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 2:34 am
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.

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 10:37 am
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.

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 10:42 am
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.

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 1:45 pm
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!

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 2:19 pm
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.

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 3:35 pm
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.

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 5:55 pm
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.

Re: [1.1.50] New API docs lack enum values

Posted: Mon Jan 10, 2022 5:59 pm
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 702 times

Re: [1.1.50] New API docs lack enum values

Posted: Wed Jan 19, 2022 12:02 pm
by Bilka
Hey, this was fixed, including retroactively for 1.1.50: https://lua-api.factorio.com/1.1.50/Con ... RenderType