"The first one is free", A simple fix for 'trash' items

This is the place to request new mods or give ideas about what could be done.
Post Reply
Moffmaster
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Mar 15, 2017 10:28 am
Contact:

"The first one is free", A simple fix for 'trash' items

Post by Moffmaster »

This is, I think a very simple to implement mod. Unfortunately, it is still above my own understanding of programming.

For me, one of the most annyoing things in factorio is to deal with random 'trash' items that you tend to pick up. Like a piece of copper wire, an old wooden pole, an iron rod, an old (yellow) underground belt entrance, that kind of thing.
And it gets worse the bigger the mods you use, (like bobs), as the recipes are more complex, and there are more such 'thrash' items to accumulate.

Obviously, a simple solution is to just give yourself more inventory slots, but that changes the game difficulty and also would have to be adjusted to the number of different items in your mods.


Therefore, I would humbly request a mod that does the following:

-On pick up, drop or craft (or every second or so if that is simpler):
-Loops through the player inventory and counts item TYPES.
-Dynamically adds and removes equipment slots. (Basically setting player.character_inventory_slots_bonus = "# of item types found".

This would basically make the first stack of each item type 'free'. Because as soon as you pick it up, you get an extra inventory slot.
This way, you won't have to worry about small amounts of 'random thrash' at all. Only when it becomes more than one full stack, does it take up 'real' space.
It will also allow you to carry a large variety of machines, as is required for mods like angels. This is a welcome side effect.

Does anyone think my request has merit?

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by DedlySpyder »

You may be looking for types +1, btw, not sure if you can even pick an item up if your inventory is full.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2142
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by Ranakastrasz »

I am pretty sure you can detect when you try to pick an item up. Depending on what variables that event throws, it might be possible to detect this, determine what tried to be picked up, validate, and if you get the slot, do so and script picking the item up.

No idea how I might go about doing this however.

-----
The "Real" solution is to stop carrying around trash items, and instead dropping them off in relevant chests, and instead using machines to craft the higher end machines. That way, you have less items to worry about, and way more inventory space.

But yes, I would like this too.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Moffmaster
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Mar 15, 2017 10:28 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by Moffmaster »

Honestly, it doesn't really matter if it is #types or #types +1. Building it so that it notices the new item you are about to pick up and add a slot for it would be nice, but not strictly necessary for the basic concept. Usually, you would have a few free slots to put stuff you want to pick up.

The idea is that the prospective mod 'refunds' you inventory slots for items you either a) accidentially carry or b) carry because the mod you are playing is so large that you need to have lots of different machines on hand.


And "not picking up trash items" is not much of a solution, as they tend to find their way into your inventory by accident, more or less.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2142
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by Ranakastrasz »

True enough.

Ideally, by the time you have enough items to worry about, you have logistic bots and auto-trash slots, such that the trash gets removed from your inventory as soon as it shows up.

Mainly it gets into your inventory when you remove a building that is doing something with the items.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by DedlySpyder »

Here ya go.

Should work in multiplayer and work fine with other mods that mess with the main inventory (from my end of things at least).

There's just a main inventory change event, so just hooking into that made it easy. Kept it at just #types.

Moffmaster
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Mar 15, 2017 10:28 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by Moffmaster »

I just gave it a a test, and it works exactly like what I asked for.

I still check the inventory for trash too often (out of habbit, I suppse), but it does make things much less of a hassle, especially for bigger mods.

So thank you a thousand times for doing this mod! I'm very grateful! I put it in my 'default mods' folder right away.

Moffmaster


PS: All hail DedlySpyder!

Taurondir
Inserter
Inserter
Posts: 43
Joined: Tue Apr 05, 2016 9:34 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by Taurondir »

This actually fixes my issue with the fact that (as an extreme example) if my inventory is full of Oil Refinaries (?), I have to drop 100 of them to pick up 1 Gear.

---

I can't Mod to save my life, but I might look into the code of this "First one is free" to see if I can setup a system where you are allowed "x total ore" and "x total factories" and "x total plates" ... etc etc, so that you can carry 100 factories all up MAX, but in any mixed number, or ores or plates.

This Mod _basically_ allows this already, but with no count limit on the "extra" stacks it creates. My spin on it of course would be only as a "balance" thing to fit between vanilla and this mod. After all, this Mod is quite a large power jump over vanilla, I mean, it's good, but maybe too good? :)

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by steinio »

This mod is great but I have one thing to complain about.
If a new item is inserted in the inventory the crafting menu jumps back to top position instead of staying at scroll position.

Greetings steinio
Image

Transport Belt Repair Man

View unread Posts

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by DedlySpyder »

steinio wrote:This mod is great but I have one thing to complain about.
If a new item is inserted in the inventory the crafting menu jumps back to top position instead of staying at scroll position.
That's the game itself doing that, nothing I can do.
Taurondir wrote:I can't Mod to save my life, but I might look into the code of this "First one is free" to see if I can setup a system where you are allowed "x total ore" and "x total factories" and "x total plates" ... etc etc, so that you can carry 100 factories all up MAX, but in any mixed number, or ores or plates.
Feel free to take what's here and modify it. Check for the loop that increments a count based on the inventory contents. If you check what it's interating over you could probably compare them to a list of items and do your check there.

sparr
Smart Inserter
Smart Inserter
Posts: 1336
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by sparr »

I just auto-trash the stuff I shouldn't be carrying around, and let logistics bots carry it all away.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2142
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: "The first one is free", A simple fix for 'trash' items

Post by Ranakastrasz »

Which is all well and good, once you get to that point in the game. Earlier in the game, it can be just as much a problem.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Post Reply

Return to “Ideas and Requests For Mods”