I would like having the possibility to obtain (and why not change) the direction of an entity/blueprint when it's ready to be placed by the player.
I only need it in on_put_item so adding a direction key to on_put_item event arguments would work as well, I guess it's good idea to have this too.
Add LuaItemStack.direction
Add LuaItemStack.direction
Factorio Mod Portal Notifier - https://fac-notify.ml/
Cut and paste tools - https://mods.factorio.com/mods/mickael9/cut-and-paste
Portable Chests - https://mods.factorio.com/mods/mickael9/portable-chests
Cut and paste tools - https://mods.factorio.com/mods/mickael9/cut-and-paste
Portable Chests - https://mods.factorio.com/mods/mickael9/portable-chests
Re: Add LuaItemStack.direction
The direction something is going to be built is not part of the game state until after the player has built the thing. At that point you get the event and it's already done.
If you want to get ahold of me I'm almost always on Discord.
Re: Add LuaItemStack.direction
Well, I don't see a reason why the direction couldn't be added into the game state.
When on_put_item is called, the entity is not yet created and its creation can even be cancelled by, e.g, doing player.clean_cursor()
This indicates that, the information that an item is being built was indeed added to the game state (along with the item position) and before the corresponding entity was created
So I would think that adding the direction along with the position should be trivial, no?
When on_put_item is called, the entity is not yet created and its creation can even be cancelled by, e.g, doing player.clean_cursor()
This indicates that, the information that an item is being built was indeed added to the game state (along with the item position) and before the corresponding entity was created
So I would think that adding the direction along with the position should be trivial, no?
Factorio Mod Portal Notifier - https://fac-notify.ml/
Cut and paste tools - https://mods.factorio.com/mods/mickael9/cut-and-paste
Portable Chests - https://mods.factorio.com/mods/mickael9/portable-chests
Cut and paste tools - https://mods.factorio.com/mods/mickael9/cut-and-paste
Portable Chests - https://mods.factorio.com/mods/mickael9/portable-chests
Re: Add LuaItemStack.direction
The direction the item is going to be placed is known because the game is showing the direction. Having it be part of the current stack; or having some other method to get it would be quite handy... Or... Know if the entity has been shift-placed in on_built_entity... the on-shift placed item is not a ghost so none of the ghost_ values on the luaEntity work.
Edit : I see; it is; the created_entity.name is 'ghost-entity' I didn't check and assumed it would be the same as event.item as a name.
Edit : I see; it is; the created_entity.name is 'ghost-entity' I didn't check and assumed it would be the same as event.item as a name.