• 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!

Fixed Fetch Quest Bugs

I still get a missed attribute error, so I'm putting this into the game for testing purposes:
Code:
          if (CheckAttribute(ttown, "island"))
             AnnounceFetchQuestEvent(ttown.island, cargoid);
           else
           {
             TraceAndLog("Fetch Quest ERROR: Check compile.log!");
             DumpAttributes(ttown);
           }
 
This line of trace could also be usefull:

if(DEBUG_FETCH_QUEST) trace("FETCH QUEST: make fetch quest for "+tisland.name+" with "+townnum+" towns. Pick town "+ttown.name);

It might be because the island is somewhere set to have more towns then it has in this period.....
 
It´s calculated by this function:
Code:
int GetIslandTownsQuantity(string islandid)
{
    if(islandid == "") return 0;
    ref island = GetIslandByID(islandid);
    if(CheckAttribute(island,"towns.quantity")) return sti(island.towns.quantity);
    return 0;
}

if a certain town is disabled in a period the towns.quantity should also be changed...
 
It might be because the island is somewhere set to have more towns then it has in this period.....
That'd surprise me. In certain periods, the whole ISLAND may be disabled. But never one town and not another. :no
(Because that is a lot more complicated and would require replacing that town with a non-town location instead).
 
I will also test it if I see the error popping up. If you got an attribute dump please post
 
I will also test it if I see the error popping up. If you got an attribute dump please post
Not yet, I'm afraid. I only put the check in there not so long ago and have been focusing on other things.
But I'll post here if I do get one. If I don't have one before this evening, I'll include the Dump as part of the next ZIP for other players to try too.
 
error.jpg

"Fetch Quest ERROR: Please post your compile.log file at piratesahoy.net!"

As requested, here it is. For good measure, you can also have "system.log". I'd have included "error.log" as well, but there wasn't one.

There seems to have been an attempt to generate a fetch quest for Santa Maria de Guadalupe de Extremadura. That was never going to end well because Santa Maria de Guadalupe de Extremadura, alias Guadeloupe, is supposed to be disabled in "Early Explorers". This seems to have confused the fetch quest:
Code:
FETCH QUEST: make fetch quest for Santa Maria de Guadalupe de Extremadura with 8 towns. Pick town Sir Richard
Fetch Quest ERROR: Please post your compile.log file at piratesahoy.net!
 

Attachments

  • compile.log
    5.6 KB · Views: 56
  • system.log
    21 KB · Views: 74
Yep:
Code:
FETCH QUEST: make fetch quest for Santa Maria de Guadalupe de Extremadura with 8 towns. Pick town Sir Richard
Fetch Quest ERROR: Please post your compile.log file at piratesahoy.net!
old =
  name = Sir Richard
  lastname = Dutton
  middlename = Martínez
name = Sir Richard
lastname = Dutton
flags =
  pirate = 0
  texture = 0
That is some stuff that keeps cropping up when things go wrong. We never did figure out why.
Strange that Guadeloupe is still be called, because I thought there was already a check in place to prevent using disabled islands. o_O
 
Attached file should fix the missed attributes.
It made sense in the end, because while there WAS a period check, that was done only after the code already tried to use the non-existent attribute.
I moved the check to earlier in the process and forced a Fetch Quest to be generated for every island at the same time in Early Explorers.
No more errors that I can find. :no
 

Attachments

  • quests_common.zip
    32.7 KB · Views: 62
I think everything is fine now. Going to put this as fixed. If it does pop up again we will check agian.
 
Back
Top