• 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!

Need Help Officer experience,models and equipment

Laurens DG

Powder Monkey
My intent is to increase it. Probably up to 50% for officers and up to 100% via "Shared Experience" perk. Correspondingly for companions and passengers.
Thoughts about this are that as it is atm, chosen officers become obsolete through time. I like to mate for life.

Hope anyone can point me to the right file and the appropriate lines, for both standard exp gain coef and shared experience .

Thanks in advance.

regards
 
Laurens,

Wow, 50% and 33% is not enough?
Generally, NPC characters will gain experiences fairly regularly, and will not impact their growth even if you have your own experience growth set to the lowest level at the beginning of a new game.
The secret to quickly increasing your companions level without stalling is rotate them in officer postions that they will get maximum experience necessary skils, such as navigation, gunnery, and fighters.
This way they do not get invalidated, late in game.
Another way to quickly increase your officers experience is to fight lots of skeletons in a dungeon, but keep you officers waiting in the background.
This way no one dies.

Anyway, back to your request and point.
I don't remember ever desecting the code for that function over the past five years, but I do know where to start.
There is an easier way to change this without having to worry about a reinit.
You can modify the script files because these do not require a new game.
This is in the officers.c script file.

Specifically here:
Code:
//////////////// OFFICER ////////////////
void SetOfficerParam(ref Npchar, int _type)
{
    float upSkill = 0.7;
 
    ClearCharacterExpRate(Npchar); // òðåì âñå ïîðîãè ýêñïû íà âñÿê ñóë÷àé

    Npchar.quest.LeadershipModify  = 0;
    Npchar.quest.FencingModify     = 0;
    Npchar.quest.SailingModify     = 0;
    Npchar.quest.AccuracyModify    = 0;
    Npchar.quest.CannonsModify     = 0;
    Npchar.quest.GrapplingModify   = 0;
    Npchar.quest.RepairModify      = 0;
    Npchar.quest.DefenseModify     = 0;
    Npchar.quest.CommerceModify    = 0;
    Npchar.quest.SneakModify       = 0;
    Npchar.quest.PistolModify      = 0;

    SetRandSPECIAL(Npchar);
    Npchar.quest.officertype_2 = "";
    switch(_type)
    {
        case 0:
            Npchar.quest.officertype = "boatswain";
            Npchar.quest.officertype_2 = RandPhraseSimple(xiStr("MSG_Officers_1"), xiStr("MSG_Officers_2"));
            Npchar.quest.LeadershipModify     = frandSmall(2.0);
            Npchar.quest.FencingModify     = Rand(1);
            Npchar.quest.GrapplingModify   = frandSmall(2.0) + 2;
            Npchar.quest.DefenseModify     = frandSmall(2.0) + 2;
            Npchar.quest.SneakModify       = Rand(1);
         
            //Npchar.skill.Grappling_rate = makeint(MOD_EXP_RATE * upSkill);
            //Npchar.skill.Defence_rate   = makeint(MOD_EXP_RATE * upSkill);
        break;

        case 1:
            Npchar.quest.officertype = "cannoner";
            Npchar.quest.AccuracyModify      = frandSmall(2.0) + 2;
            Npchar.quest.CannonsModify       = frandSmall(2.0) + 2;
            Npchar.quest.SneakModify         = Rand(1);
         
            //Npchar.skill.Cannons_rate = makeint(MOD_EXP_RATE * upSkill);
            //Npchar.skill.Accuracy_rate   = makeint(MOD_EXP_RATE * upSkill);
        break;

        case 2:
            Npchar.quest.officertype_2 = RandPhraseSimple(xiStr("MSG_Officers_3"), xiStr("MSG_Officers_4"));
            Npchar.quest.officertype = "treasurer";
            Npchar.quest.RepairModify        = frandSmall(2.0) + 3;
            Npchar.quest.CommerceModify      = frandSmall(2.0) + 2;
            Npchar.quest.SneakModify         = frandSmall(2.0) + 2;
         
            //Npchar.skill.Repair_rate = makeint(MOD_EXP_RATE * upSkill);
            //Npchar.skill.Commerce_rate   = makeint(MOD_EXP_RATE * upSkill);
        break;

        case 3:
            Npchar.quest.officertype_2 = RandPhraseSimple(xiStr("MSG_Officers_5"), xiStr("MSG_Officers_6"));
            Npchar.quest.officertype = "navigator";
            Npchar.quest.SailingModify        = frandSmall(2.0) + 2;
            Npchar.quest.DefenseModify        = frandSmall(2.0) + 1.3;
            Npchar.quest.SneakModify          = frandSmall(2.0);
         
            //Npchar.skill.Sailing_rate = makeint(MOD_EXP_RATE * upSkill);
        break;

        case 4:
            Npchar.quest.officertype = "fighter";
            Npchar.quest.FencingModify         = frandSmall(2.0) + 2;
            Npchar.quest.PistolModify          = frandSmall(2.0) + 2;
         
            //Npchar.skill.Fencing_rate = makeint(MOD_EXP_RATE * upSkill);
            //Npchar.skill.Pistol_rate   = makeint(MOD_EXP_RATE * upSkill);
        break;
        // íå ïðè äåëàõ -->
        case 5:
            //Npchar.quest.officertype = OFFIC_TYPE_FIRSTMATE;
            Npchar.quest.LeadershipModify     = frandSmall(3.0) + 2;
            Npchar.quest.SailingModify        = frandSmall(1.0) + 1;
            Npchar.quest.SneakModify          = Rand(3) + 1;
         
            //Npchar.skill.Leadership_rate = makeint(MOD_EXP_RATE * upSkill);
            //Npchar.skill.Sneak_rate   = makeint(MOD_EXP_RATE * upSkill);
        break;
     
        case 6:
            //Npchar.quest.officertype = OFFIC_TYPE_DOCTOR;
            Npchar.quest.DefenseModify       = Rand(3) + 3;
            Npchar.quest.SneakModify         = Rand(3);
        break;
        // íå ïðè äåëàõ
        case 7:
            //Npchar.quest.officertype = OFFIC_TYPE_CARPENTER;
            Npchar.quest.RepairModify         = Rand(3) + 3;
            Npchar.quest.SneakModify          = Rand(3);
        break;
    }

    // boal Npchar.rank = makeint(Pchar.rank) - 2 + Rand(4);
    Npchar.experience = 0;// boal CalculateExperienceFromRank(sti(Npchar.rank));
    // boal fix 16.12.2003 -->
    //CalculateAppropriateSkills(NPchar);
    float MiddleK = GetMiddleMainSkill();

    Npchar.skill.Leadership    = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Fencing       = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Sailing       = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Accuracy      = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Cannons       = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Grappling     = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Repair        = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Defence       = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Commerce      = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Sneak         = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Pistol        = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.FencingLight  = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.FencingHeavy  = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;
    Npchar.skill.Fortune       = MiddleK - frandSmall(10*MOD_SKILL_ENEMY_RATE / 1.5) + 7;

    CorrectSkillParam(Npchar); // ïðèâåñòè ê 0-1
    // boal fix 16.12.2003 <--

    Npchar.skill.Leadership   = makeint(stf(Npchar.skill.Leadership)   + 10*stf(Npchar.quest.LeadershipModify));
    Npchar.skill.Fencing      = makeint(stf(Npchar.skill.Fencing)      + 10*stf(Npchar.quest.FencingModify));
    Npchar.skill.Sailing      = makeint(stf(Npchar.skill.Sailing)      + 10*stf(Npchar.quest.SailingModify));
    Npchar.skill.Accuracy     = makeint(stf(Npchar.skill.Accuracy)     + 10*stf(Npchar.quest.AccuracyModify));
    Npchar.skill.Cannons      = makeint(stf(Npchar.skill.Cannons)      + 10*stf(Npchar.quest.CannonsModify));
    Npchar.skill.Grappling    = makeint(stf(Npchar.skill.Grappling)    + 10*stf(Npchar.quest.GrapplingModify));
    Npchar.skill.Repair       = makeint(stf(Npchar.skill.Repair)       + 10*stf(Npchar.quest.RepairModify));
    Npchar.skill.Defence      = makeint(stf(Npchar.skill.Defence)      + 10*stf(Npchar.quest.DefenseModify));
    Npchar.skill.Commerce     = makeint(stf(Npchar.skill.Commerce)     + 10*stf(Npchar.quest.CommerceModify));
    Npchar.skill.Sneak        = makeint(stf(Npchar.skill.Sneak)        + 10*stf(Npchar.quest.SneakModify));
    Npchar.skill.Pistol       = makeint(stf(Npchar.skill.Pistol)       + 10*stf(Npchar.quest.PistolModify));
    Npchar.skill.FencingLight = makeint(stf(Npchar.skill.FencingLight) + 10*stf(Npchar.quest.FencingModify));
    Npchar.skill.FencingHeavy = makeint(stf(Npchar.skill.FencingHeavy) + 10*stf(Npchar.quest.FencingModify));
    Npchar.skill.Fortune      = makeint(stf(Npchar.skill.Fortune)      + 10*stf(Npchar.quest.SneakModify));

    CorrectSkillParam(Npchar); // ïðèâåñòè ê 0-10

    Npchar.reputation = rand(84) + 5;
    // ïðèñòðàñòèå îôèöåðà -->
    Npchar.loyality = 5 + rand(10);
    if (sti(Npchar.reputation) > 41)
    {
        Npchar.alignment = "good";
    }
    else
    {
        Npchar.alignment = "bad";
    }
    SetRankFromSkill(Npchar);

    LAi_NPC_Equip(Npchar, sti(Npchar.rank), true, true); // fix 101104 âûäàäèì âñå çàíîâî!!!!
 
    SetFantomHP(Npchar);
 
    Npchar.quest.OfficerPrice    = (11 + 2*sti(Npchar.rank))*(150 + MOD_SKILL_ENEMY_RATE*20) + rand(5)*10;
    Npchar.quest.OfficerLowPrice = makeint(sti(Npchar.quest.OfficerPrice)/1.5 + 0.5);
}


