• 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 Making Crew of Traders 'normal'

Should be possible. I know @Jason asked about this in the past as well.
Now that it is on the Bug Tracker, we should be able to look into it and not forget. :yes

This is probably handled in PROGRAM\Loc_ai\LAi_boarding.c and can be handled with an if-statement.
 
Last edited:
PROGRAM\Loc_ai\LAi_boarding.c find:
Code:
  if (!CheckAttribute(&Nations[iNation], atr)) return ""; // KK
   makearef(models, Nations[iNation].(atr));
   num = GetAttributesNum(models);
   if (num <= 0) return "";
   i = rand(num - 1);
   atr = GetAttributeName(GetAttributeN(models, i));
   model = models.(atr);
   atr += ".ani";
   if (CheckAttribute(models, atr) == true && models.(atr) != "") ani = models.(atr);
Replace with:
Code:
  // PB: Sailors instead of soldiers on merchant ships -->
   if(IsShipMerchant(rCharacter) || iNation == PIRATE)
   {
     ani  = "man";
     model = GetRandomModelForTypeExSubCheck(1, "sailors", ani, iNation)
   }
   // PB: Sailors instead of soldiers on merchant ships <--
   else
   {
     if (!CheckAttribute(&Nations[iNation], atr)) return ""; // KK
     makearef(models, Nations[iNation].(atr));
     num = GetAttributesNum(models);
     if (num <= 0) return "";
     i = rand(num - 1);
     atr = GetAttributeName(GetAttributeN(models, i));
     model = models.(atr);
     atr += ".ani";
     if (CheckAttribute(models, atr) == true && models.(atr) != "") ani = models.(atr);
   }
Haven't tested this, but I think it should work.

The idea is that any merchant ship and ALL pirate ships get random sailor models as boarding crew, while navy ships remain the same with their soldiers.
Note that there should no longer be ANY female boarders on pirate ships EXCEPT perhaps their captain. Somehow that sounds like a better idea to me.
The female pirate character models we have look too awesome to be lowly crewmembers. ;)
 
It actually WORKS? @Jason will be so happy! Thanks for that. Wasn't too difficult, then.... :wp

Looking at that code further, I wonder if we should use GetRandomModelForTypeExSubCheck for soldiers too.
Actually, there are a whole bunch of places in the code where model choices are sort-of hard-coded.
And I don't think they should be, since we have a system in place that can return an appropriate model from our ENTIRE collection.

This applies to the smuggler models too. @Levis....?
 
I believe they use the hard coded version to. The function which generates them is in smuggling.c
 
They do; that's why I mentioned it. Perhaps you would like to change it to use the same model group as the smugglers in the dungeons?
Actually, those have too many females too seem like proper smugglers. If not appropriate model group exists, perhaps we should set one up.

Either way, I would suggest using the actual random model selection system instead of the hard-coded version that doesn't provide much variety.
 
I just tested the capture colonies mod, and I noticed that the models in the town where not right. I attacked Saint Dominque, and when I entered the fort, the models of the defenders were right, french soldiers. My crew should have been british, but were normal sailors instead (happens sometimes during boarding, too). Then, after I cleaned the fort and went on to the town, all models were choosen from the group 'sailor', which is definitly not right. I guess it has something to do with the code chance for the merchants
 
My crew should have been british, but were normal sailors instead (happens sometimes during boarding, too).
Only sometimes? YUCK! Can you see if this is related to the flag you are flying?

Then, after I cleaned the fort and went on to the town, all models were choosen from the group 'sailor', which is definitly not right. I guess it has something to do with the code chance for the merchants
You're probably right. Forts probably don't have their type set the same way that ships do. :facepalm
 
If it would been flag related, they should be british, since I always fly the british flag^^ I can only say that they are ALWAYS behaving right when moored/going to the ship.. then they always are well-behaved and put on their soldier-clothings^^

Well it is right in the fort itself.. but somehow the game changes the models for the defenders when I start to attack the town itself.. probably because the game can't decide if the town is a trader or a war'ship'?^^

EDIT: If it helps: This thing with my crew wearing not the right clothes started after this Oiseau-quest. I had to hoist the french flag, which turned my crew into normal sailors. After I sank this Oiseau, I hoisted the british flag again, but my crew remained of the type sailor.. And I am quite sure that this bug would stop, if I stop serving Britain and buy a LoM again^^
 
If it would been flag related, they should be british, since I always fly the british flag^^
It could be SHIP-TYPE-related? Though I don't think it should be for the player.

I can only say that they are ALWAYS behaving right when moored/going to the ship.. then they always are well-behaved and put on their soldier-clothings^^
Those crewmembers are generated in a completely different way in the code.

EDIT: If it helps: This thing with my crew wearing not the right clothes started after this Oiseau-quest. I had to hoist the french flag, which turned my crew into normal sailors. After I sank this Oiseau, I hoisted the british flag again, but my crew remained of the type sailor.. And I am quite sure that this bug would stop, if I stop serving Britain and buy a LoM again^^
The way it should work is that when you get promoted by a governor somewhere, your player boarding crew changes to soldiers of that nation.
That then remains throughout the game unless you get yourself promoted by a governor of a different nation somewhere else.
This is part of the GivePromotionReward code in PROGRAM\NK.c so you can check the logic yourself. It is only set on the FIRST promotion.
 
My ship is a Bellona Class atm, so no, I think this shouldn't be the problem..

Well but I think this Oiseau-Quest somehow interrupts this.. its the only thing I can say to that, because it worked good to this point (I even had a Fast Merchantman some time, and my crew still behave right).. I think the problem lies in the fact that I hoisted a french flag and attacked a ship which was in my convoy.. I don't think this problem has something to do with the new code for merchants..
But I think this code somehow is related to the issue with the town defenders..
 
Yep, those town models are definitely a new issue. Should be easily fixed, will do so this evening.

Your crew though, I am not sure at all.
 
Attached file should probably fix this. Goes in PROGRAM\Loc_ai .
I added in a check so that the Sailor Crew only applies to NON-player characters to ensure it doesn't mess you up.
Additionally put in a check for towns and forts to ensure they don't get sailors either.
 

Attachments

  • LAi_boarding.zip
    26.6 KB · Views: 85
For now flagged this as fixed. But please test some more!
 
Marked as "Awaiting Info" until this is properly confirmed to be sorted.
 
Thanks for checking that. Indeed the forts will be interesting too,
since Pillat mentioned those were wrong after I made this code change. :facepalm
 
Back
Top