• 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 Age of Pirates: Caribbean Tales - Historical Immersion Supermod

What is a "realisticly attainable" rank? Because I heard after rank 15 it gets rather... tedious^^

If that's the case, would the following simple tweak help if one wants more then 6 ability points? I ask - although I already tried it^^ - because I don't really know why the "modulo 3" code (the original) is written so complex?!

open "CharacterUtilite.c"
uncomment the whole...
Code:
        if(CheckAttribute(_refCharacter,"perks.FreePoints"))
        {  
            float fperks = stf(_refCharacter.rank)/2;
            int iPerks = sti(_refCharacter.rank)/2;
            fperks = fperks - iperks;
            if (fPerks == 0.0)
            {
                _refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + 1;
            }
        }
        else
        {    _refCharacter.perks.FreePoints = 0;
        }

and replace it with...
Code:
        if (sti(_refCharacter.rank)%2 == 0)
        {
            _refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + 1;
        }

I mean, whats the if(CheckAttribute(_refCharacter,"perks.FreePoints")) good for?
And why didn't they use modulo?

Hm... I'm really wondering about some of the code they wrote; I mean it works, but sometimes I don't know how or why they wrote it the way the did...
 
Last edited:
Ok, but is there some console command (is there even a console?^^) or any other way to check the contraband for the current game?
There is a dev console that is in this game since v5.0 is built off of GOF, but according to Debugger.c there is no command to search for contraband goods. Therefore it would be next to impossible to find out what functions could grab that data.
 
What is a "realisticly attainable" rank? Because I heard after rank 15 it gets rather... tedious^^

If that's the case, would the following simple tweak help if one wants more then 6 ability points? I ask - although I already tried it^^ - because I don't really know why the "modulo 3" code (the original) is written so complex?!

open "CharacterUtilite.c"
uncomment the whole...
Code:
        if(CheckAttribute(_refCharacter,"perks.FreePoints"))
        { 
            float fperks = stf(_refCharacter.rank)/2;
            int iPerks = sti(_refCharacter.rank)/2;
            fperks = fperks - iperks;
            if (fPerks == 0.0)
            {
                _refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + 1;
            }
        }
        else
        {    _refCharacter.perks.FreePoints = 0;
        }

and replace it with...
Code:
        if (sti(_refCharacter.rank)%2 == 0)
        {
            _refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + 1;
        }

I mean, whats the if(CheckAttribute(_refCharacter,"perks.FreePoints")) good for?
And why didn't they use modulo?

Hm... I'm really wandering about some of the code they wrote; I mean it works, but sometimes I don't know how or why they wrote it the way the did...
I have never realistically attained rank 15 in the game before. I usually finish the story line before that happens. I agree that some of their code is old compared to today's standards, however maybe Russian code was that way back then.... And what do you mean by tedious?
 
And what do you mean by tedious?
Oh, just that I read somewhere that you need a huge amount of XP to get to ranks 16 and upwards; more of a grind, so to speak. Well, I'll see :)

At least one doesn't have to start a new game for the aforementioned trick to work^^
 
I did a simple profit-calculation in Excel for all goods and now check which cargo is contraband in my game (by visiting the smugglers)
-> and of course: those that actually are profitable are contraband goods in my game :-\
 
There should be more profit for contraband than there is importing and exporting...
There should be an average profit by import and export of a small amount of gold per unit (like 6-10), but smuggling runs increase the profitability of goods because in order to find them you must first board ships that are pirate vessels and take their cargo. Taking normal cargo increases profitability as well. Remember that some goods when you go to another colony (if you are set upon by pirates) you may be able to increase your profit by having cargo that you don't have to pay for if you are able to board that ship, or fish cargo out of the sea from a sinking ship.
 
Last edited:
What is a "realisticly attainable" rank? Because I heard after rank 15 it gets rather... tedious^^

If that's the case, would the following simple tweak help if one wants more then 6 ability points? I ask - although I already tried it^^ - because I don't really know why the "modulo 3" code (the original) is written so complex?!

open "CharacterUtilite.c"
uncomment the whole...
Code:
        if(CheckAttribute(_refCharacter,"perks.FreePoints"))
        { 
            float fperks = stf(_refCharacter.rank)/2;
            int iPerks = sti(_refCharacter.rank)/2;
            fperks = fperks - iperks;
            if (fPerks == 0.0)
            {
                _refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + 1;
            }
        }
        else
        {    _refCharacter.perks.FreePoints = 0;
        }

