Small documentation improvement requests

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Small documentation improvement requests

Post by curiosity »

https://lua-api.factorio.com/latest/Concepts.html#TrainScheduleRecord doesn't say that wait_conditions can be nil.

-> Thanks, fixed for the next release.

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

Re: Small documentation improvement requests

Post by eradicator »

https://lua-api.factorio.com/latest/Data-Lifecycle.html
https://lua-api.factorio.com/latest/Libraries.html

It would be nice if these two pages (are there more?) had internal links (#) to each of the headlines/sections to make them directly linkable in discussions, tutorials and documentations. It's clunky to have to write instructions like:

somebody wrote:Data-Lifecycle and then scroll down to section 4.
-> This is/will be part of the new API website. There's currently no way to get the actual links from the page, but they do work, ie. https://lua-api.factorio.com/next/Data- ... ialization. Anchors on the page itself will be added in the future. Good suggestion, thanks for bringing it up!
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
Zetabite
Burner Inserter
Burner Inserter
Posts: 10
Joined: Tue Sep 22, 2020 7:50 am
Contact:

Re: Small documentation improvement requests

Post by Zetabite »

For https://lua-api.factorio.com/latest/Con ... enSettings or similar, add specification on limits for map size. Maybe even an entry on https://lua-api.factorio.com/latest/Bui ... .html#uint describing the exception if there is one.

-> The actual limitation is a million tiles in each direction (as noted on the wiki), which I added to the MapGenSettings concept for the next release.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3476
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Small documentation improvement requests

Post by DaveMcW »

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

The 4 optional WireConnectionDefinition fields are listed as uint, but they should be defines.circuit_connector_id or defines.wire_connection_id.

The wire_id fields should also refer to copper wire instead of circuits.

  • wire :: defines.wire_type: Wire color, either defines.wire_type.red or defines.wire_type.green.
  • target_entity :: LuaEntity: The entity to (dis)connect the source entity with.
  • source_circuit_id :: defines.circuit_connector_id (optional): Mandatory if the source entity has more than one circuit connector and using circuit wire.
  • target_circuit_id :: defines.circuit_connector_id (optional): Mandatory if the target entity has more than one circuit connector and using circuit wire.
  • source_wire_id :: defines.wire_connection_id (optional): Mandatory if the source entity has more than one wire connection and using copper wire.
  • target_wire_id :: defines.wire_connection_id (optional): Mandatory if the target entity has more than one wire connection and using copper wire.
Same for CircuitConnectionDefinition
-> Thanks a lot for the detailed notes, fixed for the next release.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 643
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Small documentation improvement requests

Post by ickputzdirwech »

https://lua-api.factorio.com/latest/Lua ... ty_filters To my knowledge all strings in this array must be names of entity prototypes that:
1. don't have the flag "not-deconstructable" and
2. are either a cliff or are minable


-> Thanks, updated for the next release.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Small documentation improvement requests

Post by curiosity »

The "crafting" recipe category is hardcoded to disallow fluids, but this isn't documented anywhere obvious (Recipe.category or RecipeCategory). If anything is hardcoded about any other categories, or something else about the "crafting" category, it would also be good to know.

-DeadlyKitten
Inserter
Inserter
Posts: 28
Joined: Sat Dec 14, 2019 3:26 am
Contact:

Re: Small documentation improvement requests

Post by -DeadlyKitten »

please fix surface.spill_item_stack

the documantion currently only tells what the first 2 fields do but i found this command with 5 inputs in a mod

player.surface.spill_item_stack(player.position, inventory, true, player.force, true)


-> Not sure which docs you are looking at, but Surface.spill_item_stack lists five arguments. If there is still an issue in your opinion, please add a new comment to this thread.

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

Re: Small documentation improvement requests

Post by eradicator »

(I accidentally deleted curi's original comment, but thankfully it is preserved in this reply. Whoopsie)
curiosity wrote:
Mon Sep 13, 2021 6:28 pm
https://wiki.factorio.com/Tutorial:Localisation#Built-in_parameters says "We can also use this for items and entities etc.", but there is no list of acceptable keywords anywhere.
Yea, it should say item-names and entity-names. The "etc" is also suspicious. Are there actually any other prototypes supported other than __ITEM__ and __ENTITY__?
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.

curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Small documentation improvement requests

Post by curiosity »

eradicator wrote:
Mon Sep 13, 2021 9:15 pm
Yea, it should say item-names and entity-names. The "etc" is also suspicious. Are there actually any other prototypes supported other than __ITEM__ and __ENTITY__?
There is also __TILE__ and some other things. But regardless, there should be a proper list of keywords, not "items and entities". This is not a guessing game.

Honktown
Filter Inserter
Filter Inserter
Posts: 822
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Small documentation improvement requests

Post by Honktown »

https://lua-api.factorio.com/latest/Lua ... screenshot

Code: Select all

path :: string (optional): Path to save the screenshot in.
Default to script output? with or without a leading ./?

Code: Select all

quality :: int (optional): The render quality if using jpg format (0-100 inclusive).
There's nothing to say how this works. No quality = png and 0-100 = jpg?

-> I improved both of the screenshotting functions in a number of ways for the next release, thanks for the hint!
I have mods! I guess!
Link

User avatar
Stringweasel
Inserter
Inserter
Posts: 39
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: Small documentation improvement requests

Post by Stringweasel »

The documentation about the whole Trigger/Effects system could do with a little love :)

Here are a few things that I think I know what it means (or at least I think so - no thorough investigation was done):
And here are things that I really don't know what it means:

curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Small documentation improvement requests

Post by curiosity »

None of the energy source prototypes in runtime say what units emissions are in. Most other fields are also without units or any description.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3476
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Small documentation improvement requests

Post by DaveMcW »

https://lua-api.factorio.com/latest/Lua ... cted_rails
https://lua-api.factorio.com/latest/Lua ... gnal_state
Can only be used if this is RailSignal
This is technically incorrect, they require RailSignalBase, which includes RailSignal and RailChainSignal. Since RailSignalBase is not documented anywhere, we should list both child prototypes.
Can only be used if this is RailSignal or RailChainSignal
-> Very astute, thanks a lot, fixed for the next release.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 329
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Small documentation improvement requests

Post by Xorimuth »

https://lua-api.factorio.com/latest/Lua ... r_settings
Note: This can become invalid if during operation if the given player becomes invalid.
Typo: two 'if's.

What does it mean by 'operation'? Does it mean if you save the settings for that player to a variable, then cause the player to become invalid, then try to access the settings variable?


-> Thank you, I reworded that sentence to make it clearer for the next release. And yes, it does mean what you proposed.

Honktown
Filter Inserter
Filter Inserter
Posts: 822
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Small documentation improvement requests

Post by Honktown »

LuaSurface.find_tiles_filtered

Code: Select all

has_hidden_tile :: boolean (optional)
Was looking at this and wasn't sure if it would mean: must vs can have a hidden tile (true), must not (false), and the default, tiles with and without hidden tiles ("doesn't matter") or does not have a hidden tile? (false) .

There are some other same/similar parameters in other functions:
count_entities_filtered
to_be_deconstructed :: boolean (optional)
to_be_upgraded :: boolean (optional)

count_tiles_filtered has another has_hidden_tile
I have mods! I guess!
Link

oof2win2
Inserter
Inserter
Posts: 35
Joined: Wed Nov 18, 2020 8:13 am
Contact:

Re: Small documentation improvement requests

Post by oof2win2 »

https://lua-api.factorio.com/latest/Lua ... t.location
> or `nil` if not not set or not in
Probably should have only one not


-> Thanks, fixed for the next release.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 329
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Small documentation improvement requests

Post by Xorimuth »

Some specific things from viewtopic.php?p=553490#p553490

https://wiki.factorio.com/Prototype/Pro ... ction_only an explanation that it overrides the end position of the projectile

https://wiki.factorio.com/Types/AmmoType#target_type target_type="direction" will ignore gun's range

previous 2 points could also be noted at the gun range definition: https://wiki.factorio.com/Types/BaseAtt ... ters#range

viewtopic.php?p=553522#p553522 possible documentation error

User avatar
JohnTheCF
Burner Inserter
Burner Inserter
Posts: 11
Joined: Thu Jun 22, 2017 7:15 pm
Contact:

Re: Small documentation improvement requests

Post by JohnTheCF »

On the Prototype Definitions page, GuiStyle is shown to inherit from PrototypeBase, but on GuiStyle page PrototypeBase is not listed as parent and GuiStyle does not inherit it's properties.
-> GuiStyle inherits from PrototypeBase, I must have missed updating that. Fixed now :)

curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Small documentation improvement requests

Post by curiosity »

https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.drop_target
https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pickup_target
boskid@discord wrote:if there are multiple entities at the pickup or drop position, you can write there to select which one should be used for pickup and for drop
there is however a small limitation: that entity has to collide with the tile box under the pickup or drop position
https://discord.com/channels/1396775903 ... 8990987284

-> Clarified for the next release, thanks

curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Small documentation improvement requests

Post by curiosity »

https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_transport_line doesn't say if the transport lines are 0-indexed or 1-indexed (or, possibly, any other scheme).

-> They are 1-indexed, which I noted for the next release.

Post Reply

Return to “Modding interface requests”