[Mini MOD 0.11.X] [Version 1.3.0] Stack-Breaker

Topics and discussion about specific mods
Post Reply
DraLUSAD
Inserter
Inserter
Posts: 31
Joined: Mon Jul 07, 2014 12:00 am
Contact:

[Mini MOD 0.11.X] [Version 1.3.0] Stack-Breaker

Post by DraLUSAD »

This is my very first mini mod, I'm wanting to mod Factorio, so I'm making some baby steps, and learning certain code and learning other peoples mods and hopes i can finally get one off the ground too :)

as the name says, this mini mod simply just breaks the item limit cap up to 1,000 per stack (Stupid right?), this makes it easier to hold more in one box, rather carrying small stacks

(P.S. Apologies for bad spelling and Grammer, I've never been good at it, as its not my strong point in life)


Mod Updates from newest to oldest
update V1.3.0
update V1.2.1
update V1.2
update V1.1.1
update V1.1
Attachments
stack-breaker_1.3.0.zip
Stack Breaker V.1.3.0
(4.18 KiB) Downloaded 1401 times
Last edited by DraLUSAD on Sat Jan 10, 2015 7:45 am, edited 9 times in total.

DraLUSAD
Inserter
Inserter
Posts: 31
Joined: Mon Jul 07, 2014 12:00 am
Contact:

Re: [Mini MOD 0.11.1] Item stack Limit breaker

Post by DraLUSAD »

Mod Updated to V1.1.1

DraLUSAD
Inserter
Inserter
Posts: 31
Joined: Mon Jul 07, 2014 12:00 am
Contact:

Re: [Mini MOD 0.11.1] [Version 1.2] Item stack Limit breaker

Post by DraLUSAD »

Mod Update V1.2

DraLUSAD
Inserter
Inserter
Posts: 31
Joined: Mon Jul 07, 2014 12:00 am
Contact:

Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break

Post by DraLUSAD »

Mod Updated to 1.2.1

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break

Post by bobingabout »

it probably would have been easier using a do for loop.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

DraLUSAD
Inserter
Inserter
Posts: 31
Joined: Mon Jul 07, 2014 12:00 am
Contact:

Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break

Post by DraLUSAD »

bobingabout wrote:it probably would have been easier using a do for loop.
"do for loop" on what?, the mod?, I'm basically starting out, so I wanted to start tiny somewhere and came up with this, I'm planning on doing a much bigger (Useful) mod but i still know little about how coding/modding works, i could ask for help, but I've had bad experience with help for modding request in the past, and now having to learn on my own, even if it means screwing up somewhere, now I do have a mod design in mind, wrote it down, how it will work and what not, but with out what I know, I'm pretty much grounded until I figure out how it all works.

I've even requested modding help for this topic: https://forums.factorio.com/forum/vie ... =25&t=6452
But appears no one is interested (that or I worded it wrong since my grammar/spelling is extremely poor) so I'll leave it as that

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break

Post by bobingabout »

A marketplace entity exists in the game already. It is used with one of the Scenarios in the Scenario pack, it would be a good idea to look at the code in that to get a head start on the market mod.

The do for loop I mentioned...
Basically, what you've done manually for every item in this mod could have been done using only 3 lines of code.

Code: Select all

for i, item in pairs(data.raw.item) do
  item.stack_size=1000
end
Yes, it's not a do for, it's a for do... I'm not familier enough with LUA to do it entirely off the top of my head.

These lines basically tell the game to run through every single instance of item, then set the stack_size to 1000.

Place that in data-updates, and it will even apply to items in other people's mods. Though be aware that some items in other peoples mods already stack to more than 1000, such as Sand in DyTech, which stacks to 50k (or it did last I played it)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

DraLUSAD
Inserter
Inserter
Posts: 31
Joined: Mon Jul 07, 2014 12:00 am
Contact:

Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break

Post by DraLUSAD »

bobingabout wrote:A marketplace entity exists in the game already. It is used with one of the Scenarios in the Scenario pack, it would be a good idea to look at the code in that to get a head start on the market mod.

The do for loop I mentioned...
Basically, what you've done manually for every item in this mod could have been done using only 3 lines of code.

Code: Select all

for i, item in pairs(data.raw.item) do
  item.stack_size=1000
end
Yes, it's not a do for, it's a for do... I'm not familier enough with LUA to do it entirely off the top of my head.

These lines basically tell the game to run through every single instance of item, then set the stack_size to 1000.

Place that in data-updates, and it will even apply to items in other people's mods. Though be aware that some items in other peoples mods already stack to more than 1000, such as Sand in DyTech, which stacks to 50k (or it did last I played it)
I got it working, but the "Tree-farm" coke coal remains at 50, maybe only works for base, perhaps?

and about the market, just to code into one of my custom maps for it, where you can spend coins for stuff, and get coins for killing enemy entites, maybe even make the market able to sell things once they get unlocked at research, who knows

Edit: ok, i've done something wrong, Ammo wont stack :/

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break

Post by bobingabout »

DraLUSAD wrote:Edit: ok, i've done something wrong, Ammo wont stack :/
Ah, no, I forgot something, that's because Ammo isn't an item class, it's an ammo class.

As for treefarm items, what file did you put it in? data.lua or data-updates.lua? v0.11 added data-updates.lua and data-final-fixes.lua, the idea is that all item and entity definitions should be in data.lua, then all other changes similar to this should be in data-updates.lua, then "this must be done last" things should be done in data-final-fixes.lua.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

DraLUSAD
Inserter
Inserter
Posts: 31
Joined: Mon Jul 07, 2014 12:00 am
Contact:

Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break

Post by DraLUSAD »

I don't know, don't have a clue, this modding system is way too confusing for me, I did modding in the past such as "Terraria" and "Starbound" but they where easy at the time and did a lot, the system here is beyond confusion and I'm struggling to get my mod dream up and running

DraLUSAD
Inserter
Inserter
Posts: 31
Joined: Mon Jul 07, 2014 12:00 am
Contact:

Re: [Mini MOD 0.11.5] [Version 1.3.0] Stack-Breaker

Post by DraLUSAD »

Mod Updated to V.1.3.0

Post Reply

Return to “Mods”