and replace it with...
Code:
        if (sti(_refCharacter.rank)%2 == 0)
        {
            _refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + 1;
        }

I mean, whats the if(CheckAttribute(_refCharacter,"perks.FreePoints")) good for?
And why didn't they use modulo?

Hm... I'm really wondering about some of the code they wrote; I mean it works, but sometimes I don't know how or why they wrote it the way the did...

It is unwise to remove the: if(CheckAttribute(_refCharacter,"perks.FreePoints"))

Keep that check there because if the particular character being checked does not have the .FreePoints attribute, it will never get assigned that particular attribute with your change and that code will never work for that particular character going forward, no matter what rank they achieve. Other than that, yes, your code snippet with the modulo is a fine change to achieve the same result.

I suspect that that piece of script code may have either existed from an earlier version of the engine that perhaps did not yet have the modulo feature in their internal compiler, or the particular coder was unaware of the internal compiler support of modulo when they wrote it; the game has its own compiler, hence not all features of C/C++ are supported or work exactly the same as one would expect in those languages.
 
It is unwise to remove the: if(CheckAttribute(_refCharacter,"perks.FreePoints"))

Keep that check there because if the particular character being checked does not have the .FreePoints attribute, it will never get assigned that particular attribute with your change and that code will never work for that particular character going forward, no matter what rank they achieve. Other than that, yes, your code snippet with the modulo is a fine change to achieve the same result.

I suspect that that piece of script code may have either existed from an earlier version of the engine that perhaps did not yet have the modulo feature in their internal compiler, or the particular coder was unaware of the internal compiler support of modulo when they wrote it; the game has its own compiler, hence not all features of C/C++ are supported or work exactly the same as one would expect in those languages.
Don't worry, I am not the one who is making those changes and v5.0 isn't affected by that.... That change seemed a bit sketchy to say the least so that is why I have not implemented that and will have hotshot finalize before I go messing around with files.. Btw, have you found out what is going on with the quest? I messaged you with diagnostics... It appears my login and ship spawning logic will have to be redone... I don't know the locators to Grenada so if I knew a locator that I could spawn on, I could fix the spawn inside an island issue...
 
Update:
-All dialog files corrected from showing piastres or piasters. Gold is the currency across all dialogs....
-Fixed the issue that the schooner had 1 less cannon on both starboard and port sides due to incorrect ships_init defs.

Working on:
-Dutchman Quest
-New Credits Roll for the Modding Team (added after original devs)
 
Ok, I totally misread this code! I guess that's the danger of changing the game to your own preference :)
Thanks!

Your modulo change looks fine, though. So just wrap it inside the if(CheckAttribute...) statement like before, and with else assigning
_refCharacter.perks.FreePoints = 0, like before.
 
Didn't get much playtime the last few days... anyway, these values are way too much! I got about 20k profit from one run (chocolate export to import). In a lowly Schooner of War :-\
Code:
case TRADE_TYPE_EXPORT: pRef.Goods.(goodName).RndPriceModify = frnd() * 0.05;
case TRADE_TYPE_IMPORT: pRef.Goods.(goodName).RndPriceModify = frnd() * 0.65;
I'm gonna try these values now:
Code:
pRef.Goods.(goodName).RndPriceModify = frnd() * 0.2;
pRef.Goods.(goodName).RndPriceModify = frnd() * 0.55;
 
Oh and is it normal that I need to pay 100.000 gold to my 77 crew (+ 1 officer)?
That's fucking insane!
 
Btw this is the file for the bowsprit locators....
Currently they are doing this to my manowar's sails:

That happened to the HMS Victory in GOF2 as well. I repaired it and still have the archive. COAS worked just fine in TOOL for me.
 

Attachments

  • HMS_Victory1_mast1.7z
    3.9 KB · Views: 250
Well, at least it's only when I make a lot of profit; nevertheless, it's shamefully high :p

Bloody Pirates *lol*
 
Last edited:
Update:
-Added new music for each town theme. Adjusted the sound schemes accordingly.
-Fixed the common.ini not displaying appostrophies (now in UTF-8 format).

