Search found 186 matches

by hgschmie
Thu May 14, 2026 2:16 pm
Forum: Not a bug
Topic: get_max_inventory_index on a transport belt returns 8 even though all eight inventories return nil
Replies: 8
Views: 453

Re: get_max_inventory_index on a transport belt returns 8 even though all eight inventories return nil


Items on transport belt are not organized into inventories, they are organized into transport lines, each containing item stacks. You can query amount of transport lines given transport belt connectable has through LuaEntity::get_max_transport_line_index() (this time there are no gaps and all ...
by hgschmie
Tue May 12, 2026 6:04 pm
Forum: Modding discussion
Topic: [2.0.76] LuaEntity.connected_rail_direction
Replies: 1
Views: 123

[2.0.76] LuaEntity.connected_rail_direction

I am trying to understand the function of LuaEntity#connected_rail_direction. I have these four train stops:

Screenshot 2026-05-12 at 11.00.52.png

All four report a connected_rail_direction of "0" (which is defines.rail_direction.back). Under which circumstances would a train stop report defines ...
by hgschmie
Tue May 12, 2026 5:52 pm
Forum: Modding help
Topic: [2.0.76] LuaPrototypes#get_item_filtered documentation bug
Replies: 2
Views: 173

Re: [2.0.76] LuaPrototypes#get_item_filtered documentation bug

I think I get what you are saying. Basically, it should be

prototypes.get_item_filtered { { filter = 'type', type = 'fuel' }, } and not prototypes.get_item_filtered { { filter = 'fuel' }, }

That makes me curious why the second form worked at all.
by hgschmie
Tue May 12, 2026 2:11 am
Forum: Modding help
Topic: [2.0.76] LuaPrototypes#get_item_filtered documentation bug
Replies: 2
Views: 173

[2.0.76] LuaPrototypes#get_item_filtered documentation bug

https://lua-api.factorio.com/latest/cla ... m_filtered states
Screenshot 2026-05-11 at 19.10.07.png
Screenshot 2026-05-11 at 19.10.07.png (60.41 KiB) Viewed 173 times
However, within the debugger I get
Screenshot 2026-05-11 at 19.10.45.png
Screenshot 2026-05-11 at 19.10.45.png (70.6 KiB) Viewed 173 times
because the correct field name is 'filter', not 'filters'
by hgschmie
Tue May 12, 2026 1:05 am
Forum: Modding interface requests
Topic: [2.0.76] combinator_decription / player_description and undo/redo events
Replies: 0
Views: 83

[2.0.76] combinator_decription / player_description and undo/redo events

Hi,

I am trying to implement undo/redo for config changes for a custom mod based on a combinator. Currently, I am experimenting with serializing my custom configuration into a json string and store it in combinator_description/player_description. According to various posts here, there seems to be ...
by hgschmie
Fri May 08, 2026 12:35 am
Forum: Modding discussion
Topic: [2.0.76] calling get_filter() / get_or_create_control_behavior() on a ghost
Replies: 2
Views: 176

[2.0.76] calling get_filter() / get_or_create_control_behavior() on a ghost

I noticed that you can call e.g. LuaEntity.get+filter() or LuaEntity.get_or_create_control_behavior() on an entity ghost representing an inserter and it returns the information associated with it.

Is that intentional / officially supported or some undocumented behavior that might go away at any ...
by hgschmie
Fri May 08, 2026 12:25 am
Forum: Resolved Requests
Topic: [2.0.76] Wrong constant value for SpoilPriority in undo/redo applied event
Replies: 6
Views: 315

Re: [2.0.76] Wrong constant value for SpoilPriority in undo/redo applied event

Thank you for fixing the docs. However, I have to admit that there are a lot of places that could have benefitted from consistency (this being one of those). I have a lot of these small translation tables (in this case 'xxx-yyy' to 'xxx_yyy') in my mods and that leads to code duplications and the ...
by hgschmie
Thu May 07, 2026 5:57 am
Forum: Resolved Requests
Topic: [2.0.76] Wrong constant value for SpoilPriority in undo/redo applied event
Replies: 6
Views: 315

Re: [2.0.76] Wrong constant value for SpoilPriority in undo/redo applied event


This is an issue with docs and as such i am moving this to Documentation improvement requests.

Specifically the SpoilPriority refers to a concept in lua where `_` is used, however spoil_priority for inserter inside of BlueprintEntity uses different format where `-` is expected.


Does that mean ...
by hgschmie
Thu May 07, 2026 1:44 am
Forum: Fixed for 2.1
Topic: [2.0.76] Loader GUI does not update blacklist/whitelist
Replies: 1
Views: 182

[2.0.76] Loader GUI does not update blacklist/whitelist

When opening the GUI for a loader (loader1x1 in my case) entity, the GUI shows the "Use Filters" checkbox and "Whitelist / Blacklist" switch at the bottom.

When changing the settings for the entity while the GUI is open by doing entity.loader_filter_mode = 'blacklist' or entity.loader_filter_mode ...
by hgschmie
Wed May 06, 2026 11:32 pm
Forum: Resolved Requests
Topic: [2.0.76] Wrong constant value for SpoilPriority in undo/redo applied event
Replies: 6
Views: 315

[2.0.76] Wrong constant value for SpoilPriority in undo/redo applied event

I received an on_undo_applied event with a single UndoRedo action, a "copy-entity-settings'. This is supposed to contain a BlueprintEntity which in turn contains a SpoilPriority value in spoil_priority. This is supposed to have 'none', 'fresh_first' or 'spoiled_first''.

However, I received 'spoiled ...
by hgschmie
Wed May 06, 2026 4:41 am
Forum: Modding help
Topic: Fast hash in lua
Replies: 6
Views: 388

Re: Fast hash in lua

If you need to move data between prototype and runtime stage, consider using ModData (https://lua-api.factorio.com/latest/prototypes/ModData.html). If you are just managing data during the prototype stage, the performance does not really matter, concatenating with e.g. ':' or '|' and leaving the ...
by hgschmie
Wed May 06, 2026 4:36 am
Forum: Modding help
Topic: [2.0.76] calling create_entity with fast_replace = true
Replies: 1
Views: 123

Re: [2.0.76] calling create_entity with fast_replace = true

After a bit more experimentation, it seems that the Blueprint Sandboxes mod is doing upgrades wrong. When calling entity.apply_upgrade() instead of create_entity with fast_replace, the engine sends out all events correctly (script_raised_destroy, then script_raised_built).
by hgschmie
Wed May 06, 2026 4:12 am
Forum: Modding help
Topic: [2.0.76] calling create_entity with fast_replace = true
Replies: 1
Views: 123

[2.0.76] calling create_entity with fast_replace = true

I have a mod (https://mods.factorio.com/mod/miniloader-redux) where each entity relies on creation/deletion events to maintain internal state. This works fine in the regular game.

I register on_built_entity, on_robot_built_entity, on_space_platform_built_entity, script_raised_built, script_raised ...
by hgschmie
Tue May 05, 2026 5:22 pm
Forum: Modding help
Topic: Fast hash in lua
Replies: 6
Views: 388

Re: Fast hash in lua

What are you trying to hash? With entity unit numbers being unique and tables taking string keys, I rarely found a reason to hash anything. Curious what you are trying to do.
by hgschmie
Mon Apr 20, 2026 2:25 am
Forum: Not a bug
Topic: [2.0.76] Power switch GUI is not like all the other GUIs
Replies: 2
Views: 318

Re: [2.0.76] Power switch GUI is not like all the other GUIs


Thanks for the report however that is fully intended. They along with electric poles have no distance limit on them since version 0.16 released in 2017.


Hm,

I half-expected something like this. Lamps do have a distance limit. Power-switches sit at a weird intersection; they are only useful for ...
by hgschmie
Mon Apr 20, 2026 1:39 am
Forum: Not a bug
Topic: [2.0.76] Power switch GUI is not like all the other GUIs
Replies: 2
Views: 318

[2.0.76] Power switch GUI is not like all the other GUIs

Most (All?) GUIs have a maximum limit from which a player can open their GUI. The outline turns red if the GUI can not be opened:

Screenshot 2026-04-19 at 18.37.24.png
Screenshot 2026-04-19 at 18.37.32.png

Except the power switch. I tried zooming out on a big screen and even at max zoom, I can ...
by hgschmie
Sat Mar 28, 2026 8:24 pm
Forum: Logistic Train Network
Topic: ‘No train found in depot’ but train is clearly there?
Replies: 2
Views: 427

Re: ‘No train found in depot’ but train is clearly there?

Do you have a save? I can take a look but I would need a save to look at.
by hgschmie
Sat Mar 21, 2026 12:49 am
Forum: Development tools
Topic: [Tool] FactorioModTranslator: Localize any mod into your language
Replies: 1
Views: 831

Re: [Tool] FactorioModTranslator: Localize any mod into your language

Sure, but windows only and seems mostly vibe-coded with antigravity.

Get a platform independent version?
by hgschmie
Thu Mar 19, 2026 10:32 pm
Forum: Not a bug
Topic: [2.0.76] ElectricEnergyInterface entity status is always ok
Replies: 5
Views: 670

Re: [2.0.76] ElectricEnergyInterface entity status is always ok

Osmo wrote: Thu Mar 19, 2026 9:10 pm You can also assign a custom status to the entity, when it is selected/opened by a player
Agreed. However, for a custom status (e.g. low power/no power), I would need to know that this condition exists right now and there is not a good way to find out.

Go to advanced search