[B18] Universal Fermenter (2017-11-18)

Started by Kubouch, June 07, 2017, 08:09:22 PM

Previous topic - Next topic

notfood

#15
I'm no fan of the current syntax. Taking the example from the wiki, this would be more understandable. Use Verse.FloatRange instead of lists of floats.

<ThingDef ParentName="BuildingBase">
  ...
  <thingClass>Kubouch.Building_UniversalFermenter</thingClass>
  ...
  <comps>
    <li Class="Kubouch.CompProperties_UniversalFermenter">
      <ingredient>Wort</ingredient>
      <products>
        <li>
          <thingDef>Lager</thingDef>
          <temperatureSafe>
            <min>0</min>
            <max>15</max>
          </temperatureSafe>
          <temperatureIdeal>
            <min>5</min>
            <max>15</max>
          </temperatureIdeal>
        </li>
        <li>
          <thingDef>Ale</thingDef>
          <temperatureSafe>
            <min>5</min>
            <max>30</max>
          </temperatureSafe>
          <temperatureIdeal>
            <min>15</min>
            <max>30</max>
          </temperatureIdeal>
        </li>
      </products>
    </li>
    <li Class="CompProperties_Forbiddable"/>
  </comps>
  <tickerType>Rare</tickerType>
  ...
</ThingDef>

Kubouch

Quote from: notfood on June 12, 2017, 10:40:26 PM
I'm no fan of the current syntax. Taking the example from the wiki, this would be more understandable. Use Verse.FloatRange instead of lists of floats.

I agree, it's not really understandable. I really appreciate these suggestions since this is basically my first mod ever and I don't know much. Something to do for the next version!

Bombadil

Thanks for putting this up, it looks good. Is it possible to have a differing amount of ingredients and products? E.g. 1 ingredient and 10 products. The idea was to re-skin it as a beehive - 1 queen bee in results in 10 honeycomb later. Also, are recipes with multiple ingredients possible? E.g. 2 mushroom spore + 10 compost = 20 mushrooms. My understanding of your wiki suggests that these two things are not currently possible.

Kubouch

Quote from: Bombadil on June 19, 2017, 06:13:02 PM
Thanks for putting this up, it looks good. Is it possible to have a differing amount of ingredients and products? E.g. 1 ingredient and 10 products. The idea was to re-skin it as a beehive - 1 queen bee in results in 10 honeycomb later. Also, are recipes with multiple ingredients possible? E.g. 2 mushroom spore + 10 compost = 20 mushrooms. My understanding of your wiki suggests that these two things are not currently possible.

You're right, they are not possible (yet). Right now it is only one amount for both. Also you can have only one particular thing as an ingredient and product.

I am now working on implementing the notfood's suggestion above (that's done) and trying to make it possible for ingredients to be multiple resources (using i.e. the recipe bills syntax with ThingFilters). I'll try to add a support for different amounts, too. I'm not sure if I can make the new version before July, though.

Bombadil

Thanks for your efforts, but the changes for the situation I gave are not actually necessary - I thought of a work around. I can just make an intermediate material step. Using the mushroom example I can make a recipe to "prepare starter", 2 spore + 10 compost = 20 starter so then it is the possible 20:20 ingredient:product amount that works.

Kubouch

I now implemented the 2 features mentioned by Bombadil:

  • Multiple ingredients per product: This is done using ThingFilter, the same way as Refuelable CompProperty.
  • Efficiency component property: By modifying this you can set less/more output product than the maxCapacity.
Also I made a better syntax as suggested by notfood (with a separate ingredient filter for each product).

Soon I'll make a new release and update the Wiki (since the syntax is completely changed now) but for now you can get it from the development branch and test it.

notfood

Thank you. I'm using this in HardcoreSK pack so it's reaching a lot of users. Soon though. heheh.

I did a minor modification to the syntax. Instead of defName I put result.

Kubouch

#22
New version (a17.4.0)!


  • XML syntax is now more readable.
  • Ingredients are set up by ThingFilter so now it is possible to have multiple ingredients per product.
  • New <efficiency> property for setting the product yield. It allows to have different amount of products and ingredients.
  • New changelog.

Download:
    Universal Fermenter (a17.4.0)

For more info check the examples and parameters' overview.

Enjoy!

Kubouch

Quote from: notfood on July 04, 2017, 07:33:43 PM
Thank you. I'm using this in HardcoreSK pack so it's reaching a lot of users. Soon though. heheh.

I did a minor modification to the syntax. Instead of defName I put result.

Great, feel free to include and modify it as you please :-).
I suppose you are refering to the <thingDef> tag. Personally, I like it as it is because it gives you a hint what exactly you should put there.


Kubouch


Kubouch

#26
Update (a17.4.2)!


  • Summary listing added ingredients now trims out vowels in case it is too long.
  • Using a static class instead of [StaticConstructorOnStartup] + a new Utils class (these changes are not noticeable in-game).

Download:
    Universal Fermenter (a17.4.2)

Just popped out a new update while working on a new version and drinking coffee on my backyard. No need to change anything in your XML.

Enjoy!

EDIT: I had a missing file in a17.4.1. Fixed the derp in a17.4.2.

Kubouch

New version (a17.5.0)!


  • Custom building class is no more required. All the functionality is handled by the Comp class.
  • Some changes to the inspector string (building info in the bottom-left box).

Download:
    Universal Fermenter (a17.5.0)

From now on, the class Kubouch.Building_UniversalFermenter doesn't exist anymore and all the functionality is achieved solely by adding the Kubouch.CompProperties_UniversalFermenter. Otherwise the syntax is unchanged. This change allows for adding the Universal Fermenter functionality to any building class (or at least should - haven't tested that properly yet).

Another change is the inspector string. I shrank the lines to max. 5 lines. There is still one line left for other building/comp classes to fill.

Now I need to run through some compatibility checks and see how it blends with other vanilla building/comp classes and some mods. Right now, for example, it is necessary to use the Rare ticker which probably screws up the Refuelable comp compatibility. I need fix the mod to work with both Normal and Rare ticker types (seems easy).

Enjoy!

Dark_Inquisitor

This mod is amazing. When you'll add a possibility to require power to progress fermentation you'll be able to make literally everything... Just imagine that!

Kubouch

Quote from: Dark_Inquisitor on July 17, 2017, 08:26:07 PM
This mod is amazing. When you'll add a possibility to require power to progress fermentation you'll be able to make literally everything... Just imagine that!

Definitely. For the next release I plan to go through vanilla comps and see how compatible they are with my mod and possibly make them work together. Power component together with Refueable are definitely on my list. This would allow a lot more possibilities: electric ovens, smoking pits, automatic human meat crushers... well, stuff like that :-D.