Still working on:
-Dutchman Quest
 
Last edited:
Hm, found a little bug me thinks...

I traveled to Nevis port and got the following message:
Nevis-Port Info Message (under attack by spain).PNG

What does it say?
There were 4 ships attacking Nevis Fort and, well, me.
 
Hm, found a little bug me thinks...

I traveled to Nevis port and got the following message:

What does it say?
There were 4 ships attacking Nevis Fort and, well, me.
These windows are showing in Russian... This is why it didn't show up right in 4.0. The bugged out strings are for AskForHelp.c and have to deal with the lack of translation back to English when cryllic is not supported in the English version of the game as opposed to in 5.0 the strings will support accents and cryllic. The fixed version is below:
Code:
string totalInfo = "";

void InitInterface(string iniName)
{
 
   EngineLayersOffOn(true);
   SetTimeScale(0.0);
   GameInterface.title = "titleAskForHelp";
 
   SendMessage(&GameInterface,"ls",MSG_INTERFACE_INIT,iniName);
 
   CalculateInfoData();
 
   SetFormatedText("INFO_TEXT",totalInfo);
 
   SendMessage(&GameInterface,"lsl",MSG_INTERFACE_MSG_TO_NODE,"INFO_TEXT",5);
 
   SetEventHandler("InterfaceBreak","ProcessBreakExit",0);
   SetEventHandler("exitCancel","ProcessCancelExit",0);
   SetEventHandler("ievnt_command","ProcCommand",0);
   SetEventHandler("evntDoPostExit","DoPostExit",0);
}

void ProcessBreakExit()
{
   IDoExit( RC_INTERFACE_FOOD_INFO_EXIT );
   //wdmReloadToSea();
   SetTimeScale(1.0);
   pchar.quest.Fight_forOtherColony_temp.help = "0";
}

void ProcessCancelExit()
{
   IDoExit( RC_INTERFACE_FOOD_INFO_EXIT );
   //wdmReloadToSea();
   SetTimeScale(1.0);
   pchar.quest.Fight_forOtherColony_temp.help = "0";
}

void IDoExit(int exitCode)
{
   DelEventHandler("InterfaceBreak","ProcessBreakExit");
   DelEventHandler("exitCancel","ProcessCancelExit");
   DelEventHandler("ievnt_command","ProcCommand");
   DelEventHandler("evntDoPostExit","DoPostExit");

   interfaceResultCommand = exitCode;
   EndCancelInterface(true);
   SetTimeScale(1.0);
 
   pchar.quest.Fight_forOtherColony_temp.help = "1";
}

void ProcCommand()
{
   string comName = GetEventData();
   string nodName = GetEventData();

   switch(nodName)
   {
   case "B_OK":
       if(comName=="activate" || comName=="click")
       {
           // напасть
           PostEvent("evntDoPostExit",1,"l",RC_INTERFACE_FOOD_INFO_EXIT);
           SetTimeScale(1.0);
       }
   break;
   }
}

void DoPostExit()
{
   int exitCode = GetEventData();
   IDoExit(exitCode);
}

void CalculateInfoData()
{
 
 
   int iHelp = sti(pchar.quest.Fight_forOtherColony_temp.help);

   int iEnemy = sti(pchar.quest.attack_other_fort.enemy);
   int iNation = sti(pchar.quest.attack_other_fort.nation);
   string sColony = pchar.quest.attack_other_fort.colony;
 
   if (iHelp == 2)
   {
       totalinfo = "The Governor of " + XI_ConvertString(GetNationNameByType(iEnemy) + "Gen") + "'s colonies brings his thanks to you and as a token of gratitude, awards you " + (10000 + sti(pchar.skill.commerce)*500) + " gold.";
       pchar.quest.Fight_forOtherColony_temp.help = 0;
   }
   else
   {
       totalinfo = "The Governor of" + XI_ConvertString(GetNationNameByType(iEnemy) + "Gen") + "'s colonies asks for help against the forces of " + XI_ConvertString(GetNationNameByType(iNation)+"Dat") + " who are attacking his colony.";
   }

   SetCurrentNode("B_OK");
}

In retrospect you could add the current island location you are at to the second string line, but you could also just say "this colony" instead of the location... The Translation is rather rough from Russian, but it fits the old style pretty well.
 
Last edited:
Back
Top