Page 1 of 1

on_player_cursor_stack_changed and inventory source ?

Posted: Thu Aug 04, 2016 12:45 pm
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.

Re: on_player_cursor_stack_changed and inventory source ?

Posted: Thu Aug 04, 2016 11:26 pm
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.

Re: on_player_cursor_stack_changed and inventory source ?

Posted: Thu Aug 04, 2016 11:28 pm
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.

Re: on_player_cursor_stack_changed and inventory source ?

Posted: Fri Aug 05, 2016 7:38 am
by binbinhfr
Ok, then forget it. :(