Keep in mind this function will also tie to your experience rate of growth when you start a new game as well, as they are related but not mutually exclusive.
 
Last edited:
Thank you for the response, very helpful. I may be completely out of my depth though.
I have no modding knowledge or experience, so if you would bare with me for some specifics.

I presupposed that the main char develops more quickly than his officers. Meaning that officers get a portion of the main char experience, 25% and 50% through perk. They do not get any other exp on their own. True?

case 3:
Npchar.quest.officertype_2 = RandPhraseSimple(xiStr("MSG_Officers_5"), xiStr("MSG_Officers_6"));
Npchar.quest.officertype = "navigator";
Npchar.quest.SailingModify = frandSmall(2.0) + 2;

I suppose frandSmall(2.0) stands for some coefficient, so if I would change the + 2 (or the 2.0 in the bracket) number I would get a quicker develepment in the corresponding skill , namely sailing in the example?
I have no idea what they stand for so I cannot calculate.

This... float upSkill = 0.7; .... if I change it to 1.0 that would solve it?

I do have the exp slider to the left. My intent was not to make the officers just better, but to make the main char dependent of them. Say I find a good-harted Navigator with a 20 nav. skill and I have 10 atm. We will relatively meet at 30 skill with the shared experience skill. I understand this fluctuates. My point is that at the latter time the officer becomes almost obsolete, only perks stand to benefit me.

