I want to set the current position of the hand so that when I create the entities they will start with the hand in the right spot, rather than having to animate to get there.
Writable LuaEntity:held_stack_position
Writable LuaEntity:held_stack_position
I want to set the current position of the hand so that when I create the entities they will start with the hand in the right spot, rather than having to animate to get there.
Last edited by sparr on Sun May 07, 2017 6:02 pm, edited 1 time in total.
Re: Writable LuaEntity:held_stack and held_stack_position
held_stack is an inventory stack so doing this will work inserter.held_stack.set_stack({name=item, count=1})
Last edited by Nexela on Sun May 07, 2017 6:12 pm, edited 1 time in total.
Re: Writable LuaEntity:held_stack_position
Thanks. It is a LuaItemStack and you seem to be right! Halfway there!
Re: Writable LuaEntity:held_stack_position
I still have a use case for this. I have a mod that constructs the ghosts near the player, and I'd like to animate inserter arms Doctor Octopus style, but I need to be able to set their hand position to get the animation right.
Re: Writable LuaEntity:held_stack_position
This is unlikely to be implemented in the proposed form because held_stack_position is not a primary variable, it is a result of a function computed based on inserter's hand distance, hand height and head orientation. Thats 3 degrees of freedom and if a vector was given it would only provide 2 constraints which is not enough.
Hand distance and hand orientation have quite precise meaning but the hand height is an additional factor used to make inserter movement more interesting which is why held_stack_position read exists: it allows matching actual movement of inserter hand. If this write was done, it would have to change head orientation and hand distance while keeping hand height parameter fixed which may cause some miniscule artifacts about inserter behavior near ends of movement as the hand could be too high repeatably.
Hand distance and hand orientation have quite precise meaning but the hand height is an additional factor used to make inserter movement more interesting which is why held_stack_position read exists: it allows matching actual movement of inserter hand. If this write was done, it would have to change head orientation and hand distance while keeping hand height parameter fixed which may cause some miniscule artifacts about inserter behavior near ends of movement as the hand could be too high repeatably.

