• 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 Current officers gaining levels from shared XP autobuy noncontributing perks

Tingyun

Corsair
Storm Modder
I removed all officers from my active party, and hunted the maltese crypts last night (as mentioned in previous post). When loading my saved game to check other things, and comparing with my previous saved game, I discovered what I believe might be a bug, or else a questionable design decision.

1) Before I went into the maltese crypt, my boatswain was lvl 8 and had no free perk points. After emerging from the crypt, she is lvl 10, has no free perk points, and has purchased basic commerce.

2) My other officers all also gained a couple of levels from shared fencing XP, but they at least purchased contributing perks.

Suggested change:

Officers who are already hired should not purchase perks on their own when gaining levels from shared XP (this is currently how it works for officers in the active party, they keep their perk points and let the player decide).

OR

Officers who auto purchase perks on their own when gaining levels through shared XP should only purchase contributring perks for their assigned role.


I think not being able to guide the development of officers who the player recruits at low level, unless the player ensures they are in his active shore party when leveling, reduces fun and deprives the player 0f the benefit of hiring lower level officers and guiding their development.
 
please provide a savegame becausee this shouldn't happen.
it checks for bAllies which should terun true in these cases so they shouldn't pick perks themself
 
@Levis

Sure! :) I keep a folder of frequent backups in case they are needed for bug testing.

Before and after saves attached. Both are in the spreightown dungeon outside the crypt. An earlier save shortly before my descent into the maltese crypt, and a later save after I was done with that trip and on my way out.

Just a thought (and probably wrong), but since the Maltese dungeon autoremoves party members from your shore party, forcing you to play alone, it is possible that code may be messing up the normal stuff that prevents auto purchase of perks?

The levels they gained were all from shared Fencing XP (their melee scores went way up).

Comparison:

Jane Wicker, boatswain
Before: lvl 8 , 0 free points.
After: lvl 10, 0 free points, auto purchased basic commerce (costs 2).

Ronan Martran, navigator
Before: Lvl 8, 8 free points.
After: Lvl 10, 8 free points, auto purchased speed increase (costs 2).

Lewis Clapp, quatermaster
Before: Lvl 10, 0 free points.
After: Lvl 12, 1 free point, auto purchased evade coast guard (costs 1).

Nadine Sewer, carpenter
Before: Lvl 9, 0 free points.
After: Lvl 11, 2 free points.
 

Attachments

  • Test saved Tingyun comparison maltese.rar
    1.1 MB · Views: 119
your idea could very well be true. because they are removed it might be they aren't set as passengers either and therefore this will happen. but I need to check it ingame. Probably I won't be able to check this out well untill next week.
 
Thanks Levis! Here are some further details for when you do look into it:

The navigator who auto purchased speed increase was not in my shore party (ever, really), so if it is the crypt messing with the code, it is doing so even with passengers it doesn't have to remove.

Also, when the crypt does "remove" passengers, it actually doesn't change their assignment to you on the passenger screen (they are still listed as being active members of the shore party), so it may be doing something odd to keep them from appearing, like making them not passengers like you mention.
 
Last edited:
@imado552 and/or @Tingyun could you test if this happens anywhere else also?
Say for example officers which are on other ships and stuff like that.
 
@Levis

Confirmed bug has nothing to do with maltese crypt. Anytime a passanger not in the shore party goes up in Lvl there is a chance he autopurchases skills (at least if advancing from shared XP, unsure if the same bug exists for them advancing from their own skill specilization).

Here was Lewis Clapp from my original post:
Lewis Clapp, quatermaster
Before: Lvl 10, 0 free points.
After: Lvl 12, 1 free point, auto purchased evade coast guard (costs 1).

I then sailed around until he went to Lvl 13 from shared sailing XP. He purchased himself master of disguise, and is now
Second After: Lvl 13, 0 free points, autopurchased master of disguise.

It is a random chance it seems, so not always, but it happens whenever not in shore party.

In shore party, I haven't seen it occur, but then again they would be mostly advancing from their own actions then, and I'm unsure whether it occurs if not from shared xp perk.
 
Okay I will look into this next week, seems that something in the bAllies check is going wrong...
 
But bAllies does definitely check for passenger status.
I even rewrote the passenger check a while back to be slightly less efficient but be guaranteed to do its job properly.
So how can this be?
 
Pieter, I've only noticed it for shared XP so far (shared fencing XP in the first round of tests with the posted saved games, shared sailing in the second test), though I can't be sure it is truly limited to that (easier to run tests for shared xp than non shared, since they have to not be in the shore party). Not sure if that might be helpful in tracking it down.
 
And this is for them automatically gaining perks? E.g. "abilities"? So not actual skills?
That does sound very wrong indeed.
 
Pieter, Yep, sadly it is for perks, though it seems somewhat random. Here are the results from the first test aboe with the saved game before and after comparisons, 3 out of the 4 ended up purchasing perks when they went up 2 levels.

Jane Wicker, boatswain
Before: lvl 8 , 0 free points.
After: lvl 10, 0 free points, auto purchased basic commerce (costs 2).

Ronan Martran, navigator
Before: Lvl 8, 8 free points.
After: Lvl 10, 8 free points, auto purchased speed increase (costs 2).

Lewis Clapp, quatermaster
Before: Lvl 10, 0 free points.
After: Lvl 12, 1 free point, auto purchased evade coast guard (costs 1).

Nadine Sewer, carpenter
Before: Lvl 9, 0 free points.
After: Lvl 11, 2 free points.
 
Do you have a save together with a sequence of actions with which this can be consistently replicated for one of your officers?
Clearly some code is being triggered that shouldn't be.
 
Sure! Either of the "before" or the "after" saves posted in the rar archive above (3rd post in this thread) works great. Since replicating fencing shared XP takes too long, just remove all officers from shore party, head to sea, travel around on the map for a month, and someone will have leveled up from sailing XP, and you can compare with the before (or the after if using that one) states I listed above (or record them yourself).

I ran the second test using the "after" save, it is very quick.

Another way that doesn't require a download would be to start a new game of Brave Black Flag, since you would start with a bunch of low level officers. Then remove everyone from the shore party, console shared XP perk to the main character, and then sail around until people level up from shared XP. After they level up a couple of levels, most should have purchased something.

However, it shouldn't be 100% consistent I think, given in the test 1 out of 4 officers hadn't purchased anything after 2 levels. But with a full compliment of offices and noone in the shore party, a couple of levels should have it happening for most of them.
 
Found the problem.
Code:
if(IsInParty(GetMainCharacterIndex(), sti(chref.index)))
            {
                if (GetAttribute(GetMainCharacter(), "location") != "Tutorial_Deck") // PB: Skip sound here
                {
                    if(CheckAttribute(chref,"FakeLevelUp"))
                    {
                        LevelText = TranslateString("","Fake Level Up") + " for " + GetMySimpleName(chref) + "!" + " " + TranslateString("","(Now level") + " " + chref.rank + ")";
                    }
                    else
                    {
                        LevelText = GetMySimpleName(chref) + " " + TranslateString("","has gained a new level!") + " " + TranslateString("","(Now level") + " " + GetTotalRank(chref) + ")");
                        PlayStereoSound("interface\new_level.wav");
                        AddMsgToCharacter(chref,MSGICON_LEVELUP);
                    }
                    LogIt(LevelText);
                }
            }
            else
            {
                LevelText = GetMySimpleName(chref) + " " + TranslateString("","has gained a new level!") + " " + TranslateString("","(Now level") + " " + GetTotalRank(chref) + ")");
                //This character has noone to choose his perks so we must do it for him.
                SelectPerksForCharacter(chref, 2);
            }
This was somewhere else and I think this is triggered.
I think this should be changed to:
Code:
if(IsInParty(GetMainCharacterIndex(), sti(chref.index)))
            {
                if (GetAttribute(GetMainCharacter(), "location") != "Tutorial_Deck") // PB: Skip sound here
                {
                    if(CheckAttribute(chref,"FakeLevelUp"))
                    {
                        LevelText = TranslateString("","Fake Level Up") + " for " + GetMySimpleName(chref) + "!" + " " + TranslateString("","(Now level") + " " + chref.rank + ")";
                    }
                    else
                    {
                        LevelText = GetMySimpleName(chref) + " " + TranslateString("","has gained a new level!") + " " + TranslateString("","(Now level") + " " + GetTotalRank(chref) + ")");
                        PlayStereoSound("interface\new_level.wav");
                        AddMsgToCharacter(chref,MSGICON_LEVELUP);
                    }
                    LogIt(LevelText);
                }
            }
            else
            {
                LevelText = GetMySimpleName(chref) + " " + TranslateString("","has gained a new level!") + " " + TranslateString("","(Now level") + " " + GetTotalRank(chref) + ")");
                //This character has noone to choose his perks so we must do it for him.
                if(!bAllies(chref))
                {
                    SelectPerksForCharacter(chref, 2);
                }
            }

Included is a file. Please test it @Tingyun .
Place in: \PROGRAM\characters
 

Attachments

  • Leveling.c
    59.1 KB · Views: 111
@Levis: Why does it use 'IsInParty' at the top instead of 'bAllies' and in what ways do the two differ?
 
@Levis: Why does it use 'IsInParty' at the top instead of 'bAllies' and in what ways do the two differ?
the inparty is used for showing an onscreen message. and I could exclude this from the if statement if I wanted, but inparty will only work for your officers so keeping it in the if doesn't matter but does increase performance a little bit.
 
the inparty is used for showing an onscreen message. and I could exclude this from the if statement if I wanted, but inparty will only work for your officers so keeping it in the if doesn't matter but does increase performance a little bit.
So... In Party as "in the SHORE party"? That makes sense, I suppose.
 
Back
Top