Page 1 of 1
[0.16.51] get_blueprint_entities() Splitters
Posted: Sun Sep 23, 2018 9:07 am
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)
Re: [0.16.51] get_blueprint_entities() Splitters
Posted: Sun Sep 23, 2018 9:18 am
by mophydeen
e.type is also nil (at least for splitters.)
error:
attempt to concatenate field 'type' (a nil value)
Re: [0.16.51] get_blueprint_entities() Splitters
Posted: Sun Sep 23, 2018 9:28 am
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.
Re: [0.16.51] get_blueprint_entities() Splitters
Posted: Sun Sep 23, 2018 9:44 am
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.