An assembler, by default, always has direction/orientation zero. If you give it a fluid recipe then it gains a fluid input and can be rotated, with four possible direction/orientation values. If you then reset the recipe, it goes back to reporting a direction and orientation of zero. However, if you go back to a fluid recipe, it magically snaps back to the direction/orientation you rotated it to earlier.
I want to be able to read that remembered direction and orientation, when it's not in effect.
LuaEntity.remembered_direction and orientation for assembler
Re: LuaEntity.remembered_direction and orientation for assembler
You can set off_when_no_fluid_recipe = false and all assemblers must have right orientation.
Re: LuaEntity.remembered_direction and orientation for assembler
This doesn't help with the vanilla assemblers.darkfrei wrote: Tue Apr 24, 2018 10:30 amYou can set off_when_no_fluid_recipe = false and all assemblers must have right orientation.
Re: LuaEntity.remembered_direction and orientation for assembler
This feature already exists under `LuaEntity::direction` read.
Re: LuaEntity.remembered_direction and orientation for assembler
Thanks, the behavior must have changed in the intervening time. I'll go confirm!
EDIT: Confirmed!
EDIT: Confirmed!
Re: LuaEntity.remembered_direction and orientation for assembler
When i checked 0.16.51 that is from 8 years ago, (2 months after the initial post) LuaEntity::direction read was already working like that.
-- edit:
Just checked 0.15.40, it was also working properly there, well before initial post.
-- edit:
Just checked 0.15.40, it was also working properly there, well before initial post.
Re: LuaEntity.remembered_direction and orientation for assembler
I'm sorry. I think the original request was unintentionally mistakenly broad.
I can reproduce the problem in 2.1.18 and 0.15.40 with LuaEntity.orientation but not with .direction:
Place assembling machine 2
Set recipe to barreling
Rotate 90 degrees
/c game.player.print(game.player.selected.orientation) -> 0.25
clear recipe
/c game.player.print(game.player.selected.orientation) -> 0
Set recipe to barreling
/c game.player.print(game.player.selected.orientation) -> 0.25
I can reproduce the problem in 2.1.18 and 0.15.40 with LuaEntity.orientation but not with .direction:
Place assembling machine 2
Set recipe to barreling
Rotate 90 degrees
/c game.player.print(game.player.selected.orientation) -> 0.25
clear recipe
/c game.player.print(game.player.selected.orientation) -> 0
Set recipe to barreling
/c game.player.print(game.player.selected.orientation) -> 0.25
Re: LuaEntity.remembered_direction and orientation for assembler
CraftingMachine has direction but not orientation. Trying to read orientation falls back onto default implementation that converts direction into orientation but only when entity declares usin direction. In this case crafter provides direction while also declaring it does not use direction.
Re: LuaEntity.remembered_direction and orientation for assembler
I posted viewtopic.php?t=59570 requesting a way to identify which entities don't have orientation and would behave this way.

