Search found 5 matches

by nullium21
Sun Sep 26, 2021 12:16 pm
Forum: Modding interface requests
Topic: Allow furnaces' recipe to be reset using .set_recipe(nil)
Replies: 15
Views: 2060

Re: Allow furnaces' recipe to be reset using .set_recipe(nil)


LuaEntity::set_recipe() works by calling AssemblingMachine::setupForCrafting() on the c++ side which is only available on entities that can be casted to AssemblingMachine class. Furnaces have completly different recipe changing routine which looks at first item from source inventory or first fluid ...
by nullium21
Sun Sep 26, 2021 11:58 am
Forum: Modding interface requests
Topic: Allow furnaces' recipe to be reset using .set_recipe(nil)
Replies: 15
Views: 2060

Re: Allow furnaces' recipe to be reset using .set_recipe(nil)


I see there is a documentation error. As for 1.1.41, LuaEntity::set_recipe() is incorrectly documented saying it can be used with CraftingMachine while it should say it can only be used with AssemblingMachine. LuaEntity::get_recipe() is correct saying it works on CraftingMachine.

Is there a ...
by nullium21
Sun Sep 26, 2021 10:17 am
Forum: Modding interface requests
Topic: Allow furnaces' recipe to be reset using .set_recipe(nil)
Replies: 15
Views: 2060

Allow furnaces' recipe to be reset using .set_recipe(nil)

Basically what the title says.
Tried to do this and got an error:
Image

The entity is a furnace, which, according to prototype wiki, is a crafting machine:
Image
by nullium21
Sun Sep 26, 2021 5:47 am
Forum: Modding interface requests
Topic: on_recipe_successfully_finished event
Replies: 5
Views: 1790

Re: on_recipe_successfully_finished event


You can shut off the on_tick hook when it completes, since this is by definition a one-shot cost this will be *vastly* cheaper than hooking every single recipe completion.

i wanted this entity to be reusable but this sounds reasonable too. i could even disable both the entity and the recipe ...
by nullium21
Sat Sep 25, 2021 3:50 pm
Forum: Modding interface requests
Topic: on_recipe_successfully_finished event
Replies: 5
Views: 1790

on_recipe_successfully_finished event

Asking for a recipe called "on_recipe_successfully_finished": triggered when an entity has finished crafting a recipe AND has outputted a result (for probability-based recipes).
Must be filterable by entity type/name and recipe name/category.
Should probably be opt-in like on_entity_destroyed is ...

Go to advanced search