Infinite Research Extender

Place to get help with not working mods / modding interface.
DJ_Coal
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Apr 29, 2017 7:48 pm
Contact:

Infinite Research Extender

Post by DJ_Coal »

Hello, I'm attempting to create a mod that adds the 0.15 infinite research to many other aspects of the game. I've been trying to add another research that once completed increases the speed of the drill (very similar to the mining drill productivity research, but for speed).

I've tried to extend the research normally but It says the effects i'm using don't exist.

Code: Select all

data:extend(
{
  {
    type = "technology",
    name = "mining-speed-1",
    icon = "__base__/graphics/technology/mining-speed.png",
    --prerequisites = {"advanced-electronics"},
    effects =
    {
      {
        type = "mining-drill-speed-bonus", --I know this doesn't exist
        modifier = 0.02
      }
    },
    unit =
    {
      count_formula = "100*L",
      ingredients =
      {
        {"science-pack-1", 1},
        {"science-pack-2", 1},
      },
      time = 60
    },
    upgrade = true,
    max_level = "3",
    order = "c-k-f-e"
  }
})
I've tried many different effect names/types with no luck. I could possibly get this working if I had access to data.raw in control.lua but I think that's bad practice.

Can anyone point me in the right direction? Is what i'm doing even possible?

Thank you!
orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Infinite Research Extender

Post by orzelek »

Effects are hardcoded in game - you can't simply add new ones.
DJ_Coal
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Apr 29, 2017 7:48 pm
Contact:

Re: Infinite Research Extender

Post by DJ_Coal »

So there is no way to modify the mining_speed of the drill?

This bit of code works great, but it has to be used in data.lua in order to work. Is there anyway to expose mining_speed in control.lua?

Code: Select all

for _,dat in pairs(data.raw) do
	for _,items in pairs(dat) do
		-- Mining Speed
		if (string.find(items.name, "-drill") or string.find(items.name, "pumpjack")) and items.mining_speed and items.mining_speed > 0 then
			items.mining_speed = items.mining_speed * mining_multiplier;
		end
        end
end
Rseding91
Factorio Staff
Factorio Staff
Posts: 14256
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Infinite Research Extender

Post by Rseding91 »

DJ_Coal wrote:So there is no way to modify the mining_speed of the drill?

This bit of code works great, but it has to be used in data.lua in order to work. Is there anyway to expose mining_speed in control.lua?

Code: Select all

for _,dat in pairs(data.raw) do
	for _,items in pairs(dat) do
		-- Mining Speed
		if (string.find(items.name, "-drill") or string.find(items.name, "pumpjack")) and items.mining_speed and items.mining_speed > 0 then
			items.mining_speed = items.mining_speed * mining_multiplier;
		end
        end
end
No, that's not how the game works :P

Prototypes can't be changed runtime - they're immutable after the data stage of loading.
If you want to get ahold of me I'm almost always on Discord.
DJ_Coal
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Apr 29, 2017 7:48 pm
Contact:

Re: Infinite Research Extender

Post by DJ_Coal »

Bummer, thank you!
Post Reply

Return to “Modding help”