Is there an XML-only way to make the product of a recipe dependent on the input?

Started by Lupin III, September 22, 2015, 06:46:03 PM

Previous topic - Next topic

Lupin III

I would like to make a mod that allows me to repair apparel and weapons. Both should work on the core tailoring/smithing table. It would like it to be a single recipe for each table. So take any apparel in and output the same apparel just with 100% hitpoints. I don't care if the color changes or if the quality changes. Quite the opposite, it would be a nice touch if a bad tailor might get the hitpoints to 100% but randomly drops the quality from "legendary" to "shoddy" ;) . But the material has to stay the same. (in essence very similar to what stonecutting and butchering does)
I've managed to make a recipe that takes any apparel(weapon) to the bench and gets worked on. But when finisched it vanishes into thin air, because I don't know what should be specified as a product. Is this even possible with just an XML recipe or does this have to be a DLL mod?

<?xml version="1.0" encoding="utf-8" ?>
<RecipeDefs>

<RecipeDef>
<defName>Lupin_MendApparel</defName>
<label>mend apparel</label>
<description>Mend clothing</description>
<jobString>Mending.</jobString>
<workAmount>1400</workAmount>
<workSpeedStat>TailoringSpeed</workSpeedStat>
<workSkill>Crafting</workSkill>
<workSkillLearnFactor>0.1</workSkillLearnFactor>
<effectWorking>Tailor</effectWorking>
<soundWorking>Recipe_Tailor</soundWorking>
<ingredients>
<li>
<filter>
<categories>
<li>Apparel</li>
</categories>
</filter>
<count>1</count>
</li>
</ingredients>
<fixedIngredientFilter>
<categories>
<li>Apparel</li>
</categories>
</fixedIngredientFilter>
<recipeUsers>
<li>TableTailor</li>
</recipeUsers>
</RecipeDef>

</RecipeDefs>

1000101

afaik, there is no way of changing the output of a recipe which wouldn't break things.  If such a thing was done, it certainly wouldn't be "xml only," that definitely isn't possible.

There used to be a mending table mod, but I'm not sure how old it is now, certainly not current.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

skullywag

mending has an a12 version in the thread somewhere i think. ive done repairing power armour, but thats totally different to repairing apparel that could be made from all kinds of things. As 1000101 states not xml only.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

RawCode

XML allows to alter things already present, if you want something new, you will need DLL, in some cases you will need native DLL.

Lupin III

I know the mending mod and it works in a12 (that's where I got the word "mend" from; I'm not a native english speaker and wouldn't have thought of that word otherwise ;) ). But there are a few things I don't like about it. First it adds a new work type, which makes it a PITA to add and remove from an existing game. Adding a new work type also makes it more prone to be incompatible with other mods. The work itself is not attached to any skill and does not give any experience, while it would be much more sensible to do the mending and the tailor/smithing table depending on the crafting skill.

Quote from: RawCode on September 23, 2015, 04:22:35 AM
XML allows to alter things already present, if you want something new, you will need DLL, in some cases you will need native DLL.
The inputs and outputs aren't new things. If I wanted, I could make a recipe for every apparel/weapon there is. But apart from making the bills menu of the worktables almost unuseable because of recipe overflow and the tedious work of assigning the recipe for every apparel your colonists wear, it would also mean that apparels/weapons that are not from core won't have a bill.

So the things the stonecutting table and the butcher table do (the output of the single recipe "make stone blocks" is dependent on the chunk used/the created meat of "butchering" is dependent on the corpse used) are hardcoded into core?

Fluffy (l2032)

I was actually going to suggest something similar, both stone chunks and corpses are butchered for blocks and meat respectively. You could theoretically create a recipe with a fixed filter input of apparel, and have it butcher the apparel. The apparel would all need to define itself as it's own butchery product.

I'm not sure if this will work, but it's probably the closest you'll get without a custom dll. A custom dll for a new specialProducts class of repair (instead of melting or butchery) which assigns the input as the output would be a more viable option (would just require a new recipe), but then we're talking custom DLL (and I'm not even sure you can just plug in a new specialProducts class without overwriting a lot of extra crafting code).

Lupin III