Heya,
I'm trying to remove an item from the base game, so I can replace it with some other set of items without relying on overriding it.
Is there a way to remove an item from the base game when modding in a new one? For example, at some point I make:
data.raw["recipe"]["solid-fuel-from-petroleum-gas"] = nil
data.raw["item"]["solid-fuel-from-petroleum-gas"] = nil
removing this solid fuel recipe out.
I get an error:
Failed to load mods: Error in assignID: recipe with name 'solid-fuel-from-petroleum-gas' does not exist. It was removed by [modname].
Source: oil-processing (technology).
I tried to remove the entry in the base game technology to remove it:
table.removetablewithmatchingentry(data.raw["technology"]["oil-processing"].effects, "unlock-recipe", "solid-fuel-from-petroleum-gas")
(this is a helper function to find and remove entries that match and ultimately using the table.remove() function to do the dirty work )
It still throws up the error still. I tried the ordering of what is getting removed and when; but alas it still remains.
Is there a way out of this rabbit hole, or is it just better to have it exist and don't refer to it so it sits idle, or just override it completely?
Cheers!
Is there an established way to 'remove' a prototype from the base game?
Re: Is there an established way to 'remove' a prototype from the base game?
Ok, I just rubberducked myself.
I had an issue in the remove.table helper function where the reference isn't checked to see if it finds a valid match and throw an error if it doesn't exist.
Still, the core of the question remains, is it fine to just up and "nil" stuff in the base game?
I had an issue in the remove.table helper function where the reference isn't checked to see if it finds a valid match and throw an error if it doesn't exist.

Still, the core of the question remains, is it fine to just up and "nil" stuff in the base game?
Re: Is there an established way to 'remove' a prototype from the base game?
You should never remove prototypes! If you do that, it's quite likely that you'll break things for other mods. What you can do is hide prototypes of entities, items etc., the recipes that make them, and unlocks in technologies. This way, other mods can still use the prototype to create their own stuff (table.deepcopy(), modify, data:extend()) – but players won't be able to make new items/entities based on the hidden prototypes unless they use a cheat.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Is there an established way to 'remove' a prototype from the base game?
Right, keep the older protoypes and throw a hidden = true on them.
Cheers
Cheers

Re: Is there an established way to 'remove' a prototype from the base game?
You may also want to add hidden_in_factoriopedia= true!
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!