Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Kubouch

#61
Outdated / Re: [A17] Universal Fermenter
July 08, 2017, 06:26:39 PM
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.
#62
Outdated / Re: [A17] Universal Fermenter
July 08, 2017, 06:21:37 PM
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!
#63
Quote from: FTR on July 07, 2017, 08:32:01 AM
Heh really? I am still pretty new to this game and I didn't realize that having prisoner bed makes entire room "prisoner room".

Yes, it makes the whole room for prisoners. If you drop a cooked meal or apparel there, it's for prisoners' use and colonists won't touch it. I guess the same apply for nutrient paste dispensers. I never use dispensers so I'm not 100% sure how they work.
#64
Quote from: FTR on July 07, 2017, 08:03:22 AM
They go to the freezer and eat raw food instead of nutrition meals. I tried many different combinations of hoppers to see if anything helps but nope.

What confuses me is that it worked in the beggining, but then I changed position of coolers in the freezer and it stopped working.

Maybe it's because the dispenser's dispensing point is in the prisoner's room (note the prisoner bed on the picture).
#65
Help / Extract ThingFilter's contents
July 06, 2017, 10:23:20 AM
Let's assume I have this:

<ingredientFilter>
    <categories>
        <li>MeatRaw</li>
    </categories>
    <thingDefs>
        <li>Wort</li>
        <li>Kibble</li>
    </thingDefs>
</ingredientFilter>

where ingredientFilter is my instance of ThingFilter. The filter works correctly in game.

Now I want to extract a string like this: "Ingredients: meat, wort, kibble". Just list what I put into the XML: one category and two thingDefs. Unfortunately ThingFilter.categories and ThingFilter.thingDefs are private.

ThingFilter.Summary (or ToString()) just lists "ingredients" in this kind of example. I could iterate over AllowedThingDefs but that lists all the ThingDefs within the category ("alpaca meat", "alphabeaver meat", etc.), thus creating a huge list. It might be possible to use DisplayRootCategory but I haven't found a way how to check whether a ThingDef belongs to a category. I also tried subclassing ThingFilter with public categories and thingDefs which worked for listing things but broke the ThingFilter functionality. Then I ran out of ideas  :D.

Any ideas?

EDIT: Some context: lines 201-216.
#66
Outdated / Re: [A17] Universal Fermenter
July 04, 2017, 04:37:09 PM
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.
#67
Outdated / Re: [A17] Universal Fermenter
June 20, 2017, 04:01:30 AM
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.
#68
Outdated / Re: [A17] Universal Fermenter
June 13, 2017, 02:42:44 AM
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!
#69
Outdated / Re: [A17] Universal Fermenter
June 12, 2017, 06:22:38 PM
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!
#70
Outdated / Re: [A17] Universal Fermenter
June 09, 2017, 10:27:50 AM
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.
#71
Outdated / Re: [A17] Universal Fermenter
June 09, 2017, 09:04:09 AM
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!
#72
Outdated / Re: [A17] Universal Fermenter
June 09, 2017, 08:48:37 AM
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.
#73
Outdated / Re: [A17] Universal Fermenter
June 08, 2017, 08:55:16 AM
I fixed the Fermenting Barrel maximum safe temperature to be the same as vanilla. They should be completely identical now.
#74
Outdated / Re: [A17] Universal Fermenter
June 08, 2017, 05:56:47 AM
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?
#75
Outdated / Re: [A17] Universal Fermenter
June 08, 2017, 05:16:55 AM
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.