• 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 Dynamic Texts missing from Quest Item Descriptions

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
During the "Vogelstruijs" quest, you burgle the captain's house and steal a letter. Here's the letter's description:
vogelstruis_letter.jpg
Checking "RESOURCE\INI\TEXTS\ENGLISH\ItemsDescribe.txt", the description is:
Code:
This document, signed by Vice-Admiral Salvatore, proves that the 'Vogelstruijs' is carrying ammunition for the conquest of #sRedmond# and is to deliver the cargo to #sSanto Domingo#.
It seems that the code which reads quest documents is failing to interpret the variables. I changed the file, replacing one of them with a hard-coded name, which then appeared correctly and proved that I was in fact looking at the correct file.

If the code can't be fixed to read the variable correctly then the towns may as well be hard coded as Port Royal and Santo Domingo respectively because when the towns don't have those names, the quest makes no sense anyway. In "Early Explorers" Spain doesn't need to take #sRedmond# because it's Villa de la Vega and they already own it. If #sRedmond# is Kingston then Port au Prince doesn't need to fear war with Spain because it's already happened, France won, and the result was the ceding of Spain's portion of Hispaniola to France, which is why #sSanto Domingo# is now Saint Domingue.
 
For some bizarre reason, ALL quest items were missing their dynamic texts!
I'm surprised nobody reported this before, as it also applied to several items in the Standard storyline.

The cause seemed to be that item descriptions weren't "pre-processed" properly and therefore ended up with the missing text.
The below changes should fix this:
PROGRAM\INTERFACE\items.c find:
Code:
  if( CheckAttribute(itemARef,"describe") )   itmDescribe = GetAssembledString(itmDescribe,itemARef) + GetAssembledString(TranslateString("", itemARef.describe), itemARef) + GetItemBonuses(itemARef.id); // NK
Replace with:
Code:
  if( CheckAttribute(itemARef,"describe") )   itmDescribe = GetAssembledString(itmDescribe,itemARef) + PreprocessText(TranslateString("", itemARef.describe)) + GetItemBonuses(itemARef.id); // NK
PROGRAM\INTERFACE\itemsbox.c find:
Code:
descrStr +=  GetAssembledString(TranslateString("",arItem.describe),arItem) + GetItemBonuses(arItem.id); // NK
Replace with:
Code:
descrStr +=  PreprocessText(TranslateString("",arItem.describe)) + GetItemBonuses(arItem.id); // NK
Can you think of any other interfaces where you might see an item description?
Also, similar functionality applies to the maps you can buy. Do those still show up properly?
 
Better yet, use this for items.c because the maps DO need the old code but the quest items need the other line:
Code:
  if( CheckAttribute(itemARef,"describe") )
   {
     if( GetAttribute(itemARef,"groupID") == MAP_ITEM_TYPE)
     {
       itmDescribe = GetAssembledString(itmDescribe,itemARef) + GetAssembledString(TranslateString("", itemARef.describe), itemARef) + GetItemBonuses(itemARef.id); // NK
     }
     else
     {
       itmDescribe = GetAssembledString(itmDescribe,itemARef) + PreprocessText(TranslateString("", itemARef.describe)) + GetItemBonuses(itemARef.id); // PB
     }
   }
I tested this and it works.

While probably not necessary, I'll add similar changes to the itemsbox (can't see maps here) and itemstrade (can't see quest items here) interfaces.
After all, you never do know if that ever needs to be used and we don't want to have to fix this bug again.
 
Confirmed: the letter now shows the town names (didn't even need a new game or even a re-run of the "Vogelstruijs" quest!) and maps still show correct island names (the Portuguese island is correctly labelled "Concepcion", for example). Thanks! :onya
 
Confirmed: the letter now shows the town names (didn't even need a new game or even a re-run of the "Vogelstruijs" quest!) and maps still show correct island names (the Portuguese island is correctly labelled "Concepcion", for example). Thanks! :onya
Interface code files are loaded when you actually open the interface. So technically this particular change would not even have required closing the game. :cheeky
 
Back
Top