[0.12.x][v0.12.6] Bob's Electronics

Some mods, made by Bob. Basically streaks every Factroio-area.

Moderator: bobingabout

Should this mod add the new Bob style electronics as stand alone?

Poll ended at Thu Jun 18, 2015 9:25 pm

Move the electronics out of Bob's MCI into Bob's Electronics mod (Renamed from Electronics Overide) (The mod Adds my electronics, and sets the overides)
8
73%
Leave it as is (Can only be used with Bob's MCI)
3
27%
 
Total votes: 11

Chronicon
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Oct 29, 2016 4:07 pm
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by Chronicon »

okay thanks, from what you have said it is probably a mod conflicting with yours

User avatar
Estelyen
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 19, 2017 2:38 pm
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by Estelyen »

I'm in the process of learning lua right now and since I really enjoy your mods, I took a look at the underlying code. I have a general idea how you made it work now, but there's one thing I'm still trying to figure out: How your mod replaces the ingredients of the base mod recipes. For instance, if I wanted to make the recipe for the offshore pump require Electronic Processing Board instead of Electronic circuits or Basic Circuit Board, where would I have to make that change? Can't seem to find it anywhere :( Yes, I know that change would make absolutely zero sense, but as I said, just trying to learn here.

There's some recipe ingredient replacement functions in your library and the prototypes/recipe-updates.lua in this mod calls one of them for a few items, but only a few and changing that function call or adding another one there doesn't seem to do anything.

Also, the data-final-fixes.lua calls the replace in all function four times, but the order of its arguments makes it look like it would change the modded recipes back to the vanilla ones, which highly confuses me :?

Don't worry, I'm not intending to publish anything of I'm doing to your mods, I'm just experimenting in private so I can test and increase my fledgling lua knowledge :mrgreen: I hope you don't mind if I ask these questions here. As I said, your mods are amazing!

ukezi
Filter Inserter
Filter Inserter
Posts: 387
Joined: Sat Jul 02, 2016 11:02 pm
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by ukezi »

he uses a function of the lib for that. I believe it's in data-update of electronic. the game loads mods by 1. building a dependency tree 2. load data from root to leaf 3. load data-update form root to leaf. I don't know if it does depth or breath first.

User avatar
Estelyen
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 19, 2017 2:38 pm
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by Estelyen »

Ah I think I got it: The mod doesn't change any base mod recipes at all, it just replaces the items with modded ones (using dytechs advanced processing unit for its tier 4) :o

So to answer my own question from above, I can't change the mod itself to do it, but I could edit the recipe myself by adding

Code: Select all

data.raw.recipe["offshore-pump"].ingredients =
{
   {"pipe", 1},
   {"iron-gear-wheel", 1},
   {"advanced-processing-unit", 2},
   
}
, correct? :D

ukezi
Filter Inserter
Filter Inserter
Posts: 387
Joined: Sat Jul 02, 2016 11:02 pm
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by ukezi »

well that would be changeing them, wouldn't it? he doesn't state all the recipes directly but goes to all of them with a loop and uses the function in his lib to replace the items. that's how it also changes all the recipes of mods.
also there is an other step after data updates, data updates final.

Code: Select all

bobmods.lib.recipe.replace_ingredient_in_all("basic-electronic-circuit-board", "electronic-circuit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-circuit-board", "advanced-circuit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-processing-board", "processing-unit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-processing-board-2", "advanced-processing-unit")

if data.raw.item["basic-electronic-circuit-board"] then
  data.raw.item["basic-electronic-circuit-board"] = nil
end

if data.raw.item["electronic-circuit-board"] then
  data.raw.item["electronic-circuit-board"] = nil
end

if data.raw.item["electronic-processing-board"] then
  data.raw.item["electronic-processing-board"] = nil
end

if data.raw.item["electronic-processing-board-2"] then
  data.raw.item["electronic-processing-board-2"] = nil
end

User avatar
Estelyen
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 19, 2017 2:38 pm
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by Estelyen »

ukezi wrote:well that would be changeing them, wouldn't it?
Yes, and that was my initial question, as I thought this mod would do just that.
ukezi wrote:

Code: Select all

bobmods.lib.recipe.replace_ingredient_in_all("basic-electronic-circuit-board", "electronic-circuit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-circuit-board", "advanced-circuit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-processing-board", "processing-unit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-processing-board-2", "advanced-processing-unit")
This is the thing that still confuses me a bit, since the function actually takes the item to replace as the first argument and the replacing item as the second, so these function calls would replace any modded electronic item ingredients with vanilla ones (which in turn have been changed by this mod). So I guess these lines are just meant for recipes added in other mods to "get them in line" or something?

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

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by bobingabout »

Estelyen wrote:
ukezi wrote:well that would be changeing them, wouldn't it?
Yes, and that was my initial question, as I thought this mod would do just that.
ukezi wrote:

Code: Select all

bobmods.lib.recipe.replace_ingredient_in_all("basic-electronic-circuit-board", "electronic-circuit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-circuit-board", "advanced-circuit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-processing-board", "processing-unit")
bobmods.lib.recipe.replace_ingredient_in_all("electronic-processing-board-2", "advanced-processing-unit")
This is the thing that still confuses me a bit, since the function actually takes the item to replace as the first argument and the replacing item as the second, so these function calls would replace any modded electronic item ingredients with vanilla ones (which in turn have been changed by this mod). So I guess these lines are just meant for recipes added in other mods to "get them in line" or something?
The ones on the left are "Old" names from when electronics was not only part of the plates mod, but also added electronics alongside the old ones. This remains in the game mostly for legacy reasons, since you can't actually use old mods with newer versions of the game, this in theory could be removed now, and we only need a migration script to replace them if loading old savegames.

Considering there were effectively 2 entire trees of electronics, changing it to a replacement seemed like the way to go.

Also, there are some actual replacements for base game recipes around the place, Battery is one that has been completely replaced, and a lot of the very low tech items have had the electronic-circuit replaced by the basic-circuit-board.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Uiop44000
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Apr 03, 2017 7:14 pm
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by Uiop44000 »

Not sure if this has been asked before, but when I get Oil Processing & Plastics researches, the recipes requiring wood automatically change into Synthetic Wood. I'm not particularly fond of this, but I can live with it. However, to make the wood, I need to actually make Oil Refineries and Chemical Plants, which themselves require the wood, so I can't actually do anything at the moment. How can I fix this?

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

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by steinio »

Uiop44000 wrote:Not sure if this has been asked before, but when I get Oil Processing & Plastics researches, the recipes requiring wood automatically change into Synthetic Wood. I'm not particularly fond of this, but I can live with it. However, to make the wood, I need to actually make Oil Refineries and Chemical Plants, which themselves require the wood, so I can't actually do anything at the moment. How can I fix this?
You can craft wood with assemblers or per hand and then all other things.
I guess you need circuits which production should also be automated before chem plants.

It's a Factorio bug at selecting recipes in wrong order.
This mod should also fix this: https://mods.factorio.com/mods/Xuerian/ ... ndcrafting

Greetings steinio
Image

Transport Belt Repair Man

View unread Posts

Engimage
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by Engimage »

Uiop44000 wrote:Not sure if this has been asked before, but when I get Oil Processing & Plastics researches, the recipes requiring wood automatically change into Synthetic Wood. I'm not particularly fond of this, but I can live with it. However, to make the wood, I need to actually make Oil Refineries and Chemical Plants, which themselves require the wood, so I can't actually do anything at the moment. How can I fix this?
Actually recipes do not change. The new recipe is added yes. Both recipes remain in the game and you can opt to use any of them. However the recipes are on different pages (groups) so it might confuse you as they are not near each other.
Bob's mods do provide several options to get many things so you should choose carefully which recipe fits you most.

The greatest example would be Lead Plates that you require for batteries. You might opt to just smelt Lead Ore and get Sulfuric Acid from Oil but there is a more complex way by producing Lead Oxide from ore with Oxygen from electrolysis which will get you Sulfur Dioxide in the quantity exactly enough for the equal amount of lead plates for your batteries. You will need plastic anyways but you will not bother producing sulfuric acid from oil.

Uiop44000
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Apr 03, 2017 7:14 pm
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by Uiop44000 »

steinio wrote:
Uiop44000 wrote:Not sure if this has been asked before, but when I get Oil Processing & Plastics researches, the recipes requiring wood automatically change into Synthetic Wood. I'm not particularly fond of this, but I can live with it. However, to make the wood, I need to actually make Oil Refineries and Chemical Plants, which themselves require the wood, so I can't actually do anything at the moment. How can I fix this?
You can craft wood with assemblers or per hand and then all other things.
I guess you need circuits which production should also be automated before chem plants.

It's a Factorio bug at selecting recipes in wrong order.
This mod should also fix this: https://mods.factorio.com/mods/Xuerian/ ... ndcrafting

Greetings steinio
Works now, thanks for the help. :D

User avatar
featherwinglove
Filter Inserter
Filter Inserter
Posts: 579
Joined: Sat Jun 25, 2016 6:14 am
Contact:

Re: [0.12.x][v0.12.6] Bob's Electronics

Post by featherwinglove »

featherwinglove wrote:I've logged in with a proposal of my own that I'm a bit lazy to code myself.
Not anymore :mrgreen:
As electronics have evolved in real life, older devices (e.g. ball mice and portable Phillips' cassette players e.g. Sony Walkman) have been replaced by newer devices which are either cheaper/easier on power and of equivalent functionality (e.g. optical mice) or better functionality (e.g. portable Flash/MP3 players e.g. iPod.) Some (not all, 555 and 7400 fans!) components have gone out of production. In a lot of cases, older functions are performed by newer circuits. My equivalent proposal for Bob's Electronics is called Panelization, and I think it would be quite handy for some players who would like to toss older tier electronics factories even if they still need their older tier electronics boards.
Also saves an
lol
tonne of copper.

So I typed for about 15 minutes, scratched my head forgetting about require(prototypes) for about 20 minutes, fixed syntax errors for an hour, and got this, nerfed from my original proposal (which makes basic circuits hilariously cheap). Have fun!
Panelized Circuits
Think I should do more on this idea or would you like to take it from here?

Post Reply

Return to “Bob's mods”