News:

Welcome to World of Banished!

Main Menu

Start Conditions

Started by angainor88, March 09, 2021, 05:53:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

angainor88

Is there a way to have a specific type of resource in the barn at the start? There's a place for stone, wood, etc, but if I wanted to have apples, is there a way to do that?

Thanks!

kid1293

In the file Game/StartConditions/StartConditions.rsc
you find a section like this

WeakComponentDescription _initialVisibleList
[
"Template/RawMaterialWood.rsc",
"Template/RawMaterialStone.rsc",
"Template/RawMaterialIron.rsc",

"Template/RawMaterialTool.rsc",
"Template/RawMaterialPotato.rsc",
"Template/RawMaterialFirewood.rsc",
"Template/RawMaterialLeatherCoat.rsc"
]


That tells what you have available (visible) from start.

In any special start condition file, you can tell how much of each you get
Here is the vanilla Game/StartConditions/Easy.rsc file

int _initialWoodCount = 150;
int _initialStoneCount = 70;
int _initialIronCount = 50;

int _initialToolCount = 50;
int _initialFoodCount = 2400;
int _initialFuelCount = 400;
int _initialClothingCount = 40;

int _plantCount = 2;
int _treeCount = 2;
int _livestockCount = 1;

float _livestockOffsetX = 0.0f;
float _livestockOffsetY = 0.0f;
float _livestockRadius = 4;
int _livestockGroupCount = 8;


That means - if you have Potatoes 'visible', you will get 2400 of them.

You can add whatever you want to the first list (wheat, cabbage, or even rice)
and in the second you tell the sum. They will be evenly distributed.

angainor88


angainor88

Do you have to do anything differently if the item flag is a custom flag (ie custom7)?

I am trying to add silkworm eggs to the start conditions, but they won't show up.

https://www.mediafire.com/file/u6txj4gls79zz9f/A8JapaneseStart.zip/file

kid1293

I guess we are not able to add custom flags in start conditions.

We have Food, Tool, Clothing, and Fuel. The big flags, so to speak.
I don't think Luke implemented custom items at the start.
Your try with 'initialcustom7Count' is a good try but I don't think
there is such value in the game engine.

If you make them edible, though. Sorry.

kid1293

I could see that the start didn't show up at all.
I removed  ':defaults'
from "Game/StartCondition/StartConditions.rsc:defaults"
in A8JapaneseStart.rsc and it worked, but no eggs  :(

The game is possibly stuck with the old values in the engine.
Luke updated some, but not all, with new flags.

angainor88

Hmmm oh well. Thank you for the help though!

I will try my long workaround then haha

angainor88

Well, my workaround worked!

But I discovered another flaw... My game crashed when bannies try to add the silkworm eggs to storage and I have no idea why.

Anyone have a clue?

https://www.mediafire.com/file/kh842iq8fsmzdhc/A8JapaneseStart.zip/file

kid1293

Hi.
This will be a long post.
I have tried to run your Japanese start but had to remove the ':defaults' from the start line.
It works. With only that start file loaded, the eggs are put into the Kura.

Do you set up the new limits for use in your mod?

Here I have sample code from after the UI section in an Animal Pen that produces fertilizer (Custom4)
I have to add the NewLimitStringTable instead of StringTable at certain points to have the new limit to display.


ResourceLimitUIConfig resourceLimitConfig
{
ResourceLimit _resourceLimit = Custom4;
}

RibbonDescription resourceLimit
{
Alignment _alignment = TopRight;
bool vertical = false;
int _topPad = 8;
int _cellPad = 8;

ElementDescription _elements
[
"labelLimit",
"editLimit",
]

Dialog _toolTipDialog = "Dialog/ToolTip.rsc";
StringTable _toolTipStringTable = "Dialog/NewLimitStringTable.rsc:gameDialogs";
String _toolTipText = "Custom4LimitTip";
}

LabelDescription labelLimit
{
Alignment _alignment = MidLeft;

Font _font = "Font\FontSmall.rsc";
int _imageWidth = 20;
int _imageHeight = 20;
int _spacing = 4;
LabelPosition _labelPosition = TextRight;
Alignment _textAlignment = MidLeft;

StringTable _stringTable = "Dialog/NewLimitStringTable.rsc:gameDialogs";
String _text = "Custom4Limit";
SpriteSheet _spriteSheet = "Dialog/NewLimitSpriteSheet.rsc";
String _spriteName = "LimitRawMaterials";
}

SpinnerDescription editLimit : "Dialog/SharedElements.rsc:spinnerSmall6"
{
int _increment = 100;
ElementDescription _border = "Dialog/SharedElements.rsc:flatButtonEnabledBorder";
}


I have attached the necessary files for using new limits and display the custom items in certain places.

The files in the Template folder (and the file limitResources.rsc) have to be added to be sure that new items
display correctly in vanilla buildings. Luke didn't do it. We have to add it ourselves.

You are welcome to any of my sources in 'The Laboratory' to check the usage of the new limits.

Remove the ':defaults'.
You must load what is above defaults. It did not work until I removed it.

All this does not answer why your game crashes.
You probably have other files loaded that interfere with your mod.
For example - The Kura file in your Housing mod does not have Custom7 flags.
It could be a conflict. Try ONLY the start file to see if it works.

kid1293

Your workaround is quite nice! :)
I learned something today. Thanks

RedKetchup

dont you need to process the new limit flags before calling anything else in your root resource file ?
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

angainor88

Having done some testing, I have discovered that the silkworms eggs don't show up at all when I tried trading for them. I think I will have to try adding your custom limit files to see if that works. I don't have anything that creates them, they are only a good you can get by trade (theoretically).

I did remove the ':defaults' part, which had no affect for me, I'm afraid. I will come back to this when I've had a chance to test the limit resource code you sent.

Thank you!

angainor88

It was the new limit files! I added what you gave me and it worked!

Is it ok if I use those files for the mod itself?

Thank you again! I would not have figured out how to fix this otherwise.

kid1293

:)

Way back we had a meeting about how to distribute the new limits that Luke made.
We all had things to say, but it was Kralyerg who made those files for us all to use.
I only wanted the two 'reserved' limits to be spared for the future.

You are totally free to use the files but do not change anything.

If you have a special need, you can use the reserved limits.
With a disclaimer, it should work with other mods. Usually, you don't need them.

It is up to you how often to use the files, but I think any major mod should have them.
It is easy to put a mod 'wrong' in the load order and wreck a good setup.

angainor88

Thank you!

I came too late to modding, so I missed all those discussions haha. I'm not planning to make any changes to these; all the work has been done for me already!