Krastorio 2 - Remove wood from item requirements?

Topics and discussion about specific mods
Post Reply
User avatar
Locane
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Fri Jan 04, 2019 8:46 am
Contact:

Krastorio 2 - Remove wood from item requirements?

Post by Locane »

Is there a way I can modify Krastorio 2 files to remove wood from item requirements?

It's absolutely asinine that a circuit board requires wood. I hate the fact that wood creation is 3 steps up on the tech tree when you start with nothing researched.

User avatar
Locane
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Fri Jan 04, 2019 8:46 am
Contact:

Re: Krastorio 2 - Remove wood from item requirements?

Post by Locane »

Nevermind. I used Cygwin to grep for the relevant definitions, I found most of them in \Krastorio2_0.9.4\prototypes\recipes.

Here is my modified version in case anyone wants it. I commented out the Wood requirement for:

- Basic Tech cards (now requires iron instead)
- Circuits
- Coke

https://drive.google.com/open?id=1AeoAd ... lJMpNtz9u6

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Krastorio 2 - Remove wood from item requirements?

Post by Deadlock989 »

Locane wrote: ↑
Thu Mar 19, 2020 4:38 am
... asinine ... hate ...
What a rude, ungrateful, license-breaking person.
Image

Molay
Fast Inserter
Fast Inserter
Posts: 177
Joined: Thu May 01, 2014 8:01 am
Contact:

Re: Krastorio 2 - Remove wood from item requirements?

Post by Molay »

I thought krastorio license allows this? Though I'll have to second you on the rudeness.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Krastorio 2 - Remove wood from item requirements?

Post by Deadlock989 »

My understanding of the GNU GPL licenses is that you're free to distribute modified versions, but you're expected to include a link to the original source and credit the original authors on top of clarifying exactly what was modified.

Not just call them "asinine" and dump a hastily hacked copy onto a forum without even a name or version number change so that anyone who tries to use it will have those changes immediately overwritten when the real mod next updates, screwing up their saved games.
Image

User avatar
Locane
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Fri Jan 04, 2019 8:46 am
Contact:

Re: Krastorio 2 - Remove wood from item requirements?

Post by Locane »

Sorry for trying to help other people that share my opinion, I suppose.

Saying a design choice (like adding wood to the cost of a circuit) is asinine is not the same as saying a person is asinine.

I'm sorry you disagree with my opinion, feel free not to post about it! :)

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Krastorio 2 - Remove wood from item requirements?

Post by Deadlock989 »

Locane wrote: ↑
Sat Mar 21, 2020 1:20 am
Sorry for trying to help other people that share my opinion, I suppose.
Well, if you're going to be rude and rip off other people's stuff, you could at least do it competently.
Image

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Krastorio 2 - Remove wood from item requirements?

Post by darkfrei »

Locane wrote: ↑
Thu Mar 19, 2020 4:38 am
Is there a way I can modify Krastorio 2 files to remove wood from item requirements?

It's absolutely asinine that a circuit board requires wood. I hate the fact that wood creation is 3 steps up on the tech tree when you start with nothing researched.
You are need new mod with dependency and with the file data-final-fixes.lua:

Code: Select all

local bad_ingredient = "electronic-circuit" -- put here your ingredient name
local removed_from = {}
for recipe_name, recipe in pairs (data.raw.recipe) do
  local handlers = recipe.normal and {recipe.normal, recipe.expensive} or {recipe}
  local fl = false
  for i, handler in pairs (handlers) do
    for j, ingredient in pairs (handler.ingredients) do
      local ingredient_name = ingredient.name or ingredient[1]
      if ingredient_name == bad_ingredient then
        handler.ingredients[j] = nil
        if not fl then
          table.insert (removed_from, recipe_name)
          fl = true
        end
      end
    end
  end
end

