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: 5029
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: 5029
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: 5029
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: 5029
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: 222
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: 1061
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: 222
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: 2372
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: 183
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 :)

-> Confirmed, documented, including an example.

User avatar
Muppet9010
Fast Inserter
Fast Inserter
Posts: 222
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 187 times
-> Like you noted below (comments now deleted to not clutter up the thread), this has been moved to concepts. That particular link was missed somehow though, so thanks. Fixed for the next release.

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

Re: Small documentation improvement requests

Post by Deadlock989 »

Equipment.ability_icon
ActivateEquipmentCapsuleAction.equipment

How are these used and what are their limitations? The only thing that uses ability_icon in vanilla is the discharge defence equipment, and it corresponds with the icon used by the DD remote capsule, which points back to the equipment with the equipment property of its capsule_action. But in tests I can't get it to work properly with anything except equipment of type active-defense-equipment (the number on the quickbar remote stays red 0). Are these properties restricted to active-defense-equipment or am I missing some trick?

Edited to add: I'm not even sure that ability_icon does anything at all - I edited the vanila DD equipment to use some other icon and couldn't find any in-game changes at all.


-> You are correct, ability_icon was unused. I've removed it in version 1.1.36.

ActivateEquipmentCapsuleAction.equipment loads any equipment, but only ActiveDefenseEquipment can be activated (and only ActiveDefenseEquipment has cooldown and AvailableAbilityCount implemented). Now documented on the wiki.

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

Re: Small documentation improvement requests

Post by Pi-C »

LuaSurface.request_path
Starts a path find request without actually ordering a unit to move. Result is ultimately returned asynchronously via on_script_path_request_finished.
This looks like it is for units (biters/spitters) only, but we use that for "car" prototypes in the "Autodrive" mod and I suppose it will also work with "spider-vehicle" prototypes.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

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

Re: Small documentation improvement requests

Post by Honktown »

Pi-C wrote:
Wed Jun 23, 2021 9:41 am
LuaSurface.request_path
Starts a path find request without actually ordering a unit to move. Result is ultimately returned asynchronously via on_script_path_request_finished.
This looks like it is for units (biters/spitters) only, but we use that for "car" prototypes in the "Autodrive" mod and I suppose it will also work with "spider-vehicle" prototypes.
Erm, it doesn't take an entity prototype or anything at all, only a bounding box and collision mask. The bounding box could even be dimensions that no prototype uses. I suppose the use of "unit" in the description might confuse someone. If you were to "clarify" it, would you have any suggestions?
I have mods! I guess!
Link

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

Re: Small documentation improvement requests

Post by Pi-C »

Honktown wrote:
Thu Jun 24, 2021 1:32 am
Pi-C wrote:
Wed Jun 23, 2021 9:41 am
LuaSurface.request_path
Erm, it doesn't take an entity prototype or anything at all, only a bounding box and collision mask. The bounding box could even be dimensions that no prototype uses.
Oh, you're right. :oops:
I suppose the use of "unit" in the description might confuse someone.
Especially if that someone is working on a vehicle mod and has to deal with another mod replacing cars with units for pathfinding. That's why my first reaction was: "Wait, that's not limited to units, we've used that for cars!" :-)
If you were to "clarify" it, would you have any suggestions?
Prototype/Unit is a subset of Prototype/EntityWithHealth, so replacing "a unit" with "an entity" should be clear enough. "Entity" is such a general term that it covers even particles and projectiles.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding interface requests”