OK, is there guide to upgrate mod to 2.0?

Place to get help with not working mods / modding interface.
Post Reply
AriKhelvi
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 21, 2024 6:40 pm
Contact:

OK, is there guide to upgrate mod to 2.0?

Post by AriKhelvi »

Developer of mod I like is kinda <nowhere>, so I want to do it myself. However, I keep running into issue with -quality Base mod, there is something in recipe that need to be changed. Is there guide for changing recipes?

User avatar
picklock
Fast Inserter
Fast Inserter
Posts: 168
Joined: Sat Nov 09, 2019 6:49 am
Contact:

Re: OK, is there guide to upgrate mod to 2.0?

Post by picklock »

I haven't seen any instructions yet, but I had a similar error message when updating my mods.
For me it was the line with the result of the recipe.
I changed it to the format

Code: Select all

results = {{type="<type>", name="<name>", amount=<amount>}}  } ,
also zum Beispiel

Code: Select all

results = {{type="item", name="night-vision-equipment", amount=1}}  },
and the error was gone for me.
My Mods: Picklocks Fusion Power | Picklocks Inserter | Picklocks Lithium Polymer Accumulator | Picklocks rocket silo stats | Picklocks Set Inventory Filters

AriKhelvi
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 21, 2024 6:40 pm
Contact:

Re: OK, is there guide to upgrate mod to 2.0?

Post by AriKhelvi »

Well, here is the thing:

Code: Select all

Failed to load mods: __core__/lualib/util.lua:803: Recipe has no results: factory-1
stack traceback:
	[C]: in function 'error'
	__core__/lualib/util.lua:803: in function 'normalize_recipe_products'
	__quality__/prototypes/recycling.lua:78: in function 'add_recipe_values'
	__quality__/prototypes/recycling.lua:191: in function 'generate_recycling_recipe'
	__quality__/data-updates.lua:5: in main chunk

Mods to be disabled:
• quality (2.0.7)
And here are snippets of code (that work on 1.11):

Code: Select all

require("prototypes.recipe")

Code: Select all

-- Factory buildings
	{
		type = "recipe",
		name = "factory-1",
		enabled = false,
		energy_required = 30,
		ingredients = {
			{type = "item", name = "stone", amount = 50 * multiplier},
			{type = "item", name = "iron-plate", amount = 50 * multiplier},
			{type = "item", name = "copper-plate", amount = 10 * multiplier}
		  },
		result = {{type = "item", name = "factory-1", amount = 1}}
	},
It cannot find recipe only in 2.0, and it drives ma crazy

User avatar
picklock
Fast Inserter
Fast Inserter
Posts: 168
Joined: Sat Nov 09, 2019 6:49 am
Contact:

Re: OK, is there guide to upgrate mod to 2.0?

Post by picklock »

Well, it is not "result", but "results". There is missung the "s" at the end of "results".
My Mods: Picklocks Fusion Power | Picklocks Inserter | Picklocks Lithium Polymer Accumulator | Picklocks rocket silo stats | Picklocks Set Inventory Filters

AriKhelvi
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 21, 2024 6:40 pm
Contact:

Re: OK, is there guide to upgrate mod to 2.0?

Post by AriKhelvi »

Oh. That explains something...
Still, I have some recipe errors from "recycle" from -quality, sooooo.... I will go and steal work of someone else who is reasonable)

Xorimuth
Filter Inserter
Filter Inserter
Posts: 651
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: OK, is there guide to upgrate mod to 2.0?

Post by Xorimuth »

https://gist.github.com/tburrows13/687f ... a437e86cfa

Here’s a porting guide. Note step 1: disable quality mod when porting!. Your errors are nothing to do with quality mod. Quality mod expects correctly defined recipes, and your recipes are not correctly defined. Disable quality mod and you’ll get actually helpful errors from the game itself.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

Post Reply

Return to “Modding help”