Ludeon Forums

RimWorld => Mods => Help => Topic started by: mimib14 on March 13, 2017, 10:39:33 PM

Title: Problem changing product amount for drugs
Post by: 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?
Title: Re: Problem changing product amount for drugs
Post by: RawCode on March 14, 2017, 06:34:21 AM
astralflow<xml_files_with_defs>.BeginAccept();
Title: Re: Problem changing product amount for drugs
Post by: Granitecosmos on March 14, 2017, 11:30:31 AM
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.
Title: Re: Problem changing product amount for drugs
Post by: Krzarb on March 23, 2017, 11:14:54 PM
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