[0.16.51] get_blueprint_entities() Splitters

Place to get help with not working mods / modding interface.
mophydeen
Filter Inserter
Filter Inserter
Posts: 529
Joined: Sun Nov 22, 2015 5:02 pm
Contact:

[0.16.51] get_blueprint_entities() Splitters

Post by mophydeen »

when cursor.get_blueprint_entities()

You can't run splitter specific methods

e.splitter_filter.name
e.splitter_input_priority
e.splitter_output_priority

error:
attempt to index field 'splitter_filter' (a nil value)
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.16.51] get_blueprint_entities() Splitters

Post by Bilka »

The fields are called
  • filter
  • input_priority
  • output_priority
As documented, get_blueprint_entities() does not return a LuaEntity, so you cannot expect the returned objects to function like LuaEntities: https://lua-api.factorio.com/latest/Lua ... t_entities

You can use https://wiki.factorio.com/Blueprint_str ... ity_object as a reference for the "blueprint entity" that is returned by the function.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.16.51] get_blueprint_entities() Splitters

Post by eradicator »

Bilka wrote: Sun Sep 23, 2018 9:28 am [...] you cannot expect the returned objects to function like LuaEntities: [...]
The whole API is sprayed with slight naming inconsistencies like that. I think "expecting" things to be different is actually quite possible especially for new modders :p.

@OP: Don't be discouraged. This happens to all of us. The next time just print the table and read what it actually says.
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.
Post Reply

Return to “Modding help”