Page 1 of 1

[MOD 0.12.X] Concrete 1K

Posted: Sun Sep 27, 2015 12:32 am
by Kane
Type: Mod
Name: Concrete 1K
Description: Changes Concrete Stack size to 1000 from 100
License: idgaf
Version: 0.0.1
Release: 2015-09-26
Tested-With-Factorio-Version: 0.12.8 Should work with 0.12.+
Category: Other/vanilla+
Tags: Concrete
Download-Url: http://stonelegion.com/kane/concrete1k_0.0.1.zip

Picture:
Image

This was inspired to make a simple mod because of this post that I did not agree with but thought why not make a mod so if someone wants it changes they have a mod for it.
https://forums.factorio.com/forum/vie ... 16&t=16501

Re: [MOD 0.12.X] Concrete 1K

Posted: Mon Oct 12, 2015 11:51 pm
by Colossus
Could you add compatibility for the color coding mod? https://forums.factorio.com/forum/vie ... 44&t=13907

I did so just by adding the default ones to the data file, but I'm not very skilled with coding, and don't know if there's a more elegant way, especially since it looks like the color mod was written with customization in mind (users can insert additional colors which wouldn't be captured by my brute force method). Of course, there would need to be detection of the color coding mod too... not sure how to do that either.

Code: Select all

data.raw.item["concrete-red"].stack_size = 1000
data.raw.item["concrete-orange"].stack_size = 1000
data.raw.item["concrete-yellow"].stack_size = 1000
data.raw.item["concrete-green"].stack_size = 1000
data.raw.item["concrete-cyan"].stack_size = 1000
data.raw.item["concrete-blue"].stack_size = 1000
data.raw.item["concrete-purple"].stack_size = 1000
data.raw.item["concrete-magenta"].stack_size = 1000
data.raw.item["concrete-white"].stack_size = 1000
data.raw.item["concrete-black"].stack_size = 1000
data.raw.item["concrete-hazard-left"].stack_size = 1000
data.raw.item["concrete-hazard-right"].stack_size = 1000
data.raw.item["concrete-fire-left"].stack_size = 1000
data.raw.item["concrete-fire-right"].stack_size = 1000

Re: [MOD 0.12.X] Concrete 1K

Posted: Tue Oct 13, 2015 11:10 am
by PiggyWhiskey
Colossus wrote:Could you add compatibility for the color coding mod? https://forums.factorio.com/forum/vie ... 44&t=13907

I did so just by adding the default ones to the data file, but I'm not very skilled with coding, and don't know if there's a more elegant way, especially since it looks like the color mod was written with customization in mind (users can insert additional colors which wouldn't be captured by my brute force method). Of course, there would need to be detection of the color coding mod too... not sure how to do that either.
Detecting color coding mod would be reasonably simple.

Code: Select all

if data.raw.item["concrete-red"] then
  --do something.
  --concrete-red can be any item. If it exists, this section runs.
end

As for finding all concrete, If the mod (and any other mods) are cloning the base game concrete/stone bricks (which I think they would) they should fall in the subgroup of "terrain"
So you could do something like:

Code: Select all

for i, x in pairs(data.raw["terrain"]) do
    x.stack_size = 1000
end
I haven't tested it, it'll only work in data.lua (from what I've managed to google) so you should test it to make sure it only returns the concrete/bricks versions. (Change x.stack_size = 1000 to game.player.print(x.name)