World of Banished

MODS Garage => Tips and Help => Topic started by: gerbertdev on February 07, 2019, 11:45:15 AM

Title: Building with multiple production outputs.
Post by: gerbertdev on February 07, 2019, 11:45:15 AM
   Hello, I have been trying to create a building that produces multiple resources at a time. I have seen similar functionality in the "Village Beehives" in DS Mead Brewing, where they randomly produce a resource from a list.
   I've tried to figure this out on my own and with the help of the modkit documentation, but it seems to have an attitude of "If you want to learn something, find an example of it in the resources". I can not recall an example of this type of building in the base game.

So far, I have tried to put multiple products in my Template:consumeproduct with no luck. The game loads but only the first entry is ever created.

ConsumeProduceDescription consumeproduce
{
Product _products
[
{
ComponentDescription _produceMaterial = "Template/RawMaterialOnion.rsc";
ResourceLimit _resourceLimit = Food;
}
{
ComponentDescription _produceMaterial = "Template/RawMaterialRoot.rsc";
ResourceLimit _resourceLimit = Food;
}
]
        StringTable _stringTable = "UI/TestModStringTable.rsc";
float _workTime = 4.0;
ToolType _toolType = Hoe;
int _workRequired = 10;
}
Title: Re: Building with multiple production outputs.
Post by: RedKetchup on February 07, 2019, 01:38:23 PM
the next lines after those are important

   int _initialProduct = -1;   // -1 for all products

or you use this number to tell the game which choice you want as default, or you write -1 to tell the game to act randomly

now, if you ask to be random, you dont need the menu choice UI on its little window. i cant tell for the moment or it is going by itself or you need to delete the entries in the UI section...

Title: Re: Building with multiple production outputs.
Post by: gerbertdev on February 07, 2019, 11:01:36 PM
Thank You So Much!  Adding "int _initialProduct = -1;" worked.
I did not have a production drop down, so I do not need to remove it.
I had been trying to figure this out for over a day. How did you find out about this variable?
Title: Re: Building with multiple production outputs.
Post by: Discrepancy on February 07, 2019, 11:07:20 PM
it is set to '0' in the IronMine.rsc template file, with the developers hint next to it: int _initialProduct = 0;   // -1 for all products
Title: Re: Building with multiple production outputs.
Post by: RedKetchup on February 08, 2019, 02:35:55 AM
Quote from: Discrepancy on February 07, 2019, 11:07:20 PM
it is set to '0' in the IronMine.rsc template file, with the developers hint next to it: int _initialProduct = 0;   // -1 for all products

THIS!


yeah the developper gave us so few "developer hints" extremly parsed through all templates and thats the only data we got unfortunatly. the developer is not extremly social ^^
Title: Re: Building with multiple production outputs.
Post by: gerbertdev on February 08, 2019, 09:39:40 AM
Quote from: Discrepancy on February 07, 2019, 11:07:20 PM
it is set to '0' in the IronMine.rsc template file, with the developers hint next to it: int _initialProduct = 0;   // -1 for all products

I hadn't thought to look there! Thank you.

Quote from: RedKetchup on February 08, 2019, 02:35:55 AM
THIS!


yeah the developper gave us so few "developer hints" extremly parsed through all templates and thats the only data we got unfortunatly. the developer is not extremly social ^^

Ah, a shame. Banished is an awesome game, though.

Thank you both, I finished my first Banished mod!
Title: Re: Building with multiple production outputs.
Post by: RedKetchup on February 08, 2019, 12:29:17 PM
Quote from: gerbertdev on February 08, 2019, 09:39:40 AM
Thank you both, I finished my first Banished mod!

wooot congratulations !!