My optimal change would be to change roles, to use the same example, after getting the navigation officer, experience distribution would change to the officer to the amount of 100 % and to my char 50 % for the navigation skill. This might even make an opportunity for an inverse "Shared experience" perk.
In effect, through time you get dependent on the officer for navigation, not just perks though they are great benefit, and stand a great loss if you lose him through loyalty or death. With death into account, it has an economic aspect too, as I would hae to hire another fighter instead of multitasking.

Now it seems too difficult thing to implement for me, so wouldn't be simplest to just point me to the Perks script so i can edit the number on the shared experience? At 100% it would do the trick just fine.

Regards
 
Now it seems too difficult thing to implement for me, so wouldn't be simplest to just point me to the Perks script so i can edit the number on the shared experience? At 100% it would do the trick just fine.

Regards

I will what I can do to find the specific lines of code for you, when I have the time.

It might not be so simple if its tied to more than than one base file script, which without checking I cannot validate.

There are not many "jack of all trades" Storm modders right now in the Akella Pirates Ahoy! world.
Most focus on a specific area such as 2D graphics, 3D models, or programming.
Coders are the most absent, as members Buho, OfficerPuppy, and Modernknight1 are not active right now.
Buho really understood best all the base code and console commands for the game.
 
This is from the rpg utilities.

