I'm trying to set a different product amount for some drugs, but I keep getting an error that it "doesn't correspond to any field in type ThingDef". I already added the <products>, item defname, and amount, but it's not working. Does changing product amounts work differently for things that use <RecipeMaker> instead of <RecipeDef>, or is there something that I'm doing wrong?
astralflow<xml_files_with_defs>.BeginAccept();
Quote from: mimib14 on March 13, 2017, 10:39:33 PM
I'm trying to set a different product amount for some drugs, but I keep getting an error that it "doesn't correspond to any field in type ThingDef". I already added the <products>, item defname, and amount, but it's not working. Does changing product amounts work differently for things that use <RecipeMaker> instead of <RecipeDef>, or is there something that I'm doing wrong?
Indeed it seems to work differently. I solved this problem in my mod by making a proper recipe.xml in RecipeDefs. You just have to include
<products>
<YourDrug>insertnumberhere</YourDrug>
</products>
in order to get more than one product but I'm sure you already know that.
If you want to add products nested under <RecipeMaker>, it should be in this form:
<RecipeMaker>
<productCount>x</productCount>
</RecipeMaker>
Which is slightly different than just adding <products>. I'm not sure why the difference, just what I've observed from tinkering with xml editing. It does conveniently allow you to put a default product amount in the def that is greater than 1. Hope this helps