delete/disable prototype

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Blu3wolf
Fast Inserter
Fast Inserter
Posts: 202
Joined: Thu Apr 09, 2015 5:20 am
Contact:

delete/disable prototype

Post by Blu3wolf »

G'day all!

Im curious as to how I would go about disabling a technology added in the base game. Similarly, a recipe, item, etc.

Ive worked out that I can modify the existing ones, but there are some I want to disable entirely. Is this possible? I tried just setting them to nil but that started giving errors on starting the game.

Cheers!

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: delete/disable prototype

Post by Choumiko »

For recipes you could do sth. like (in data-final-fixes.lua or data-updates.lua)

Code: Select all

data.raw["recipe"]["train-stop"].enabled = false
local unlocks = data.raw["technology"]["automated-rail-transportation"].effects
for i, eff in pairs(effects) do
  if eff.name == "train-stop" then
    table.remove(data.raw["technology"]["automated-rail-transportation"].effects, i)
    break
  end
end
Or try what https://forums.factorio.com/wiki/inde ... ipe#hidden does, discovered it a few days ago
If you disable all recipes for items/entities you don't want there's no way to create them, so it sort of works.
For techs you don't want you could remove all effects/costs/prerequisites, that way they are useless and researched as soon as clicked. Not nice but works

Code: Select all

local makeMeUseless = data.raw["technology"]["automated-rail-transportation"]
makeMeUseless.unit=  {  count = 0,  ingredients =  {  },  time = 0}
makeMeUseless.prerequisites = nil
makeMeUseless.effects = nil

User avatar
Blu3wolf
Fast Inserter
Fast Inserter
Posts: 202
Joined: Thu Apr 09, 2015 5:20 am
Contact:

Re: delete/disable prototype

Post by Blu3wolf »

Ive made use of the hidden setting for recipes, but I see that one doesnt work for technologies. I guess Ill have to leave them visible in the tech list and modify the costs/effects as suggested.

Cheers for the help!

Rseding91
Factorio Staff
Factorio Staff
Posts: 13267
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: delete/disable prototype

Post by Rseding91 »

Blu3wolf wrote:Ive made use of the hidden setting for recipes, but I see that one doesnt work for technologies. I guess Ill have to leave them visible in the tech list and modify the costs/effects as suggested.

Cheers for the help!
https://forums.factorio.com/wiki/inde ... gy#enabled
If you want to get ahold of me I'm almost always on Discord.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: delete/disable prototype

Post by Choumiko »

Image
I'll start looking at the wiki first from now on :D

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: delete/disable prototype

Post by ratchetfreak »

looking at the return value of the help() usually also helps. There's one for each object.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13267
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: delete/disable prototype

Post by Rseding91 »

ratchetfreak wrote:looking at the return value of the help() usually also helps. There's one for each object.
The wiki is far more helpful than that output :) it's updated for 0.12 (all except the LuaEntity which i'll be updating shortly here).
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding help”