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

Mod Release Gentlemen Of Fortune 2.1.5 mod development

Both versions of GOF2 were stable for me when I played them in 2015. One version had more sound options but did have some bugs on my system.

GOF2 was fine as we spent a lot of time reverting back to a stable setup and then slowly adding content back and testing. The only times I can recall crashes was towards the end of long battles with large fleets, but that was end game stuff.
 
The only times I can recall crashes was towards the end of long battles with large fleets


Yeah, almost everytime that a 6x6 battle loaded up, it crashed. I was Ok with that, since it was the only case it crashed, when I reloaded the save and tried again the battle would procceed normal. But now everytime the loading screen pop up, 90% of the time it crashes. This began after I captured the Battleship from that Morgan mission. I tried reloading to a previous save, tried storing the battleship, tried almost everything. The only thing I didn't tried to do is starting a new game. I don't know if the crashes are tied to this specifically, but I ran out of options to try.

Also, just for the record, I'm not saying the mod is unstable. Maybe it is a problem in my end. Hell, it most certainly is. I'm just asking if someone knows what is the probable cause for these crashes and maybe have some idea how to fix it. I would like to continue with the game as I was having so much fun with it and considering all the shitty new games releasing recently, stripped of all "hardcore" and pure RPG mechanics, COAS made me appreciate games again.

I would be eternally grateful for any insight. Thanks!
 
The only thing I didn't tried to do is starting a new game. I don't know if the crashes are tied to this specifically, but I ran out of options to try.
Maybe deleting the file named "options" from your main game folder might help? That sometimes gets corrupted in PotC, so the same might apply to CoAS.
Alternatively, chances are that starting a new game will work better again.
 
Search for "Dutchman" in PROGRAM\NK.c; that should at least show you part of the relevant code.
Once you've got part of it, the tricks from that thread should allow you to trace the rest too.
(I think most of the rest was in PROGRAM\SEA_AI\AIShip.c).
Hey,
I have several questions to ask regarding porting submerge and emerge ability from POTC New Horizons to AOP GOF 2.0
first is:
In potc new horizons in program directory there is a file called NK.c
What is this for? does AOP GOF 2.0 a similar file? How and where should I port from NK.h functions related to this ability to submerge?

Another one is coming straight out of error file:
COMPILE ERROR - file: sea_ai\AIShip.c; line: 2778
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 2778
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 2778
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 2778
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 2778
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 2778
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 2778
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 2778
Undeclared identifier: DIST_NOSHIP

I dont get how is it undeclared, if in POTC's AIShip.c it wasnt identified in the beginning of this file... and also it wasnt specifically identified for the very code line.
could you please help on that matter?
I will attach the AIShip file with the ported code Dutchman code for AOP with the following issue of DIST_NOSHIP.
 

Attachments

  • AIShip.c
    146.3 KB · Views: 373
