LuaItemStack Rotation access
Posted: Thu Nov 02, 2017 6:19 pm
So, I'm currently working on a blueprint editor.
viewtopic.php?f=97&t=53634
And I've hit a bit of a brick wall with this one. To the point where I've searched through the forums, checked the documentation, checked the hidden docs, and all I could, but didn't find anything.
Maybe I'm missing something really easy.
Basically: When you pick up a blueprint in your hand, it will have an orientation.
If you put it back in your hotbar/inventory, and take it out again, it will keep the same orientation as you left it in
This orientation doesn't affect the entities, or tiles contained in the blueprint
You can check this, by ripping all the info from a blueprint, and creating a new one from a new blueprint (like my mod does on "changing anchor point" using the numpad. All of the entities will be there, but the blueprint will pop back to its original orientation (and out of any toolbar slots).
I could potentially use the event on_player_cursor_stack_changed , and do a keybind for R and SHIFT-R to track the orientation... until the player lets go of the blueprint, at which point I lose track of it.
I could then try to implement a deep table equals, and trawl the player's whole inventory,toolbar, and hand to try to guess which blueprint is being pulled, store all the "rotation states" myself that the game saves...
but that seems A: Overkill. B: Doubling already awkward stateful functionality. C: Too much work for too little output
Does anyone know anywhere where this "rotated direction of blueprint/stack" is exposed? (yes, I have checked LuaEntity, but this is a LuaItemStack issue)
Or would I need to request that the devs expose this as part of the modding API?
viewtopic.php?f=97&t=53634
And I've hit a bit of a brick wall with this one. To the point where I've searched through the forums, checked the documentation, checked the hidden docs, and all I could, but didn't find anything.
Maybe I'm missing something really easy.
Basically: When you pick up a blueprint in your hand, it will have an orientation.
If you put it back in your hotbar/inventory, and take it out again, it will keep the same orientation as you left it in
This orientation doesn't affect the entities, or tiles contained in the blueprint
You can check this, by ripping all the info from a blueprint, and creating a new one from a new blueprint (like my mod does on "changing anchor point" using the numpad. All of the entities will be there, but the blueprint will pop back to its original orientation (and out of any toolbar slots).
I could potentially use the event on_player_cursor_stack_changed , and do a keybind for R and SHIFT-R to track the orientation... until the player lets go of the blueprint, at which point I lose track of it.
I could then try to implement a deep table equals, and trawl the player's whole inventory,toolbar, and hand to try to guess which blueprint is being pulled, store all the "rotation states" myself that the game saves...
but that seems A: Overkill. B: Doubling already awkward stateful functionality. C: Too much work for too little output
Does anyone know anywhere where this "rotated direction of blueprint/stack" is exposed? (yes, I have checked LuaEntity, but this is a LuaItemStack issue)
Or would I need to request that the devs expose this as part of the modding API?