Add LuaItemStack.direction

Things that we aren't going to implement
User avatar
mickael9
Fast Inserter
Fast Inserter
Posts: 112
Joined: Mon Mar 14, 2016 4:04 am
Contact:

Add LuaItemStack.direction

Post by mickael9 »

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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14316
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add LuaItemStack.direction

Post by Rseding91 »

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.
User avatar
mickael9
Fast Inserter
Fast Inserter
Posts: 112
Joined: Mon Mar 14, 2016 4:04 am
Contact:

Re: Add LuaItemStack.direction

Post by mickael9 »

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?
d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: Add LuaItemStack.direction

Post by d3x0r »

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.
Post Reply

Return to “Won't implement”