1. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  2. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  3. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  4. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Unconfirmed Bug Hoisting hostile flag does not make companions mutiny

Discussion in 'Build Mod Bug Tracker' started by Grey Roger, Mar 20, 2017.

  1. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,383
    I've been replaying my whole "Ardent" storyline to check that everything still works under the current installation. One bit which didn't is where, following some fun and games on Isla Mona, you impersonate a French frigate captain, join a French fleet, then leave Isla Mona and slip away from the fleet during the next night. Or, if you're brave, foolhardy or impatient, you can hoist a hostile flag and try to take on two frigates and a 3rd rate warship using just your own single frigate.

    Except that when I hoist a Spanish flag, the French ships don't care, they stay friendly.

    The problem is the HoistFlag function in "PROGRAM\NATIONS\nations.c", specifically this bit:
    Code:
               if(GetNationRelation(iNation, sti(rCharacter.nation)) == RELATION_ENEMY)
               {
                   SetMutineer(rCharacter, true);
                   bCompanionMutiny = true;
               }
    This doesn't work with "iNation", which is the argument being passed to "HoistFlag", the nation of the flag you're hoisting. It does work if I put in an intermediate variable:
    Code:
               iNation1 = iNation;
               if(GetNationRelation(iNation1, sti(rCharacter.nation)) == RELATION_ENEMY)
               {
                   SetMutineer(rCharacter, true);
                   bCompanionMutiny = true;
               }
    Didn't I need to do this on a previous occasion? I've found a version of HoistFlag in the post-28th July fixes with that fix in place. But it seems to have been left out of the 7th January version. There may have been some other fix which was supposed to make the intermediate variable unnecessary; if so, either it's not working any more or it, too, was left out of the 7th January install. Anyway, with the intermediate variable in place, HoistFlag works properly, and when I raise my Spanish flag, the genuine French ships turn properly hostile.

    Incidentally, when I was naming the French commanders, I used my usual method of randomly picking a name out of "Characters_names.c", and one of them ended up with "Rimeaux". This was close enough to "Rimmer", as in Arnold Rimmer, the cowardly hologram character from the TV series "Red Dwarf", so the captain was duly named Arnaud Rimeaux. I ran the battle a few times to sort out various things, and in three battles out of three, Rimeaux surrendered. I swear I did not program him to do that! In fact, I don't know how to make him more likely to surrender. (I do know how to make someone incapable of surrendering, which is why you're not getting the 3rd rate flagship without a fight.)
     

    Attached Files:

  2. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,233
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Yes, you did. At the time, @Levis found that the problem was that HoistFlag sometimes got called as HoistFlag(PChar.nation), which is technically a string and not an integer, messing things up.
    He was going to go through the code to fix all function calls to fix that, but in the end I ended up doing that instead.
    So unless I missed a spot, there should no longer be any string function calls to HoistFlag, which means the problem should have been fixed. :shock

    But since you say it still doesn't work ( o_O ), apparently something is still messed up.
    I cannot think why, but better put to put in your fix this time. :onya

    :rofl :rofl :rofl
    "Red Dwarf" is indeed pretty hilarious. And Rimmer is indeed decidedly... uhm... NOT heroic! :razz

    Surrender chance is a complicated formula based on ship morale, number of crew and leadership skills/abilities.
    Not sure how all that works together, but it is definitely some combination of those factors. :yes
     

Share This Page