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

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

Previous topic - Next topic

Kubouch

Universal Fermenter


Universal Fermenter is a mod which allows you to create a custom "waiting" production buildings in a style of the vanilla fermenting barrel. The mod adds the possibility customize the building's parameters such as input ingredients, output product, temperature ranges, fermentation speed and an influence of weather on the speed. It is possible to assign multiple products to a single building and cycle through them in game. Adding a new fermenter building is simple and does not require any C# skills.

Information on how to use and what to set up is on the Wiki.

Comments and tips about the code or anything else are welcome and appreciated!

Downloads and links

Beta 18 (0.18.1722):
    Universal Fermenter (b18.1.0)

All versions:
    Universal Fermenter

Wiki:
    Wiki

Repository links:
    Master branch (stable)
    Development branch (cutting edge)

Issues and bugs

If you find a bug or something that bothers you, you can create a new issue in my repository (possible to log in via GitHub or Google). Or you can just post it here.

Version

    b18: The current RimWorld beta
    first number: The main version number. I increment this when I introduce a new feature or a significant change.
    second number: Incremented whenever I fix something or add a small improvement of an existing feature.

Co-authors
cuproPanda: I used his Cupro's Drinks which served as a base for this mod.

Permissions
You are encouraged to include this mod in your mod because that's why it was created in the first place. It is licensed under the MIT license. That means you can use this mod for any purpose and release it under any license, just give me a credit.

Changelog


## [b18.1.0] - 2017-11-18
* Official update to Beta 18 (0.18.1722), no other changes

## [a18.0.1] - 2017-11-13
* Possible to set up different graphics for empty/non-emty fermenter.
* Update to Alpha 18 (0.18.1719, unstable)


## [a17.6.0] - 2017-09-10
* It is possible to use both Normal and Rare CompTick.
* Compatible with CompRefuelable, CompPowerTrader and CompFlickable. They can
switch the building on/off
* Weather can influence production speed (namely sunshine, rain, snow and wind).
It does not cause ingredients to rot, just changes the speed.
* Add a button in dev mode for printing current weather speed factors and roofed
factor.
* Fix: Incorrect bar display when partially filled.

## [a17.5.0] - 2017-07-17
* All functionality in CompUniversalFermenter (no building class needed).
* Better inspection string (max. 5 lines).

## [a17.4.1] - 2017-07-16
* Added ingredients summary now trims vowels when max. line length is exceeded.
* Using static class instead of [StaticConstructorOnStartup].

## [a17.4.0] - 2017-07-09
* More readable XML format.
* Ingredients are set up by ThingFilter allowing multiple ingredients per
product.

## [a17.3.0] - 2017-06-12
* All vanilla fermenting barrel's parameters are now settable in XML (for each
product).

## [a17.2.0] - 2017-06-09
* Possible to set up more ingredient-product pairs.
* New ingame button for cycling through the products.
   
## [a17.1.0] - 2017-06-07
* First release: New building class and a component property based on a
fermenting barrel.
* Possible to set up a product to be made from one ingredient ThingDef.

kaptain_kavern


cuproPanda

It looks good! I'll have to give it a test run sometime soon! You might want to consider adding a static class like this. It's a minor improvement that means each new fermenter won't have to recreate static data, and might allow you to remove [StaticConstructorOnStartup] from the fermenters. I just recently began updating my mods to use this method :)
cuproPanda's Mods: Survivalist's Additions, Additional Joy Objects, Cupro's Drinks, Quarry, Cupro's Stones, Zen Garden, Cupro's Alloys, Preset Filtered Zones, & more!

dismar


AtomicRavioli

You are an awesome person, thanks! :)

Kubouch

Quote from: cuproPanda on June 07, 2017, 09:14:58 PM
It looks good! I'll have to give it a test run sometime soon! You might want to consider adding a static class like this. It's a minor improvement that means each new fermenter won't have to recreate static data, and might allow you to remove [StaticConstructorOnStartup] from the fermenters. I just recently began updating my mods to use this method :)

Yes please, more comments about my code. Even though I have some programming background, this is my first C# project ever.

Kubouch

Quote from: cuproPanda on June 07, 2017, 09:14:58 PM
It looks good! I'll have to give it a test run sometime soon! You might want to consider adding a static class like this. It's a minor improvement that means each new fermenter won't have to recreate static data, and might allow you to remove [StaticConstructorOnStartup] from the fermenters. I just recently began updating my mods to use this method :)

What is the purpose of the [StaticConstructorOnStartup]? As I understand it it should guarantee that the static members are loaded first and since they are static they belong to the class type and therefore should be loaded only once. I understand the Static class approach you suggested, I just don't understand how it is different from [StaticConstructorOnStartup]. Also in your quarry mod you used both [StaticConstructorOnStartup] and the Static class. You should be able to safely remove [StaticConstructorOnStartup] when you're using the Static class, right?

Kubouch

I fixed the Fermenting Barrel maximum safe temperature to be the same as vanilla. They should be completely identical now.

jecrell

Let's dry some tobacco leaves together
...Psst. Still there? If you'd like to support
me and my works, do check out my Patreon.
Someday, I could work for RimWorld full time!

https://www.patreon.com/jecrell

koni

So, this is meant to be a framework for modders with no/less C skills? Thank you so much!!

Kubouch

Quote from: koni on June 09, 2017, 06:21:29 AM
So, this is meant to be a framework for modders with no/less C skills? Thank you so much!!

Yes, only knowledge how to add XML buildings is required.

Kubouch

#11
New version (a17.2.0)!

Added the possibility to assign multiple resources to a single building. You can choose what to produce by clicking on a button in game.

The code is still a bit of a hodgepodge but I had a good time fixing bugs so I hope it will work nicely. I'm off for the weekend now :-D. Let me know about any issues, I'll try to fix them when I'm back.

Enjoy!

Kubouch

Just for convenience I added a "forbiddable" property to the Fermenting Barrel. When you forbid the barrel, colonists won't put stuff in so you can control how much resources get produced. It is a simple XML deed, you can easily do it yourself or remove it.

That updates Fermenting Barrel to version a17.2.1. Download etc. in the first post.

lionessJess

You are a star!!! I have been trying to work out how to make my own fermenting barrel for ages, now I can finally finish my wine mod. I am super new to this and very grateful for your work!!

Kubouch

New version (a17.3.0)!

Now it is possible to assign all the properties to every resource. Each product can have its own fermenting temperature, speed, etc.

For more info, please visit a brand new Wiki. There are examples on how to use the mod and a list of all possible setable parameters. I ditched the Fermenting Barrel mod in favor of the Wiki.

Enjoy!