/// officers
if (_addValue > 0 && sti(_chref.index) == GetMainCharacterIndex()) // òîëüêî äëÿ ÃÃ
{
int cn, i, iPas;
iPas = GetPassengersQuantity(_chref); // îïòèìèàöèÿ
if (CheckCharacterPerk(_chref, "SharedExperience"))
{
for(i=0; i<iPas; i++)
{
cn = GetPassenger(_chref,i);
if(cn!=-1)
{
if (isOfficerInShip(GetCharacter(cn), true))
{
AddCharacterExpToSkill(GetCharacter(cn), _skill, _addValue / 2.0);
}
else
{
AddCharacterExpToSkill(GetCharacter(cn), _skill, _addValue / 10.0);
}
}
}
for(i=1; i<COMPANION_MAX; i++)
{
cn = GetCompanionIndex(_chref,i);
if(cn!=-1)
{
AddCharacterExpToSkill(GetCharacter(cn), _skill, _addValue / 3.0);
}
}
}
else
{
for(i=0; i<iPas; i++)
{
cn = GetPassenger(_chref,i);
if(cn!=-1)
{
if (isOfficerInShip(GetCharacter(cn), true))
{
AddCharacterExpToSkill(GetCharacter(cn), _skill, _addValue / 4.0);
}
else
{
AddCharacterExpToSkill(GetCharacter(cn), _skill, _addValue / 20.0);
}
}
}
for(i=1; i<COMPANION_MAX; i++)
{
cn = GetCompanionIndex(_chref,i);
if(cn!=-1)
{
AddCharacterExpToSkill(GetCharacter(cn), _skill, _addValue / 6.0);




I just found it and came here to post it?
Isn't this the formulas for officer exp distribution?
All in all Thank you for the konsideration and the help, hope I am not too much of a bother.
 
What I do is set experience slider to the far left, then when I get to modify the characters capabilities aka P.I.R.A.T.E stats I leave them and g0 to land and then do them. I then move the talent value down to 1 and use those and all starting capability points on other things like power, endurance etc. This means I'm reliant on my officers from the start and still rely on them for a very long time as it takes forever to gain experience.
 
Yup, that's exactly it. Good inverse logic.
Thanks for an excellent tip, haven't thought of that.

Cheers
 
In an attempt not to pollute the forum with many threads, just a follow-up question... Which file governs what models are assigned to generic officers?
I could not find an answer, there are some points about POTC having a initModels.c file where you assign every model this way. No such file in COAS.
Any advice would be welcomed.
Thanks for your patience
 
In an attempt not to pollute the forum with many threads, just a follow-up question... Which file governs what models are assigned to generic officers?

Officer character models are controlled by several script files NOT just one because they are used in several instances such as boarding, quest, and towns.
I did a check, and I could not find the assignment .c file that governs CoAS officer characters specifically, but I did quickly identify everything else (quest, hero, town, boarding, etc). Actually, I was surprised I did not find it, buts its there somewhere...

Not sure what you want to do, but I assume you want to swap out one model for another.
Another quick way to exchange officer models is to do a review via TOOL (not gm viewer).
Every "officer model" character normally has the model name officer_x.
This was used as a convention in most Akella pirate games in order to keep track of changes.
Find the model you want to replace, validate the animation file, and do the swap by renaming the model file for your replacement character (and backup the original).
This works in a pinch, does not require a new game, and does not change the game code.
You also do not need to reinstall the texture files because the model file remains unchanged and will still reference the original textures.

I actually have done this several times in GOF Eras for officers I want on my crew.
 
Last edited:
Firstly, thanks Luke. The elaborate version of the suggestion is provided by Jonesie (his tutorial) , so credits for that, very punctual and helped me from day one.
Though that works for the heros, the generic officers use those officer_x model 1-20 or 30 .
What TBK suggested is my best viable option atm, thanks for that, my thoughts were just to expand the number of used models to add the potc excellent models and some POteho models. Noted in POteho, they go by mercenaries_x as far as I have noticed, some good models there.
I've enjoy the game too much recently to even attempt touching it in case I mess something up (at least I thought it might, missing textures give black screen and wrong animation a diffused texture), so havent tried this yet.
Some of the standard npc are specified by city, I cant recall now but Ive seen something helpful since this thread in a post somewhere about the LAi files, haven't stumble upon anything useful I can recognize.

On a final note, if the game doesn't specify a number of models used say fro 1-25 then expanding those officers should do the trick , I ought to try this on another install these days.

Thanks again
 
On a final note, if the game doesn't specify a number of models used say fro 1-25 then expanding those officers should do the trick , I ought to try this on another install these days.

Thanks again

The file you want HAS to be in the CoAS program/characters directory, as you peaked my interest now.

Nearly everything that defines what character models in the world is there, except HEROS.
To my knowledge and modding of this game, there is no limit on NPC Officer characters that can be used, but there are limits of characters for towns as coded unless changed as they are coded to locations and limitations of the original game.

This is how MK successfully added a new pirate haven location to CoAS on future patch.

Most characters and towns can be modded without a restart, however hero, quest, and main characters CANNOT, unless you do the direct model file swap I was talking about and override the model files.
 
Thanks for the direction it narrows it down tremendously, I'll look for it out of curiosity, meanwhile I'll add those models and suppose all will work fine.
There may be a small trial and error period since animations are different when porting models.
I'll look for it while I play.

Meantime, I got in a pickle again and since it's probably you (plural:D) who would help or know something about it I'll post it here.
Some flickering started happening after I entered COAS. Reloading to an earlier save doesn't help it's there too now.
To illustrate, there would be beams of textures(lines) say from the green land part beaming into the sea, in the world map beaches would be beaming from Port of Spain to the French islands and so forth. It's not that bad as it sounds, but noticeable.

Is it storm related?

Found a reaction_functions file (got spoilers too) uploaded by TBK which bypasses the storm. would that fix it?

Regards
 
Meantime, I got in a pickle again and since it's probably you (plural:D) who would help or know something about it I'll post it here.
Some flickering started happening after I entered COAS. Reloading to an earlier save doesn't help it's there too now.
To illustrate, there would be beams of textures(lines) say from the green land part beaming into the sea, in the world map beaches would be beaming from Port of Spain to the French islands and so forth. It's not that bad as it sounds, but noticeable.

Is it storm related?

Found a reaction_functions file (got spoilers too) uploaded by TBK which bypasses the storm. would that fix it?

Regards

That modified script file that I made years ago was not really meant for use outside of CoAS as it does disable certain storm functions in the rest of the game world.
The undesirable lighting effects are caused by the Storm Engine 2.8 under certain weather conditions and alpha effects.
With a photo, I could better determine whether this is distance related, particle related, weather storm related, or related to your graphics card display.
A few small script changes in a several files can make a huge change in overall weather.
Since, I believe you also own a copy of POTEHO, I would check to see if a swap out of certain weather particle effects from this game might improve things.
Those files are found in resource/particles as xps files.
There were certain upgrades from the original Storm Engine 2.8, and these particle effects fix some of these anomalies, but they are also tied to an upgraded game engine itself.
Don't modify any files however, just a a backup and one for one swap for a "test" run as not everything is completely compatible without further modification.
 
Last edited:
Thanks, no need to bother for the fix, it seems it is k today, strange but that old file seems to help as far as I can tell. I do the swap and the backup yes, so Ill put the old file back as soon as I get out this wretched place. I'll see if it comes back.

(I am stuck at the diffindur swim though. After my farewell with hendrick I exit the Tartarus and I cannot move at that point.
f8 for the st john teleport is all I can think of now, any other suggestion?)


Nevermind , it is my fault, I have actually mistaken the file with the one in texts/quests. I used the search function the first time unfortunately and went for the wrong file.
The file I got from your post to Ivana took me 30 ft up and walking to the diffindur. all done.

Regards
 
Last edited:
Isn't there a command via console to unequip (delete) characters item?
It is rather annoying with officers equipment, I just want to replace what they fight with.
Many nice items in-game and not a complete logic when they choose what is better. Furthermore one would expect to be proficient in all types of weapons, which is very difficult at this point.
Potc had the switch character cheat, when you can just switch your char with one of your officers, is that an alternative?

Regards

While I'm at it, I know the breastplates aren't included but are there atm, expansion of the number (170) for randitem in itemsinit. , and a line in the items. file for the corresponding item would do the trick?
I guess there would be more settings as to where they show up.
More importantly does this require a new game?

Apologies for being a bother with these bunch of questions :bounce
 
[quote="Laurens DG, [/quote]
I will be able to assist you in a week after returning from overseas if you have not discovered the solutions by that time
 
Thanks for the consideration TBK,

I can't figure out what to put instead of Pchar, how to point it to the officer (navigator?). Tried some variations with no success.
These are minor quirks really, hope it don't bother too much with it.
In case it is travel for pleasure, with spring coming about it is good time to be on the road, have a nice trip.
 
Back
Top