[0.13.x] Bob's Mods: General Discussion

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

Moderator: bobingabout

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

Re: [0.13.x] Bob's Mods: General Discussion

Post by bobingabout »

Lithium cobalt oxide is made from Lithium and Cobalt oxide (see cobalt oxide in previous post), in a chemical furnace (or multi-purpose furnace).
The recipe itself is unlocked with the battery 2 research.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
Blaster
Inserter
Inserter
Posts: 41
Joined: Sun Mar 27, 2016 9:16 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by Blaster »

How does one load a rail tanker?
Chrysom
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Sep 08, 2016 7:06 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by Chrysom »

Ok, that's what I thought. The recipe is not showing up when I click on either of the correct furnaces and I have completed all the necessary research. However, It does show up on the menu to request items from my logistics network. Here is a screen shot.
Attachments
Screen Shot 2016-09-08 at 1.25.54 PM.png
Screen Shot 2016-09-08 at 1.25.54 PM.png (3.31 MiB) Viewed 6161 times
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by Nexela »

I think these are the 4 things you need, not 100% sure as my icons are modded :) but they look familiar

just use the maginfying glass and search for cobalt and lithium
Attachments
Screen Shot 2016-09-08 at 1.25.54 PM.png
Screen Shot 2016-09-08 at 1.25.54 PM.png (735.98 KiB) Viewed 6157 times
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by Nexela »

Blaster wrote:How does one load a rail tanker?

You need to use a regular pump connected directly to the middle of the rail tanker. (2 spots on each side of the tanker for up to 4 pumps total, you don't need all 4 just having 1 in any of the spots will fill it)
Attachments
tanker.png
tanker.png (346.59 KiB) Viewed 6157 times
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by bobingabout »

Blaster wrote:How does one load a rail tanker?
Rail tankers aren't part of my mod...
Nexela answered your question anyway.
Nexela wrote:I think these are the 4 things you need, not 100% sure as my icons are modded :) but they look familiar

just use the maginfying glass and search for cobalt and lithium
None of the ones you have highlighted are actually the Lithium Cobalt oxide, which is what he's looking for.

I had to load an older version of the mod, because all my icons are different, and indeed it is missing off that list.



According to everything I'm looking at on my end, once you research Battery 2, you should have access to the material.

My guess is that if you have other mods installed that aren't mine, it is possible that it is also adding battery 2, and removing the unlocks you need. And by the looks of things there, you have some sort of chemistry mod installed. (There's a radiation looking category there anyway)

you can force unlock the recipe like this:

Code: Select all

/c for index, force in pairs(game.forces) do force.recipes["lithium-cobalt-oxide"].enabled = true end
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by Nexela »

Well that's what I get for trying to go by my faulty memory. I should have just loaded it without graphics mods :)
Chrysom
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Sep 08, 2016 7:06 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by Chrysom »

[quote="bobingabout"][/quote]

Code: Select all

/c for index, force in pairs(game.forces) do force.recipes["lithium-cobalt-oxide"].enabled = true end
That worked! :D You are truly a gentleman and scholar. Keep up the good work.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by binbinhfr »

Hi bob,

thx for the correction, but alas there is still a problem :

Code: Select all

function bobmods.lib.machine.has_category(machine, category_in)
  local hasit = false
  if machine and machine.crafting_categories then
    for i, category in pairs(machine.crafting_categories) do
      if category == category_in then
        hasit = true
      end
    end
  else
    log(machine .. " does not exist.")
  end
  return hasit
end
if machine is nil, the line log(machine .. " does not exist.")
creates an error...
that's what happen when a mod (like my Drones) creates a "player" type with no crafting_categories and no mining_categories (that's the new way to prevent a character from crafting since 0.14).
You can test it by installing my mod (last version), then comment lines 15-16 of drones.lua, and you will see the error in bob library.
But I still do not understand why my "player" type creation triggers your bobmods.lib.machine.has_category function...
My mods on the Factorio Mod Portal :geek:
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by bobingabout »

binbinhfr wrote:But I still do not understand why my "player" type creation triggers your bobmods.lib.machine.has_category function...
I think one or more of my mods use this function to scan if assembling machines AND the player has a certain category, and if it does, adds another to the list.
Possibly my electronic hand craftables category.

And those error checks are a pain, they're not very "Safe" and often cause crashes. Maybe I'm just doing it wrong. Though, machine should never be nil anyway, if it is you're using the call wrong. Though, if the issue is that the machine has no crafting categories, that shouldn't effect the log line.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by binbinhfr »

bobingabout wrote:Though, machine should never be nil anyway, if it is you're using the call wrong. Though, if the issue is that the machine has no crafting categories, that shouldn't effect the log line.
Oh infact I made a mistake in reading the error : machine is not nil, the error is that machine is a table value.

Code: Select all

    log(machine .. " does not exist.")
does not like the fact that machine is a table...
bug bob assemb libra.jpg
bug bob assemb libra.jpg (30.1 KiB) Viewed 5980 times
If you comment this "log" line, everything works fine.
or if you write :

Code: Select all

log(machine.name .. " does not exist.")
-----------------------
To be precise, I am not using any call from your mod at all.
What I do is that I just define a new player type like this :

Code: Select all

