Is this more of a comment? What do you think should be changed?Honktown wrote: Fri Jun 04, 2021 1:19 am https://lua-api.factorio.com/latest/Lua ... get_recipe
Works on a ghost of a crafting machine. Not sure if it is intentional or not (there is no other obvious way to check the recipe on a ghost), but it works. get_recipe() and previous_recipe don't do anything on a blueprint of a furnace, which makes sense.
LuaEntity::get_recipe() subclasses
LuaEntity::get_recipe() subclasses
Re: Small documentation improvement requests
Can only be used if this is CraftingMachine, or EntityGhost of CraftingMachine.
Re: LuaEntity::get_recipe() subclasses
Doesn't CraftingMachine already imply that?
Re: LuaEntity::get_recipe() subclasses
Not unless you know the LuaEntity inheritance tree. If you want to document how a LuaEntity can be two types at once, that would be great too!
Re: LuaEntity::get_recipe() subclasses
You're right, probably best to be explicit. Fixed for the next release.
The whole 'Can only be used if' system is kind of bad in general though, it's due for a re-do at some point I feel like.
The whole 'Can only be used if' system is kind of bad in general though, it's due for a re-do at some point I feel like.
Re: LuaEntity::get_recipe() subclasses
Ghosts can't craft and machines of them are an entity-ghost, so from a modder perspective, no. How I viewed it, hence the request. Similarly, seemingly far more important attributes, ghost_name, ghost_prototype, ghost_type, e.g. are separate. No ghost_get_recipe() or ghost_set_recipe()
I have mods! I guess!
Link
Link
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: LuaEntity::get_recipe() subclasses
Intuitively and without evidence and very personal opinion: No.
I generally assume that SomethingGhost behaves entirely different than the real thing.
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.