News:

Welcome to World of Banished!

Main Menu

Bug Fixing - Trader Boat

Started by angainor88, April 28, 2021, 05:27:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

angainor88

I am having trouble trying to find where the bug is in my code. Does anyone have the time/patience to help?

Whenever I test the trading post mod, it crashes as soon as the boat docks. I must be missing something, but I don't know what :/

Link for the files:https://www.mediafire.com/file/k7hozw86pwb9ym0/A8JapaneseMisc.zip/file

angainor88

So, it doesn't happen with all boats: the grain and luxuries suppliers seem ok.

This is the error message I get:

kid1293

I checked the code and couldn't find anything wrong.
All flags seem to be included. You link them with the NewLimits-files...

That crash is usually a flag problem.
The boat comes with something that is not declared in the code and it crashes.

I will have a second look.

kid1293

 ;D It took a minute now when I knew what to look for.
There is the letter 'l' after Custom9 in the code. That is a reason for crashing.


      {
         StringTable _stringTable = "Dialog/NewLimitStringTable.rsc:merchant";
         String _merchantName = "MerchantProtein";
         int _itemCount = 15;

         RawMaterialFlags _sellFlags = Protein;
         RawMaterialFlags _wantFlags = Wood | Stone | Iron | Fuel | Tool | Health | Edible | Textile | Clothing | Alcohol | Grain | Fruit | Vegetable | Protein | CoalFue | Custom0 | Custom1 | Custom2 | Custom3 | Custom4 | Custom5 | Custom6 | Custom7 | Custom8 | Custom9l;
         RawMaterialFlags _buyFlags = 0;
      }



kid1293

#4
- There is also the letter 'l'  missing in CoalFuel
in the same trader.

angainor88

Ah! Thank you for your help!

I will try out these fixes after work :D

angainor88

Well, I hoped it would fix it, but no luck so far...

The Merchant Grain, Merchant Textiles, Merchant Alchohol, and Merchant Organics all work, but I can't see which trader is the one that breaks it, alas.

I will keep looking, but I never seem to find anything :(

kid1293

@angainor88

I have had this problem. It comes back to me now.
I'll try to explain.

You have a trader who comes with 'Custom4' and only 'Custom4'.
You can not guarantee that he has any goods, because you have no 'Custom4' items in the mod.
When he arrives, he is empty - Crash!

I had to add some other flags to each trader so they didn't come empty-handed.

Reduce the number of traders. Combine the flags so that each trader is covered with something
that is actually in the game.

I hope it makes sense :)

angainor88

Ah ok! I can try to fix that!

Thank you for helping me as always :)
It is nice to have experienced people who have seen all these bugs before

kid1293

It is nice with people with bugs? ;D

You're welcome :)

angainor88

It appears to work now! Thank you!

I am going to do some more testing now...

kid1293