Hello, I've just started looking at factorio modding and I tried to make a mod that would allow you to craft alien science packs from the other science packs (1 of each to be exact)
I have a little skeleton mod going with one recipe however the recipe does not show in the game.
Is it possible to add alternative recipes to vanilla items and if so how would I add one in?
Thanks in advance.
Add alternative recipe for a vanilla item
- darkrising
- Inserter
- Posts: 26
- Joined: Sun May 04, 2014 7:32 pm
- Contact:
- darkrising
- Inserter
- Posts: 26
- Joined: Sun May 04, 2014 7:32 pm
- Contact:
Re: Add alternative recipe for a vanilla item
I'm an idiot, I called the recipe name the exact same thing as the vanilla item!
I didn't realise they used the exact same naming convention as me.
All sorted
I didn't realise they used the exact same naming convention as me.
All sorted
Re: Add alternative recipe for a vanilla item
Actually, I was about to look that up myself. Could I ask you to share how you resolved this problem?
- darkrising
- Inserter
- Posts: 26
- Joined: Sun May 04, 2014 7:32 pm
- Contact:
Re: Add alternative recipe for a vanilla item
I've actually released a mod with the alternative recipe, if you want you can download it and look at the code, here's a link: https://forums.factorio.com/forum/vie ... =14&t=3373Ultimoos wrote:Actually, I was about to look that up myself. Could I ask you to share how you resolved this problem?
All it really is:
-modname-/prototypes/recipe/alien-science.lua
Code: Select all
data:extend(
{
{
type = "recipe",
name = "alien-science-pack2", --the original recipe is called alien-science-pack
energy_required = 12,
ingredients = {
{"science-pack-1", 6},
{"science-pack-2", 3},
{"science-pack-3", 1}
},
result = "alien-science-pack"
}
})
Re: Add alternative recipe for a vanilla item
So all you really do is add a recipe and as a result you give it a vanilla item. So game uses your recipe instead of vanillas. But to achieve that, your recipe has to be loaded after game loads all vanilla mod stuff. Do you somehow have to make sure that game loads your mod last, or it somehow happens automatically?
I'm asking this because situation where we use multiple mods that overwrites the same item is very possible, and that game has to know in what order should it load all those mods?
Sorry, for making this so complicated
I'm asking this because situation where we use multiple mods that overwrites the same item is very possible, and that game has to know in what order should it load all those mods?
Sorry, for making this so complicated
Re: Add alternative recipe for a vanilla item
If you addUltimoos wrote:Do you somehow have to make sure that game loads your mod last
Code: Select all
"dependencies": ["base >= 0.9.8"]
Re: Add alternative recipe for a vanilla item
Thanks, it all makes sense now.