Page 1 of 1

Making a mod that changes another mod's recipes

Posted: Wed Dec 12, 2018 1:15 am
by khadgarion
Hi folks,

I am trying to modify some recipes in a mod I am playing. I have successfully edited the mod's files and made some recipe changes, but I would like to keep my changes separate from the actual mod.

Essentially, I am making a new mod that has a dependency on the old mod.

I made my info.json file, and make the folder structure to match the original mod. I added the lines that I changed into the corresponding .lua files, and while my mod actually does load, no changes have been made to recipes. I feel like I am missing a step. I haven't been able to find much information on modding an existing mod; Does anyone have any suggestions on where I could look, or what I am missing / doing wrong?

edit: adding some more info

One of the files I have changed is the prototypes / recipe / part / assembly.lua file. My file contains this:

Code: Select all

data.raw.recipe["flying-robot-frame"].energy_required = 10
data.raw.recipe["flying-robot-frame"].ingredients = {{"battery-2", 1}, {"control-2", 1}, {"forging-aluminum", 1}, {"motor-2", 1}}
This is basically a copy of the original mod's lines pertaining to the flying robot frame, but with one of the ingredients changed.

Thank you.
Khad

Re: Making a mod that changes another mod's recipes

Posted: Wed Dec 12, 2018 1:41 am
by khadgarion
I think I just answered my own question; I added a data.lua file and put in a require for the file I changed and it worked!

Re: Making a mod that changes another mod's recipes

Posted: Wed Dec 12, 2018 8:07 am
by darkfrei
You can also add require if some another mod is enabled.

Code: Select all

require ("main")

if mods['rso-mod'] then
  require ("mods/rso-mod")
end