• 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 Hoisting hostile flag does not make companions mutiny

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
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.)
 

Attachments

  • nations.c
    61 KB · Views: 165
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?
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

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!
:rofl :rofl :rofl
"Red Dwarf" is indeed pretty hilarious. And Rimmer is indeed decidedly... uhm... NOT heroic! :razz

In fact, I don't know how to make him more likely to surrender.
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
 
Back
Top