• 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 Preprocessor fails to translate item names

Need to look at the map ... as far as I know I didn't change anything to the map code right? So what is that affected too?
What you're seeing is that the itmname_mapIsland {#slocation# map} isn't being filled in anymore.
This is my code for preprocessing the descriptions:
Code:
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
}
That seems to work for maps and non-maps.
Compare to the one-line solution where apparently the regular preprocessors do work, but the item-based ones don't:
Code:
GameInterface.strings.ItemName = GetAssembledString(PreprocessText(TranslateString("", itemARef.name)), itemARef); // KK
Of course it is tricky mixing and matching two types of preprocessors in one string. :facepalm
 
Based on my most recent game session, out of the three files @Levis uploaded, the only one you need is "items.c". That one fixes the problem with "Letter to #sFatherBernard#".

I also noticed the map problem after installing all three files. After retrieving the original files by using 7-Zip to extract them from the latest installer, I installed the new "items.c" alone, which fixed the letter. Then I installed the new "itemsbox.c", and that broke the maps. I'm not sure if "itemstrade.c" does anything useful or harmful.

Apart from maps, which worked fine before these new files, and a couple of letters, there don't seem to be any items which need preprocessed names. If "items.c" makes the letters appear correctly and previous work makes the maps appear correctly, I'd get rid of the other two files and call it done. :)
 
Would be nice if something can be made that CAN apply both types of preprocessors without breaking anything.
At least some further work is required because items.c is the one that causes the map display to be wrong (see my screenshot on the previous page).
 
the other two files are for when you trading items or putting them in a chest etc.
For now this might not be used but better to do it in the future...
what I can't understand is why the problem with the maps seem to dissapair once the itembox file is reversed ... that one shouldn't even be loaded when the items.c is active ...
 
what I can't understand is why the problem with the maps seem to dissapair once the itembox file is reversed ... that one shouldn't even be loaded when the items.c is active ...
Maybe some miscommunication there; I'm pretty sure items.c is reponsible for everything we've seen there. :cheeky
 
@Levis and/or @Grey Roger: I'd really like the display of item names to be corrected again before tomorrow evening,
because I wouldn't want to make another EXE with that bug included if it can be avoided.
Maps are more common than quest items with a preprocessor, so I might revert to the previous versions of those files if necessary.
But I'd rather at least have also a fixed items.c file so that Grey Roger's item will show properly too.

As far as I can tell, the item-type based if-statement for descriptions does handle both situations properly.
Until a single-line solution can be found, that might be our best bet. I just don't have time to look into that myself.
Any chance one of you could at least sort out the Inventory Interface for tomorrow's version?
 
I installed the 25th July zip update last night, then re-installed my "Early Explorers" fixes back over it, and also copied @Levis' "items.c" but not the other two files. Maps displayed correctly right away and the letters whose names include "#sFatherBernard#" also displayed correctly when I got them. As it will be needed to display those letters, I'll include "items.c" when I package up the files for the "Early Explorers" quest fix.
 
So you say you DO have the maps showing properly WITH @Levis' latest fix? How is that even possible?
I thought I also had the same code and it was definitely wrong on my end.
 
Did you have all of @Levis' fix installed, or just "items.c"? I previously resurrected the original files by using 7-Zip to grab them from the installer, then copied the new version of "items.c" into place again and left the other two as their original versions.

Maybe try building another install using just the stock disks, the current Beta 3.5 installer, the 25th July .7z update and "items.c", so that any additional mods which could be affecting maps aren't present. That (along with the "Moulin" quest update) ought to make that installation similar to mine. (Well, apart from my work on the other side quests, but that shouldn't affect how maps are displayed - for that matter, neither should the "Moulin" update.)
 
Did you have all of @Levis' fix installed, or just "items.c"? I previously resurrected the original files by using 7-Zip to grab them from the installer, then copied the new version of "items.c" into place again and left the other two as their original versions.
I have all three installed. But as items.c is the actual Inventory Interface, that is the only one that should affect anything.
Just to be sure, can you upload YOUR copies of all three files? Then I'll compare with what I've got.

Maybe try building another install using just the stock disks, the current Beta 3.5 installer, the 25th July .7z update and "items.c", so that any additional mods which could be affecting maps aren't present. That (along with the "Moulin" quest update) ought to make that installation similar to mine. (Well, apart from my work on the other side quests, but that shouldn't affect how maps are displayed - for that matter, neither should the "Moulin" update.)
I can't afford to spend the time to do that. I already have FAR too much to do and FAR too little time. :(
 
