Small documentation improvement requests

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5021
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Small documentation improvement requests

Post by eradicator »

Wtf is "generate_sdf" :lol:.

Saw it on the character-bonus technology-icon definitions and noticed it's supported by several sprite related prototypes but it's explained nowhere.


-> Explained on https://wiki.factorio.com/Types/Sprite, it's unused in the rest of the sprite types.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5021
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Small documentation improvement requests

Post by eradicator »

UnlockRecipeModifierPrototype looks like someone copied the wrong template.
It says "item" and "count" instead of "recipe" :D.


-> The doc for this ended up on https://wiki.factorio.com/Types/TurretA ... rPrototype somehow. Thanks for noticing, fixed :D
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5021
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Small documentation improvement requests

Post by eradicator »

Maybe add a small note to the API doc that

Code: Select all

LuaForce.research_queue = {'automation','construction-robotics','automation'}
behaves the same as if a player did it. Aka:

Code: Select all

Note: Technologies that could not be normally researched by the force are silently ignored.
I.e. If their prerequisites are not met, or they have already been researched.
I found it a bit suprising, as usually the API allows mods to ignore normal limitations.

-> Thanks, added for the next release.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5021
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Small documentation improvement requests

Post by eradicator »

Shortcut icons (normal + small + disabled) Are not normal "Sprite" types as they ignore the scale property to keep shortcut button style unified. (didn't test for other things like shift). As such the example is also misleading as it explicitly defines "scale = 1" for all icons.

-> Example updated to 1.1.34. It comes from the base game which sets the scale. I'm investigating why the scale is set when it doesn't seem to do anything.

=> If it is intentionally as I suspect and not a bug then I still think that showing scale in the example gives the wrong impression that it is somehow meaninful or nessecary. All my shortcuts are defined without scale and work as expected.


-> Scale removed from example, page updated to explain why it may not work as expected.
Last edited by eradicator on Thu Jun 10, 2021 8:39 pm, edited 3 times in total.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: Small documentation improvement requests

Post by Muppet9010 »

LuaSurface.can_place_entity() requires inner_name when the the entity you are trying to test place is an "entity-ghost". The docs don't mention it, but you get a missing key error.
https://lua-api.factorio.com/latest/Lua ... ace_entity

Looks to be the same usage as the "entity-ghost" other attributes listed for the LuaSurface.create_entity().
https://lua-api.factorio.com/latest/Lua ... ate_entity

Pi-C
Smart Inserter
Smart Inserter
Posts: 1059
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Small documentation improvement requests

Post by Pi-C »

Regarding LuaPlayer.create_local_flying_text:
time_to_live :: uint (optional)
speed :: double (optional): Movement per second
Units are missing here! Generally, ticks are used for time_to_live, but it wouldn't hurt if this was explicitly mentioned. However, "movement per second" is absolutely not enough: Does that refer to tiles per second, or is it a multiplier applied to the speed of vanilla flying text?

-> Thanks for the hint, I overhauled that whole method for the next release.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

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

Re: Small documentation improvement requests

Post by Muppet9010 »

Autoplace specifiation peak documentation doesn't list the dimension attributes specifically, instead as `d_XXX`. This makes any machine reading of the API spec break, as it can't see that `temperature_optimal` is a valid attribute.

Code: Select all

d_optimal :: double: d is the dimension name; this attribute may occur multiple times, once for each dimension, every time with a different prefix.
d_range :: double: d is the dimension name.
d_top_property_limit :: double: d is the dimension name.
d_max_range :: double: d is the dimension name.
I also can't see in the API spec where it lists the name of the dimensions to go with its `d_XXX` description.
I found "temperature" and "water" as dimensions from exploring data.

https://lua-api.factorio.com/latest/Con ... cationPeak

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2369
Joined: Fri Nov 06, 2015 7:41 pm

Re: Small documentation improvement requests

Post by Deadlock989 »

LuaGameScript.get_filtered_item_prototypes links to "#ItemPrototypeFilters" on the Concepts page, but the anchor is incorrect, it should go to ItemPrototypeFilter (singular).

Edited to add, same seems to be true for most or all of the *PrototypeFilter links on that page.


-> Thanks for letting us know, but it seems that this is a caching issue on your side in this case, the current links are correct. Anyone experiencing this should try Ctrl-F5 on the lua-api page to clear their cache and see whether that fixes it.

PFQNiet
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Small documentation improvement requests

Post by PFQNiet »

Tools have prototype properties to describe how the durability should appear in the tooltip, but the actual usage of this isn't documented.

From looking at core.cfg it would appear that the locale entry gets given:

__1__: remaining durability
__2__: total durability
__3__: durability as a percentage

However this would be nice to have confirmed in the documentation, as well as anything I may have missed here :)

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

Re: Small documentation improvement requests

Post by Muppet9010 »

The link to Event Filters on the latest API home page is broken.

https://lua-api.factorio.com/latest/#Events
Capture.PNG
Capture.PNG (30.96 KiB) Viewed 43 times

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5021
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Small documentation improvement requests

Post by eradicator »

Muppet9010 wrote:
Sat Jun 19, 2021 8:54 pm
The link to Event Filters on the latest API home page is broken.
Looking at the 1.1.35 release zip the Event-Filters.html file is missing.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: Small documentation improvement requests

Post by Muppet9010 »

eradicator wrote:
Sat Jun 19, 2021 9:24 pm
Muppet9010 wrote:
Sat Jun 19, 2021 8:54 pm
The link to Event Filters on the latest API home page is broken.
Looking at the 1.1.35 release zip the Event-Filters.html file is missing.
Its under Concepts, if you follow a specific event and then click the link to that event's filters.

Post Reply

Return to “Modding interface requests”