is free crafting possible?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
trex0113
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Oct 30, 2014 9:48 pm
Contact:

is free crafting possible?

Post by trex0113 »

Is it possible to make a Mod that you allow to craft everything for free. That mean you need no ressources in your inventory to craft items in the crafting window.
Is This Mod possible and when yes how does it work?

mfg trex

cartmen180
Filter Inserter
Filter Inserter
Posts: 358
Joined: Fri Jul 25, 2014 2:53 pm
Contact:

Re: is free crafting possible?

Post by cartmen180 »

Yes this is possible, just remove the ingredients for the crafting recipes.
Check out my mods

JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

Re: is free crafting possible?

Post by JamesOFarrell »

This will be easier in 0.11 as they have added extra loading steps for prototypes so mods can safely modify other mod prototypes

trex0113
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Oct 30, 2014 9:48 pm
Contact:

Re: is free crafting possible?

Post by trex0113 »

hm, is there a faster way to do this or do I have to individually override all recipes. I want to create a Mod like the Creative Mode in Minecraft. But when i have to change all recipes of vanilla and eventually dytech it's a complex work.

cartmen180
Filter Inserter
Filter Inserter
Posts: 358
Joined: Fri Jul 25, 2014 2:53 pm
Contact:

Re: is free crafting possible?

Post by cartmen180 »

there already is a mod similar to that. You can unlock all recipes, select items from a list to your inventory, keep the sun up forever.
It even has its own subforum. look for test-mode
Check out my mods

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: is free crafting possible?

Post by bobingabout »

Try something like.... and this is off the top of my head here so might not be right...

for index, recipe in pairs(data.raw.recipe) do
recipe.ingredients = {}
end

This should Enumerate (or Iterate, depending on programing language) through all instances of recipe, and set the ingredients tag to a list with no entries.

Just have those 3 lines in your data-final-fixes.lua file, and that's pretty much the whole mod.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

trex0113
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Oct 30, 2014 9:48 pm
Contact:

Re: is free crafting possible?

Post by trex0113 »

your genius, thanks for help. It works.

But i have it now in the "prototypes/base-edit.recipe.lua " file.
when i put the script in the data-final-fixes.lua nothing happend.

This works with the vanilla repices but the recipes of the mods are untouched. How can i fix this?

Post Reply

Return to “Modding discussion”