data:extend(
{
	----------------------------------------------------------------------------------
	{
		type = "player",
		name = "drone-surveillance",
		icon = "__Drones__/graphics/drone-surveillance-icon.png",
		flags = {"pushable", "placeable-player", "placeable-off-grid", "not-repairable", "not-on-map"},
		-- crafting_categories = {"crafting"},   <<<<<<<<<<<<<< COMMENTED
		-- mining_categories = {"basic-solid"},   <<<<<<<<<<<<<<<<< COMMENTED
		inventory_size = 0,
(...)
no crafting_categories and no mining_categories. It is allowed. It prevents the player from crafting or mining anything.

Note that my mod works the way it should for players that do not use bob's mod. But as a lot of players are using them, I'd like to find a solution... ;-)
My mods on the Factorio Mod Portal :geek:
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by bobingabout »

Well, of course it crashes if it's a table, it's designed to specifically accept a single entry.

There's 2 ways you can do it for a table:

Code: Select all

for i, machine in pairs(<put your table here>) --table can either be entered directly between {}, or can a variable that contains a table.
  bobmods.lib.machine.has_category(machine, category) -- value is returned by this line, so do any checks here, it is a check after all
end
Option 2, although there is no array version of the check, one of the reasons to do a check is to either add or remove an existing category.
Now, there is no remove category function programmed in currently, but there is an add, and a conditional add... and the conditional add has a table version
bobmods.lib.machine.type_if_add_category(machine_type, category, category_to_add) is the table version of bobmods.lib.machine.if_add_category(machine, category, category_to_add)
However, where the single machine version accepts a link directly to the entry, the array version (with type in the name) expects a type name instead, so accepts a string, not a table, and accesses data.raw[machine_type]
So, Machine type examples are "assembling-machine" and "player", at least, those are the ones I use.

Does that make sense?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by binbinhfr »

bobingabout wrote:So, Machine type examples are "assembling-machine" and "player", at least, those are the ones I use.

Does that make sense?
It makes sense.
But as I told you, all I do is to declare a new player type (you see it in the code I linked above).
This player type is valid and works perfectly as intended.
I do not mess with your code at all, but apparently it refuses my player definition and I do not understand why...
My mods on the Factorio Mod Portal :geek:
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by orzelek »

binbinhfr wrote:
bobingabout wrote:So, Machine type examples are "assembling-machine" and "player", at least, those are the ones I use.

Does that make sense?
It makes sense.
But as I told you, all I do is to declare a new player type (you see it in the code I linked above).
This player type is valid and works perfectly as intended.
I do not mess with your code at all, but apparently it refuses my player definition and I do not understand why...
My assumption would be that problem is somewhere above in the callstack. I'm guessing that parameter of the call is not a machine even.
Would need to have mod set to figure it out.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by binbinhfr »

Let's go back to the function that poses a problem, because after trying to parse every step of what happens, I always come to the same blocking point that I do not understand :

Code: Select all

function bobmods.lib.machine.has_category(machine, category_in)
  local hasit = false
  if machine and machine.crafting_categories then
    for i, category in pairs(machine.crafting_categories) do
      if category == category_in then
        hasit = true
      end
    end
  else
    log(machine .. " does not exist.")
  end
  return hasit
end
if you read machine.crafting_categories, doesn't it mean that you assume that machine is infact a table with readable members ?
So it is normal that log(machine.."") has a problem with this table, no ?
My mods on the Factorio Mod Portal :geek:
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by Nexela »

orzelek wrote: My assumption would be that problem is somewhere above in the callstack. I'm guessing that parameter of the call is not a machine even.
Would need to have mod set to figure it out.
Bob's function is making incorrect assumptions based on recent api changes

Binbin is creating a valid entity_table with no crafting_categories. -- this is the correct way to define an entity without these categories

bobs function runs via one of bobsmods and picks up this entity_table

if machine and machine.crafting_categories then -- machine is not nil, but machine.crafting_categories is goto else
else
log(machine) -- Error machine is table

So log line should possibly be changed to log(machine.name .. "has no categories")

but this brings potential problems too but these are a lot more minor
what if machine is passed as a string? or nil.

but as bob said machine shouldn't be nil anyway
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by binbinhfr »

Nexela wrote:but as bob said machine shouldn't be nil anyway
Thanks for your analysis that concludes like I do.
As I wrote above, I misread the error message : machine was never equal to nil. The error message said it was a table.

EDIT:
infact when I go back in this post, I see that my initial request maybe already contained the solution (i.e. to separate both tests)

Code: Select all

function bobmods.lib.machine.has_category(machine, category_in)
  local hasit = false
  if machine then
>>>   if machine.crafting_categories then
      for i, category in pairs(machine.crafting_categories) do
        if category == category_in then
         hasit = true
        end
      end
>>>   end
  else
    log(machine .. " does not exist.")
  end
  return hasit
this way, the log() is not even called at all, and everything works perfectly.
Bob, would it be ok for you to include this little change ?
My mods on the Factorio Mod Portal :geek:
elementgermanium
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat May 02, 2015 10:30 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by elementgermanium »

Where is a wiki or other source of information for bob's mods? I want to know the recipes/ores/etc.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by bobingabout »

I didn't even read all the posts but... it should be:

Code: Select all

    log(machine.name .. " does not exist.")
except, it has to exist to get the name from it.


I think this is left over code from when it would take a name, not an entity table.

I mean, if machine doesn't exist... how can you report it not existing, because it's blank?

I'll just delete these machine log lines...
elementgermanium wrote:Where is a wiki or other source of information for bob's mods? I want to know the recipes/ores/etc.
As the mod kept growing and constantly changing, I kinda gave up keeping a record of the recipes etc.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.13.x] Bob's Mods: General Discussion

Post by binbinhfr »

bobingabout wrote:I'll just delete these machine log lines...
Yes that's the good solution. thx bob.
My mods on the Factorio Mod Portal :geek:
Post Reply

Return to “Bob's mods”