log ('removed ' .. bad_ingredient .. ' from [' .. #removed_from .. '] recipes: ' .. serpent.line(removed_from))

torne
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Krastorio 2 - Remove wood from item requirements?

Post by torne »

Deadlock989 wrote: ↑
Thu Mar 19, 2020 1:09 pm
My understanding of the GNU GPL licenses is that you're free to distribute modified versions, but you're expected to include a link to the original source and credit the original authors on top of clarifying exactly what was modified.
While I agree that it's rude and not changing the name or version number is a practical issue for players, the only license issue here I can see is that you're required to state that you modified the work and give the date (section 5a, generally done by adding an additional copyright statement to the existing ones).

Distributions of binaries must include source code (but Factorio mods generally would be considered to be in source code form anyway), the license and copyright statements from the original work must be preserved, and your changes must also be covered by a compatible license, but there is no requirement to add any credit to original authors anywhere, or link to the original version, or describe the modifications in any way.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Krastorio 2 - Remove wood from item requirements?

Post by Deadlock989 »

I understood "preserving the copyright statements from the original work" as "giving credit to the original authors", but I suppose technically that's the case here since the original CREDITS.txt and GENERAL-LICENSE.txt are included.

At least we can agree that this was a dick move. (Apparently that's not the same thing as saying that the person is a dick.)
Image

torne
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Krastorio 2 - Remove wood from item requirements?

Post by torne »

Yeah, the license/copyright info has to be preserved because that's what enables the license to be meaningfully applied (someone is declaring they hold the copyright for the work, and that as the copyright holder they grant these license terms) - so while it looks functionally like "giving credit" that's not really the legal purpose. The GPL is concerned with the rights of the person who receives the code to exercise the freedoms the FSF designed it to preserve, and is *not* really concerned with the rights of the author except inasmuch as the original author can simply "receive" the modified version as well under the same license as everyone else can.

But regardless, from a practical POV here the best thing to do is make a separate mod that updates it in data-final-fixes.lua as darkfrei explains, because forking the mod isn't ideal regardless of the license - if you don't change the name/version it will get overwritten by updates, and if you do change the name or version then dependencies on it from other mods won't work as expected and you might have issues with mods that are supposed to be compatible...

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Krastorio 2 - Remove wood from item requirements?

Post by Deadlock989 »

If we're aiming for absolutely clinical precision in this conversation then I'd point out that it doesn't have to be overwritten in data-final-fixes and ideally shouldn't be. The patching mod needs to depend on K2 and then update the recipe as early as it possibly can, i.e. in the same data stage K2 creates the original recipe in, because any other mods which depend on modifying it would probably prefer to not be screwed up as well.

Or one could just not be a crybaby and chop a few trees down for once in one's life.

darkfrei's code snippet above would turn small power poles into piles of wire and hand out wooden chests for free because it would strip every single recipe in the game that has wood in it. That's also a really undesirable way to remove elements from an integer-indexed array. But I digress.
Image

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Krastorio 2 - Remove wood from item requirements?

Post by ptx0 »

Deadlock989 wrote: ↑
Thu Mar 19, 2020 1:09 pm
My understanding of the GNU GPL licenses is that you're free to distribute modified versions, but you're expected to include a link to the original source and credit the original authors on top of clarifying exactly what was modified.
you are wrong, again. what a rude person.

https://tldrlegal.com/license/gnu-gener ... v3-(gpl-3)

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Krastorio 2 - Remove wood from item requirements?

Post by Deadlock989 »

I don't read ptx0's posts, I expect this is some kind of personal attack from our resident mod thief, who was caught impersonating other modders, and serves up slightly broken versions of other people's work with his own name plastered over it.
Last edited by Deadlock989 on Mon Mar 23, 2020 7:00 pm, edited 4 times in total.
Image

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Krastorio 2 - Remove wood from item requirements?

Post by ptx0 »

Locane wrote: ↑
Sat Mar 21, 2020 1:20 am
Sorry for trying to help other people that share my opinion, I suppose.

Saying a design choice (like adding wood to the cost of a circuit) is asinine is not the same as saying a person is asinine.

I'm sorry you disagree with my opinion, feel free not to post about it! :)
in Space Exploration you can use stone tablet to build the circuits, fwiw.

Post Reply

Return to β€œMods”