on_player_cursor_stack_changed and inventory source ?

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

on_player_cursor_stack_changed and inventory source ?

Post by binbinhfr »

Hi,

it would nice if in the on_player_cursor_stack_changed event, we could know where this stack comes from.
If it comes from an inventory, a inventory_source (and entity_source) would be nice

ex : if I pick from player main inventory, it will return
entity = player.character
inventory = player inventory

if I pick from a chest, it will return
entity = chest
inventory = the concerned inventory

If I pick from a furnace, etc...

PS : to avoid returning the entity, but just the inventory, it would be nice that LuaInventory contains "entity" : the entity that ows the inventory.
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 15137
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_player_cursor_stack_changed and inventory source ?

Post by Rseding91 »

The way it works now there's no way to know who changed what when the event is fired. Even the game doesn't know who changed what.

The entire inventory system in Factorio doesn't know who changed what. All it knows is when something is changed.

So, this isn't likely to ever happen.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15137
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_player_cursor_stack_changed and inventory source ?

Post by Rseding91 »

As for "owner" of an inventory: an inventory can exist not owned by an entity. It could be owned by the god controller which isn't an entity or it could be owned by a blueprint book on the ground - the blueprint book isn't an entity but it owns the inventory.
If you want to get ahold of me I'm almost always on Discord.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: on_player_cursor_stack_changed and inventory source ?

Post by binbinhfr »

Ok, then forget it. :(
My mods on the Factorio Mod Portal :geek:
Post Reply

Return to “Modding interface requests”