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

Fix in Progress Antigua Port Admiral gives out Swedish Letter of Marque

Homo eructus

Privateer
Storm Modder
Uh, the English admiral of Antigua just told me to get a Swedish Letter of Marque
Sin título.jpg
Maybe something dodgy with his dialog.c file or his own national definition? I haven't touched any of that, so I don't think it's translation-related, but I don't have the vanilla version on hand to check it out
 
no idea what thatd be :eek: Im away today, but I can check the dialog file tomorrow if a solution doesnt present itself :onya
 
Uh, the English admiral of Antigua just told me to get a Swedish Letter of Marque
View attachment 31546
Maybe something dodgy with his dialog.c file or his own national definition? I haven't touched any of that, so I don't think it's translation-related, but I don't have the vanilla version on hand to check it out
Presumably the admiral's nationality is set when Antigua is initialised. Neither he nor the regulating officer have "ch.nation" lines in their definitions, but that doesn't stop them from showing up as British whenever I play the game.
british_port_admiral.jpg

In any case, the dialog file is not to blame. At least, not the existing one. The nationality of the LoM being demanded is handled by a preprocessed variable which is filled in here:
Code:
Preprocessor_Add("nation_desc", GetNationDescByType(Npchar.nation));
So even if the admiral is getting the wrong nationality somehow, the LoM should be the same nationality.

The problem is likely with the translation system. It's translated "Portadmiral" into "Almirante del Puerto" even though the rest of the text is in English, and it's turned the admiral Swedish.
 
@Grey Roger: Could it be that the 'nation' attribute really is missing for these guys?
And then "Sweden" shows up completely by accident because the game code gets confused by the missing attribute?
 
Presumably the admiral's nationality is set when Antigua is initialised. Neither he nor the regulating officer have "ch.nation" lines in their definitions, but that doesn't stop them from showing up as British whenever I play the game.
View attachment 31558

In any case, the dialog file is not to blame. At least, not the existing one. The nationality of the LoM being demanded is handled by a preprocessed variable which is filled in here:
Code:
Preprocessor_Add("nation_desc", GetNationDescByType(Npchar.nation));
So even if the admiral is getting the wrong nationality somehow, the LoM should be the same nationality.

The problem is likely with the translation system. It's translated "Portadmiral" into "Almirante del Puerto" even though the rest of the text is in English, and it's turned the admiral Swedish.
The name is translated because it appears in one of the chracters_names files that I translated long ago, while the dialog isn't because that's what I'm translating at the moment
 
@Grey Roger: Could it be that the 'nation' attribute really is missing for these guys?
And then "Sweden" shows up completely by accident because the game code gets confused by the missing attribute?
Easy enough to test.

@Homo eructus: put this into "PROGRAM\Characters\init" and see if the Port Admiral shows up correctly.

Having said that, I tried a test with Sweden enabled - in fact, I'd been running that test anyway, with a Swedish corsair, for other purposes - report to follow in another thread. So I loaded up my savegame, went to Antigua, and English Portadmiral Barham still demanded an English LoM. ("English", not "British" - this test is in the "Spanish Main" period. So it's getting the nation description right based on period. This was before I did anything to "Antigua.c".)
 

Attachments

  • Antigua.c
    8.2 KB · Views: 200
I tried with the version without any translation files in it, and he says "error" instead of Swedish.
Sin título.jpg
At least this time, there's an error log
Code:
RUNTIME ERROR - file: nations\nations.c; line: 306
invalid index 11 [size:8]
RUNTIME ERROR - file: nations\nations.c; line: 306
function 'GetNationByType' stack error
RUNTIME ERROR - file: nations\nations.c; line: 319
Using reference variable without initializing
RUNTIME ERROR - file: nations\nations.c; line: 319
null ap
RUNTIME ERROR - file: nations\nations.c; line: 319
no rAP data
Those lines in nations.c are exactly the same in the translation and not translation versions of the mod, so if the result is different, I guess something in my translation has changed some other thing, but I can't for the life of me figure out what.

Does anybody else get this error in the regular English version of the mod with the latest zip? If it's only on my end, it could be an installation error on my part, I suppose.
 
Easy enough to test.

@Homo eructus: put this into "PROGRAM\Characters\init" and see if the Port Admiral shows up correctly.
Looks like that's the problem He was missing de ch.nation line altogether. So is the regulating captain

