How to add Results to Recipes old?
Posted: Thu Jun 01, 2017 6:23 am
Hello world and the Factorio community! I have been a huge fan of this game since its release and all the mods out there are awesome too; I really enjoy the added complexity, challenge and modularity lent to the game by Bob's, Angel's, Evolution, Bio Processing, HardCrafting, Youki's, Robot Army, etc.
To the topic at hand, how do I add a result to a vanilla recipe? I have been working on a mod off and on for the past month. With summer here, I am dedicating more time to it. One thing I've managed to do is make it so furnaces yield two items. For example, magnetite ore smelts to iron plate and iron slag. Alas, I've hit a road block! How does one add to the results of an existing recipe? Here is what I have tried thus far...
This code attempts to completely rewrite the old recipe, but flags this error message: "Failed to load mods: error while loading recipe prototype "stone-brick" (recipe): Key "icon" not found in property tree ROOT.recipe.stone-brick Modifications: Base Mod > Slave to the System"
Yes, my mod's name is "Slave to the System" in honor of a song I liked from the command and conquer series. The title also seems appropriate for the direction this mod is going.
This code attempts to add a result to the recipe, but flags this error message: "Failed to load mods: __slave_to_the_system__/data.lua:13:...system__/prototypes/vanilla-extension/recipe-extension.lua:7:bad argument #1 to 'insert' (table expected, got nil)"
This probably falls into the category of GenFrogKing-doesn't-know-Lua... .
<.<
>.>
Help greatly appreciated!
Also, as a part two question, I want to know what sort of legal issues might arise with my mod. I'm making a compilation mod that revisits many of the mods I've mentioned and tweaks them to my liking. It also adds elements that are entirely my own creation. My questions are these: Do I need permission from the original mod developers to do this? What do I need to be aware of? Any sort of direction here would be appreciated! My goal here is not to take credit or step on any toes, but just to make what I believe will be an awesome extension of the Factorio experience; especially for those hardcore/masochistic players like me and my friends!![Laughing :lol:](./images/smilies/icon_lol.gif)
To the topic at hand, how do I add a result to a vanilla recipe? I have been working on a mod off and on for the past month. With summer here, I am dedicating more time to it. One thing I've managed to do is make it so furnaces yield two items. For example, magnetite ore smelts to iron plate and iron slag. Alas, I've hit a road block! How does one add to the results of an existing recipe? Here is what I have tried thus far...
Code: Select all
data.raw.recipe["stone-brick"].results = {{"stone-brick",2},{"rock-slag",1}}
Yes, my mod's name is "Slave to the System" in honor of a song I liked from the command and conquer series. The title also seems appropriate for the direction this mod is going.
Code: Select all
table.insert(data.raw["recipe"]["stone-brick"].results, {type="item", name="rock-slag", amount=1})
This probably falls into the category of GenFrogKing-doesn't-know-Lua... .
<.<
>.>
Help greatly appreciated!
Also, as a part two question, I want to know what sort of legal issues might arise with my mod. I'm making a compilation mod that revisits many of the mods I've mentioned and tweaks them to my liking. It also adds elements that are entirely my own creation. My questions are these: Do I need permission from the original mod developers to do this? What do I need to be aware of? Any sort of direction here would be appreciated! My goal here is not to take credit or step on any toes, but just to make what I believe will be an awesome extension of the Factorio experience; especially for those hardcore/masochistic players like me and my friends!
![Laughing :lol:](./images/smilies/icon_lol.gif)