Page 1 of 1
[Mini MOD 0.11.X] [Version 1.3.0] Stack-Breaker
Posted: Thu Oct 30, 2014 1:38 pm
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
Re: [Mini MOD 0.11.1] Item stack Limit breaker
Posted: Fri Oct 31, 2014 11:03 pm
by DraLUSAD
Mod Updated to V1.1.1
Re: [Mini MOD 0.11.1] [Version 1.2] Item stack Limit breaker
Posted: Sun Nov 02, 2014 3:25 am
by DraLUSAD
Mod Update V1.2
Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break
Posted: Mon Nov 03, 2014 10:43 am
by DraLUSAD
Mod Updated to 1.2.1
Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break
Posted: Tue Nov 04, 2014 11:45 pm
by bobingabout
it probably would have been easier using a do for loop.
Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break
Posted: Wed Nov 05, 2014 3:18 am
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
Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break
Posted: Wed Nov 05, 2014 9:23 am
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)
Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break
Posted: Thu Nov 06, 2014 10:54 am
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 :/
Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break
Posted: Thu Nov 06, 2014 6:07 pm
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.
Re: [Mini MOD 0.11.1] [Version 1.2.1] Item stack Limit break
Posted: Tue Nov 11, 2014 3:52 pm
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
Re: [Mini MOD 0.11.5] [Version 1.3.0] Stack-Breaker
Posted: Mon Dec 08, 2014 12:25 am
by DraLUSAD
Mod Updated to V.1.3.0