• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Included in Build Change goods given for the "sell cargo" tutorial

jsv

Freebooter
Storm Modder
I just started a new game in the Early Explorers era (as an Explorer, duh). My starting location is São Luis and the tutorial wants me to "sell goods (silk and wine)". Silk I've sold, but wine is illegal on Los Barbados. Of course after all those smuggler games I have a pretty good idea what to do about that, but whoever had given me the tutorial quests is not going to be very happy. :)

Oops, sorry for posting in a wrong subforum
 
Last edited:
what where the params you choose for this game (which character etc).
 
Code:
    if (CharGood1 == GOOD_SAILCLOTH || CharGood1 == GOOD_PLANKS)     CharGood1 = GOOD_SILK;
    if (CharGood1 == GOOD_WHEAT || CharGood1 == GOOD_RUM)             CharGood1 = GOOD_SILK;
    if (CharGood2 == GOOD_SAILCLOTH || CharGood2 == GOOD_PLANKS)     CharGood2 = GOOD_WINE;
    if (CharGood2 == GOOD_WHEAT || CharGood2 == GOOD_RUM)             CharGood2 = GOOD_WINE;
This part in startstoryline should have caused it, but I can't find anywhere, where CharGood is actually changed from the goods it is set at in globals.c ....
If you could trace it and see when this one is actually changed and find the function which does it....
 
what where the params you choose for this game (which character etc).
Free play, selected Beatrice Devlin, then portrait again, nonspecific named, one of Hawks. Changed ship to sloop, date to Dec 23, difficulty to Swashbuckler.
Selected different flags, renamed everything.

Code:
    if (CharGood1 == GOOD_SAILCLOTH || CharGood1 == GOOD_PLANKS)     CharGood1 = GOOD_SILK;
    if (CharGood1 == GOOD_WHEAT || CharGood1 == GOOD_RUM)             CharGood1 = GOOD_SILK;
    if (CharGood2 == GOOD_SAILCLOTH || CharGood2 == GOOD_PLANKS)     CharGood2 = GOOD_WINE;
    if (CharGood2 == GOOD_WHEAT || CharGood2 == GOOD_RUM)             CharGood2 = GOOD_WINE;
This part in startstoryline should have caused it, but I can't find anywhere, where CharGood is actually changed from the goods it is set at in globals.c ....
If you could trace it and see when this one is actually changed and find the function which does it....
OK, I'll look there.
 
Free play, selected Beatrice Devlin, then portrait again, nonspecific named, one of Hawks. Changed ship to sloop, date to Dec 23, difficulty to Swashbuckler.
Selected different flags, renamed everything.
Actually, no changes are needed, Beatrice Devlin with all settings on default gets 100 Silk, 100 Wine.
Let's see how they get there... :g2
 
If you could trace it and see when this one is actually changed and find the function which does it....
Yep, that's the place.

With this added to FreePlay/StartStoryLine.c:
Code:
void trace_goods(string place)
{
   TraceAndLog(place + ": " + Goods[CharGood1].name + " and " + Goods[CharGood2].name);
}
//[...]
trace_goods("StartStoryLine, before replacing");
if (CharGood1 == GOOD_SAILCLOTH || CharGood1 == GOOD_PLANKS)    CharGood1 = GOOD_SILK;
if (CharGood1 == GOOD_WHEAT || CharGood1 == GOOD_RUM)        CharGood1 = GOOD_SILK;
if (CharGood2 == GOOD_SAILCLOTH || CharGood2 == GOOD_PLANKS)    CharGood2 = GOOD_WINE;
if (CharGood2 == GOOD_WHEAT || CharGood2 == GOOD_RUM)        CharGood2 = GOOD_WINE;
trace_goods("StartStoryLine, after replacing");

I'm getting
Code:
StartStoryLine, before replacing: Ration and Ration
StartStoryLine, after replacing: Silk and Wine

Edit: And when entering StartStoryLine, both CharGood1/2 are already set to zero (aka GOOD_WHEAT) somewhere... I can't find any direct assignment to these variables, though.
 
Last edited:
Anyway, I don't see any code that would ensure the goods are legal, given the location and the period. It's just assumed the defaults, however they are set, would do.
 
Anyway, I don't see any code that would ensure the goods are legal, given the location and the period. It's just assumed the defaults, however they are set, would do.
Ok, i think i will just write a function to pick 2 nice goods which are imported goods and give you those. If you want you can do it too, it's easy, it's the same as for contraband with some things changed.
 
OK, I'll do that. Either tomorrow or next week. (Christmas is not much of holiday here, so it's regular working days for me until the New Year :type1)
 
Well, as I get it, it was initially written with a single storyline in mind. Which always starts in the same place with the same character. Back then "reasonable defaults" were reasonable. :)
Then the game was modded for some 12 years :wp
 
Well, as I get it, it was initially written with a single storyline in mind. Which always starts in the same place with the same character.
Actually, the Standard Storyline could start at different nation islands ever since Build 13. That is why that code was made so fancy by @Maximus.
But indeed a LOT has happened since then.
 
You know what. Leave this one to me @jsv I will have a look at it next week or tonight and see if I can fix it up :).
 
I think this same fix should be added to the Standard Storyline as similar issue may occur there.
 
Also, we may want to exclude certain goods from this:
upload_2015-12-25_1-44-57.png
 
Here's a proposed change from me:
Code:
  int attempts = 0;
   CharGood1 = 0;
   CharGood2 = 0;
   while(CharGood1 == CharGood2)
   {
     CharGood1 = getRandomImportGood(GetIslandByID(FindIslandByLocation(loadPort)));
     CharGood2 = getRandomImportGood(GetIslandByID(FindIslandByLocation(loadPort)));
     // PB: Keep looping until *valid* goods are found -->
     if (CharGood1 == GOOD_SAILCLOTH   || CharGood2 == GOOD_SAILCLOTH   ) CharGood1 = CharGood2;
     if (CharGood1 == GOOD_PLANKS   || CharGood2 == GOOD_PLANKS     ) CharGood1 = CharGood2;
     if (CharGood1 == GOOD_WHEAT     || CharGood2 == GOOD_WHEAT     ) CharGood1 = CharGood2;
     if (CharGood1 == GOOD_RUM      || CharGood2 == GOOD_RUM     ) CharGood1 = CharGood2;
     if (CharGood1 == GOOD_GUNPOWDER   || CharGood2 == GOOD_GUNPOWDER   ) CharGood1 = CharGood2;
     // PB: Keep looping until *valid* goods are found <--
     attempts++;
     if(attempts > 20) break;
   }

I also noticed there were some comments in RESOURCE\INI text files that were preventing some random good names from showing in the questbook.
Removed those comments, working now. :cheeky
 
So anyone noticed anything weird when doing a new story?
 
Back
Top