[0.14.21] LuaControl.insert don't have fallback.

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

[0.14.21] LuaControl.insert don't have fallback.

Post by y.petremann »

I'm actually making a mod where your only inventory is the toolbar and I find this quite interesting in game where you can't do anything by hand and must do everything by bots.

The problem here is that I've tested in combination with PeppeBotStart and since I have still unused slots, it can't give me construction bots.

I've dig a bit to look about that and found that LuaControl.insert find the best inventory, but it don't try any other inventory where item can be put, robots can be put in toolbar manually, so I think it should try the toolbar if main inventory is full, in general case, I think that when insertion is requested, it should build a list of inventory ordered by priority for that item, then it should try to insert in them one by one, if it suceed, then it stop there, if it fail for every inventory, it should show the usual message.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: [0.14.21] LuaControl.insert don't have fallback.

Post by daniel34 »

This is not just an issue with LuaControl.insert, the vanilla game also displays this behavior.

Example: Your inventory is completely filled and you stand next to a chest with one stack of construction robots. The toolbar has a few empty slots. Picking up the construction bots from the chest using CTRL+click will just give the message 'Player's inventory full'.

Example 2: Your inventory is completely filled, but contains enough ingredients to craft construction bots. The toolbar has a few empty slots. You craft one construction bot. Because it doesn't fit in the inventory the game will put it on the ground (with the same message as above) instead of putting it into the toolbar.

If you try the two examples above using an assembling machine then they both work as you'll expect, and will put the assembling machine into the toolbar.

The reason is that the construction robot item (in base\prototypes\item\item.lua) has

Code: Select all

    flags = {"goes-to-main-inventory"},
while the assembling machine has

Code: Select all

    flags = {"goes-to-quickbar"},
This is by design. Changing this would mean getting rid of these flags and probably change the way Factorio works in other unexpected ways. The devs have their reasons for introducing these flags. The general rule seems to be that if it's buildable (you can place it in the game-world and it spawns an entity) then it goes into the toolbar.

You could probably make it work by iterating every item and adding the goes-to-quickbar flag to each item. (Note: In that case, every item will prefer using the toolbar, even intermediates like electronic circuits or iron plates.)

Disclaimer: I'm not the one who moved your thread, a dev did. I'm only giving advice as to why it currently works as it does.
quick links: log file | graphical issues | wiki
BenSeidel
Filter Inserter
Filter Inserter
Posts: 591
Joined: Tue Jun 28, 2016 1:44 am
Contact:

Re: [0.14.21] LuaControl.insert don't have fallback.

Post by BenSeidel »

You should be able to enable the flag on every item as I have disabled it for every item because I don't like the control-click behaviour of "put it in my belt" - I want it to be trashed.

I play like this because even with all the items never going to belt, you can still control click on an empty square to replenish your belt when filters are in place. I also find this preferable because I use blueprints of items in by toolbelt as opposed to the actual items, so I don't have to restock anyway (I hate how bots take the item out of my hand).
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: [0.14.21] LuaControl.insert don't have fallback.

Post by y.petremann »

In fact I've done this, but I kinda don't like that kind of thing, my mod keep the ability to add inventory slots with bonuses, which is end-game content and quite limited, by default when there is no more space for a buildable thing, it goes in main inventory, why don't it does the same thing in reverse order for things taged to go in main inventory.
Post Reply

Return to “Ideas and Suggestions”