• 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 Leveling: Officers change their posts without player input

@lucho1392: I moved your post to this thread as other people have reported the same problem.
What do you mean with "new map"?

I mean the loading screens (landing, boarding, ect)
One thing you may consider is that this version is installed over the last one (beta 4 over beta 3.5) so maybe a clean install could drop the buggs
 
I mean the loading screens (landing, boarding, ect)
One thing you may consider is that this version is installed over the last one (beta 4 over beta 3.5) so maybe a clean install could drop the buggs
That won't help as this is a real problem confirmed by multiple people.
@Levis still needs to find a fix. Hopefully he'll manage tonight.
 
@Levis: I'm currently adding TraceAndLog lines to the main places where officer types are being set, so hopefully we can narrow this one down.
In doing so, I ran into the following section of code in PROGRAM\Loc_ai\LAi_deck.c:
Code:
      for(i = 1; i < 4; i++)
       {
         _curCharIdx = GetOfficersIndex(mchr, i);
         if(_curCharIdx < 0) continue;
         tmpChr = GetCharacter(_curCharIdx);
         if(CheckAttribute(tmpChr,"quest.officertype"))
         {
           bPlace = false;
           /*switch(Rand(4))
           {
             case 0: bPlace = tmpChr.quest.officertype==OFFIC_TYPE_FIRSTMATE; break;
             case 1: bPlace = tmpChr.quest.officertype==OFFIC_TYPE_NAVIGATOR; break;
             case 2: bPlace = tmpChr.quest.officertype==OFFIC_TYPE_BOATSWAIN; break;
             case 3: bPlace = tmpChr.quest.officertype==OFFIC_TYPE_QMASTER; break;
             case 4: bPlace = tmpChr.quest.officertype==OFFIC_TYPE_DOCTOR; break;
             // Aconcagua: TODO: whatabout the other officertypes???
           }*/
           TraceAndLog("PlaceOfficersToDeck: Set officer type for " + GetMySimpleName(tmpChr));
           tmpChr.quest.officertype = GetRandomOfficerType(); //Levis let's use a global function so we can easily add types later. <---------- SEE HERE -----------------
           if(bPlace)
           {
             ChangeCharacterAddressGroup(tmpChr, "None", "", "");
             CharacterIntoLocationLocator(_curCharIdx, mchr.location);
             logined++;
           }
I suspect that might be the cause; an officer type is being assigned to your officers who already have a type.
That is not what that original out-commented code used to do. :no
 
Saved game after sucessful boarding etc, all roles were as they should be. Then went onto the deck view of ship to return some weapons to the locker, went into captains cabin and bam. All 3 of my officers had changed roles. I hope you guys can sort this cause it really is a pain in the a** :p
Can you confirm that when it happened, you always visited the captain's cabin?
The section of code that I found and which I suspect to be the reason is executed exclusively when you visit your cabin, so that would certainly match up with your observation there.

I am getting rid of that for the coming update and I hope that will solve it;
but perhaps there is another similar thing hiding around somewhere, so we'll have to remain vigilant.
 
I think you've found the problem @Pieter Boelen
I was going by the same way and when looking at this again I also tought it strange, and now I see you've found the same problem.

I will look at your code later how you fixed it. But it seems to me it should say
Code:
bPlace = UsableOfficer(tmpChr);
 
Well jolly good glad I was of service and managed to provide some narrowing. It did indeed happen when I visited the captain's cabin, guaranteed however I do not think that this was the only place it could occur. But that would make sense for example after boarding because last place u fight/visit is usually the enemy captain's cabin whereby it probably changed your officers present in your "bodyguard party" also.

Once I download the new patch/fixes and such, when I actually fix my own issues in regards to this blasted adventurous new character quest I have taken upon myself to carry out hahahaha :p, I shall continue to thoroughly test the mod as I continue on as a Naval Officer. (God help me! :D)
 
Just did a quick test and it seems to work now. We can improve it later cause I still don't like how its programmed now. But for now I leave it to this :).
 
@Levis: As you've probably already seen, I fixed it by returning the code to what it used to be.
That section is meant to place only certain officertypes in your cabin.
But a carpenter, for example, would have no business being there, right?

A cleaner solution might be to add an attribute to the officer type initialization to control in which deck location type they can and can not appear.
 
@Levis: As you've probably already seen, I fixed it by returning the code to what it used to be.
That section is meant to place only certain officertypes in your cabin.
But a carpenter, for example, would have no business being there, right?

A cleaner solution might be to add an attribute to the officer type initialization to control in which deck location type they can and can not appear.

Yeah something like that. I will look at that later tough.
 
Back
Top