News:

Welcome to World of Banished!

Main Menu

Building with multiple production outputs.

Started by gerbertdev, February 07, 2019, 11:45:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gerbertdev

   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;
}

RedKetchup

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...

> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

gerbertdev

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?

Discrepancy

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

RedKetchup

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 ^^
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

gerbertdev

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!

RedKetchup

> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .