Getting the resources required for carft

Place to get help with not working mods / modding interface.
User avatar
SLywnow
Inserter
Inserter
Posts: 30
Joined: Sat Apr 25, 2020 7:37 pm
Contact:

Getting the resources required for carft

Post by SLywnow »

Is there an easy way to get all the initial resources that are required for crafting? Not "iron plate" or "battery", and how much iron, oil, etc needed for crafting? Or can I only find them after 1000 "for"? I only need to get the original resources, which are written, as an example, in creative mode, instead of ingredients.
And I need to get it in data.lua, not in scripts

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Getting the resources required for carft

Post by darkfrei »

SLywnow wrote:
Sun Sep 06, 2020 5:55 pm
And I need to get it in data.lua, not in scripts
Recursive script like:
1. All raw resources
2. All items, that use 1. resources
3. All items, that use items from 2.
Etc.

By every iteration write previous resource items and amounts of them.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Getting the resources required for carft

Post by eradicator »

Some of the big modpacks are very likely to have infinite loops to convert between (waste) products and production chains. A simple example: (H2O) -> (H + 2O) -> (H2O). And no, there is no easy way. You should tell what problem you're actually trying to solve. If you just want to assign a "score" to each item look at the team production scenario.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”