That DIST_NOSHIP is declared in InternalSettings.h, which as a file, appears to exist in GOF 2.0 file set, but is not actually ever included (#include) in any file. Add

#include "InternalSettings.h"

to a file like seadogs.c and you should be good.
 
directory there is a file called NK.c
What is this for?
It is just a file containing code. It's named NK.c because it was originally added by Nathan Kell to contain his own functionality.
You don't need to have that file in CoAS, as long as you have the relevant functionality in a file that does exist in CoAS.

That DIST_NOSHIP is declared in InternalSettings.h, which as a file, appears to exist in GOF 2.0 file set, but is not actually ever included (#include) in any file. Add

#include "InternalSettings.h"

to a file like seadogs.c and you should be good.
Huh, why was that file even added to GoF, I wonder?
It is a mod-added file from PotC to allow players to tweak the mod settings.
If the #define is needed, it could also be added into any other file.
 
That DIST_NOSHIP is declared in InternalSettings.h, which as a file, appears to exist in GOF 2.0 file set, but is not actually ever included (#include) in any file. Add

#include "InternalSettings.h"

to a file like seadogs.c and you should be good.
Thank you! I will try it!
 
It is just a file containing code. It's named NK.c because it was originally added by Nathan Kell to contain his own functionality.
You don't need to have that file in CoAS, as long as you have the relevant functionality in a file that does exist in CoAS.


any suggestion how such file might be named in AOP GOF? I looked through the program folder but never found a similar by it's content file.

Is there a program that could allow me to check if the code is correctly written?
Since I keep having this:
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
missed ')'


and I wasnt able to figure out where the ")"
I more or less know when and how I can put the brackets. but this gets me weird.

if(HasSubStr(GetAttribute(rCharacter, "ship.type"), "Dutchman") && CheckAttribute(arCharShip, "SubmergeDutchman")) // Submerging Ability

here is the line
 
Last edited:
If you do not have file "NK.c" then function "GetAttribute" won't be defined. In POTC:NH, it's defined in "NK.c" thus:
Code:
string GetAttribute(ref tmp, string att)
{
   if(CheckAttribute(tmp,att)) return tmp.(att);
   return "-1";//MAXIMUS: and now we can use it for int and float check
}
You could perhaps add that to some other code file at the top level of the "PROGRAM" folder - maybe "PROGRAM\utils.c"?
 
If you do not have file "NK.c" then function "GetAttribute" won't be defined. In POTC:NH, it's defined in "NK.c" thus:
Code:
string GetAttribute(ref tmp, string att)
{
   if(CheckAttribute(tmp,att)) return tmp.(att);
   return "-1";//MAXIMUS: and now we can use it for int and float check
}
You could perhaps add that to some other code file at the top level of the "PROGRAM" folder - maybe "PROGRAM\utils.c"?

I will give it a try now. Thank you!
 
any suggestion how such file might be named in AOP GOF? I looked through the program folder but never found a similar by it's content file.
The file name doesn't matter; you can put the code very nearly anywhere.
@Grey Roger's suggestion makes sense to me. :doff
 
If you do not have file "NK.c" then function "GetAttribute" won't be defined. In POTC:NH, it's defined in "NK.c" thus:
Code:
string GetAttribute(ref tmp, string att)
{
   if(CheckAttribute(tmp,att)) return tmp.(att);
   return "-1";//MAXIMUS: and now we can use it for int and float check
}
You could perhaps add that to some other code file at the top level of the "PROGRAM" folder - maybe "PROGRAM\utils.c"?

doesnt work have this again
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3333
missed ')'
 
I wonder - are any of the functions required by that line defined? The functions needed are "HasSubStr", "GetAttribute" and "CheckAttribute".

Try putting these lines immediately before the line 'if(HasSubStr(GetAttribute(rCharacter, "ship.type"), "Dutchman") && CheckAttribute(arCharShip, "SubmergeDutchman"))':
Code:
if(HasSubStr("xyzzy", "yz")) trace("HasSubStr works");
trace("GetAttribute test: " + GetAttribute(rCharacter, "ship.type"));
if(CheckAttribute(arCharShip, "SubmergeDutchman")) trace("CheckAttribute true");
else trace("CheckAttribute false");
It will probably complain about at least one of them, and that should tell us which function is missing.
 
I wonder - are any of the functions required by that line defined? The functions needed are "HasSubStr", "GetAttribute" and "CheckAttribute".

Try putting these lines immediately before the line 'if(HasSubStr(GetAttribute(rCharacter, "ship.type"), "Dutchman") && CheckAttribute(arCharShip, "SubmergeDutchman"))':
Code:
if(HasSubStr("xyzzy", "yz")) trace("HasSubStr works");
trace("GetAttribute test: " + GetAttribute(rCharacter, "ship.type"));
if(CheckAttribute(arCharShip, "SubmergeDutchman")) trace("CheckAttribute true");
else trace("CheckAttribute false");
It will probably complain about at least one of them, and that should tell us which function is missing.

ok, will try now
 
I wonder - are any of the functions required by that line defined? The functions needed are "HasSubStr", "GetAttribute" and "CheckAttribute".

Try putting these lines immediately before the line 'if(HasSubStr(GetAttribute(rCharacter, "ship.type"), "Dutchman") && CheckAttribute(arCharShip, "SubmergeDutchman"))':
Code:
if(HasSubStr("xyzzy", "yz")) trace("HasSubStr works");
trace("GetAttribute test: " + GetAttribute(rCharacter, "ship.type"));
if(CheckAttribute(arCharShip, "SubmergeDutchman")) trace("CheckAttribute true");
else trace("CheckAttribute false");
It will probably complain about at least one of them, and that should tell us which function is missing.

I pasted the code you provided exactly before the line you said. Maybe I dont know where to look for the missing function
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3334
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3334
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3334
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3334
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3334
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3334
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3334
Invalid Expression
COMPILE ERROR - file: sea_ai\AIShip.c; line: 3334
missed ')'
 
Change that to:
Code:
if(findSubStr("xyzzy", "yz", 0) != -1) trace("findSubStr works");
It will probably still complain, but hopefully it will complain about a different line number.

The problem is that function "HasSubStr" doesn't seem to exist in CoAS either. The definition in PoTC is just a single line. The above code has simply replaced the call on "HasSubStr" with a call on "findSubStr", which had better exist otherwise this is going to be very difficult...
 
Back
Top