"My" version of "items.c" should be identical to the one @Levis posted here. The other two should be exactly what is in the 16th July installer.

Have you installed any other mods? I haven't downloaded any specific updates posted by other people, only the 22nd July and 25th July general updates.
 

Attachments

  • items.c
    78.4 KB · Views: 101
  • itemsbox.c
    120.7 KB · Views: 99
  • itemstrade.c
    53.8 KB · Views: 88
Have you installed any other mods? I haven't downloaded any specific updates posted by other people, only the 22nd July and 25th July general updates.
At the moment my game version is Levis' latest works + yours + mine plus some stuff by pedrwyth and Jack Rackham.
But only my and Levis' work might be affecting the interfaces, I should think. Anyway, I now have the files I should need, so tonight I'll see what happens with those. :cheeky
 
Okay so I changed the interfaces so they all use the same functions.
The way the quest thing was set up was not really helpfull for everything so I've set it up in the init items now. Please check how I did it so you can do that for others too.
Search for letter_to_bernard.
Any variable thing you want in the name or description you can just add in this way to the item.
 

Attachments

  • itemstrade.c
    52.1 KB · Views: 84
  • itemsbox.c
    120.5 KB · Views: 90
  • items.c
    77.7 KB · Views: 96
  • initItems.c
    299.1 KB · Views: 89
so @Pieter Boelen I now removed the difference for MAPS, so they are all handled the same now.
 
Okay so I changed the interfaces so they all use the same functions.
The way the quest thing was set up was not really helpfull for everything so I've set it up in the init items now. Please check how I did it so you can do that for others too.
Search for letter_to_bernard.
Any variable thing you want in the name or description you can just add in this way to the item.
So then we will need to set up the preprocessors used in item names/descriptions twice?
That is going to affect any other quest items that contain default town and island names, which are a fair few, if I recall.
Those would also need to be period-correct, which they were with the old system.

Also, I fear that the item initializition might be done PRIOR to the periods taking effect. And especially the final period corrections are done very late in the game initialization process.
So I'm not sure if this is going to work. Have you tested the item in Early Explorers and confirmed that you get some sort of "Padre Spanishname" showing instead of "Father Bernard"?
 
So then we will need to set up the preprocessors used in item names/descriptions twice?
That is going to affect any other quest items that contain default town and island names, which are a fair few, if I recall.
Those would also need to be period-correct, which they were with the old system.

Also, I fear that the item initializition might be done PRIOR to the periods taking effect. And especially the final period corrections are done very late in the game initialization process.
So I'm not sure if this is going to work. Have you tested the item in Early Explorers and confirmed that you get some sort of "Padre Spanishname" showing instead of "Father Bernard"?
If it worked in the old situation it should probably still work now ...

In early explorers it says letter for salvador aldama. Is that correct?

Also Checked with a map and the map name is also period correct
 
If it worked in the old situation it should probably still work now ...

In early explorers it says letter for salvador aldama. Is that correct?
Almost. Should be "Padre Aldama". The character is normally named "Father Bernard".
Then in Early Explorers, "Redmond" is taken over by Spain, which triggers his name to be changed to a random Spanish name, in this case "Salvador Aldama" (but could be anything else).
Periods.c contains an extra line of code to set his first name to "Padre". This is done VERY late in the game starting process, which explains why the initItems.c method misses out on that change.
We might need some code in place to ALWAYS change "Father" to "Padre" for Spanish characters or so. Yet another thing to do. :(

Also Checked with a map and the map name is also period correct
Ah, yes; true that. Then just all quest items will need their now-required attributes adding.
Which is still adding the preprocessors twice, because they're already defined in the game but now won't be available for items anymore.
 
Almost. Should be "Padre Aldama". The character is normally named "Father Bernard".
Then in Early Explorers, "Redmond" is taken over by Spain, which triggers his name to be changed to a random Spanish name, in this case "Salvador Aldama" (but could be anything else).
Periods.c contains an extra line of code to set his first name to "Padre". This is done VERY late in the game starting process, which explains why the initItems.c method misses out on that change.
We might need some code in place to ALWAYS change "Father" to "Padre" for Spanish characters or so. Yet another thing to do. :(

Ah, yes; true that. Then just all quest items will need their now-required attributes adding.
Which is still adding the preprocessors twice, because they're already defined in the game but now won't be available for items anymore.
Need to look into that, at least for now it is sort of working again.
 
Back
Top