Edit: still getting "error" instead of the proper nationality though
Code:
RUNTIME ERROR - file: nations\nations.c; line: 306
invalid index 12 [size:8]
RUNTIME ERROR - file: nations\nations.c; line: 306
function 'GetNationByType' stack error
RUNTIME ERROR - file: nations\nations.c; line: 319
Using reference variable without initializing
RUNTIME ERROR - file: nations\nations.c; line: 319
null ap
RUNTIME ERROR - file: nations\nations.c; line: 319
no rAP data
 
Sounds like it's a good idea to add that attribute; just in case. :onya
 
I'll put the version of "Antigua.c" with the added "ch.nation" lines into the update archive. But Portadmiral Barham has never caused problems before, and I'd expect him to do so for anybody playing either the "Ardent" or "Assassin" storylines as he has roles to play in both of them.

@Homo eructus: those nation errors indicate that your version is probably trying to use all the extra "nations" which are defined in "globals.c" but aren't used:
Code:
#define PRIVATEER_NATION 8
#define NEUTRAL_NATION   9
#define UNKNOWN_NATION  10
#define ANY_NATION      11
But "MAX_NATIONS" is defined as 8, so the size of the "Nations" array will be 8, therefore any attempt to use "ANY_NATION" is going to cause an error.
 
@Homo eructus: those nation errors indicate that your version is probably trying to use all the extra "nations" which are defined in "globals.c" but aren't used:
Code:
#define PRIVATEER_NATION 8
#define NEUTRAL_NATION   9
#define UNKNOWN_NATION  10
#define ANY_NATION      11
But "MAX_NATIONS" is defined as 8, so the size of the "Nations" array will be 8, therefore any attempt to use "ANY_NATION" is going to cause an error.
And how can I avoid that?

Also, looking at this
Code:
#define ENGLAND          0
#define FRANCE           1
#define SPAIN            2
#define PIRATE           3
#define HOLLAND          4
#define PORTUGAL         5
// KK -->
#define AMERICA          6
#define SWEDEN           6

#define GUEST1_NATION    6
#define GUEST2_NATION    7
Shouldn't Sweden be 7 and not 6? Could that be part of the problem? (the original problem with the Sweddish LoM, at least)
 
Last edited:
How to avoid problems with the unused "nations" - don't use them. ;) Don't work with nation numbers higher than 7.

No, Sweden and America are both 6, which is GUEST1_NATION. Nation 7, which is GUEST2_NATION, won't work unless GUEST1_NATION already exists. This is why Sweden can't exist in the last two periods - America is using the GUEST1_NATION slot then.
 
How to avoid problems with the unused "nations" - don't use them. ;) Don't work with nation numbers higher than 7.
I've never done that to my knowledge. I don't even know how to do it if I wanted. All I do is adding translation strings and translating.
 
I have seen error messages to do with invalid nation numbers, though the reported wrong number was a lot higher - report to follow in another thread. What sort of character model were you trying to play - was it any of the "Sailor" models? That is what triggered the nation errors for me.
 
It was the default Free Play Julian McAllister (47_JRMMSub), I only changed his profession from rebel to sailor to be able to ge to Antigua peacefully
 
Last edited:
Oh, now the game freezes and crashes while loading a new game, even after rolling back all the changes I've done today (something might have gone corrupt and I need to reinstall everything?). error.log goes nuts, shows this times 8
Code:
RUNTIME ERROR - file: nations\nations.c; line: 268
missed attribute: id
RUNTIME ERROR - file: nations\nations.c; line: 268
no rAP data
followed by this times several hundreds
Code:
RUNTIME ERROR - file: MAXIMUS_Functions.c; line: 3230
missed attribute: ranks
RUNTIME ERROR - file: MAXIMUS_Functions.c; line: 3230
null ap
RUNTIME ERROR - file: MAXIMUS_Functions.c; line: 3230
no rAP data
Loading a saved game doesn't crash the game but still shows the first error log about nations.c; line: 268
 
Looks like a reinstall may indeed be necessary. Indeed, after concluding that the translation framework was most likely to be responsible for various errors I was getting, it ended up being easier to reinstall the game and then reinstall the various other recent mods, rather than try to pick out the numerous files involved in the translation framework.
 
Sad to hear that. Up until today, I didn't have any issues.

Anyway, after a fresh reinstall of the mod and the lastest zip, the portadmiral still asks fior an "error letter of marque". Adding or removing the ch.nation to his character didn't make a difference.

Wait, maybe the zip wasn't the right one... I'll check tomorrow, got to go now.
 
Back
Top