• 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 Crewmember as an officer. Salary.

The next thing I'm going to do is fiddle the crewmember's "loyality" and "alignment" attributes. These are part of a system whereby officers are randomly assigned alignment "good" or "evil", plus a loyalty rating, which are kept secret from the player. Some sidequests have checks and if you take an action which is deemed "good", then good officers gain loyalty and evil officers lose loyalty; vice versa if the action is regarded as "evil". There's no benefit for having a loyal officer but if his loyalty drops too far then he deserts.
Do you have any clue if that effectively ever happens?
I know work was done on that system so that it technically functions, but as far as I am aware, the chance of it ever triggering is extremely remote to the point that it never really does.
 
Do you have any clue if that effectively ever happens?
Yes. :p
Fixed - Loyalty/alignment system causes quest characters to desert

This is what I'm adding to "permanent_crewmember_dialog.c":
Code:
   if(GetCharacterReputation(PChar) >= REPUTATION_GOOD) NPChar.alignment = "good";       // GR: set character's alignment to match yours.
   if(GetCharacterReputation(PChar) <= REPUTATION_SWINDLER) NPChar.alignment = "bad";   // He's supposed to be someone you know
   int loyality = MakeInt(GetAttribute(NPChar, "loyality"));               // so make sure he's loyal.
   if(loyality < 10) NPChar.loyality = 10;
If you're "Neutral" or one level either side of it, the officer keeps whatever alignment was randomly assigned to him. If you've made it to "Matey" or "Swindler" then you've been consistently playing one way or the other, and if you're happy enough with this guy to promote him then he's probably happy with your way of doing things.
 
Good! Then at least that feature isn't completely useless. :cheeky

Now that I've got internet at home again for the first time in forever, maybe eventually I'll be able to implement the various ideas I've had for 2+ years.
No promises though...

If you're "Neutral" or one level either side of it, the officer keeps whatever alignment was randomly assigned to him. If you've made it to "Matey" or "Swindler" then you've been consistently playing one way or the other, and if you're happy enough with this guy to promote him then he's probably happy with your way of doing things.
Sounds sensible to me!
Also gives an extra incentive to promoting your own crew: At least you'll be pretty much be guaranteed they won't suddenly leave in a rush. :onya
 
The problem is these two lines:
Yes, @Grey Roger, i didn't tried to check NPChar.quest.OfficerPrice in latest version of the game. Earlier i had the NPChar.quest.OfficerPrice value = 3802 from LogIt before this line:
Code:
if(!CheckAttribute(NPChar, "quest.OfficerPrice")) NPChar.quest.OfficerPrice = GetBaseOfficerPrice(NPChar);
Now, in the last version (from Build 14 Beta 4.1 WIP [Last Update: 25 May 2018][Beta 28 May 2018], but the Build 14 (21st May 2018)) next code gives me NPChar.quest.OfficerPrice=252, but in a character's window i have 428. When a ex-crewmember is hired, salary value doesn't changes (428). The Same was earlier (3802 in variable, but 6653 on the character's screen). This difference gave me a reason to want to find place where NPChar.quest.OfficerPrice was defined.
Code:
if(CheckAttribute(NPChar, "quest.OfficerPrice")) logit ("NPChar.quest.OfficerPrice="+NPChar.quest.OfficerPrice); //my
if(!CheckAttribute(NPChar, "quest.OfficerPrice")) NPChar.quest.OfficerPrice = GetBaseOfficerPrice(NPChar);
//int min_off_price = makeint( 1000 * sqrt(sti(NPChar.rank)) );
//if(sti(NPChar.quest.OfficerPrice) < min_off_price) NPChar.quest.OfficerPrice = min_off_price; // PB: Increased salary for better crewmember as officer
It look strange for me. Would be interesting to know why. Anyway, thank you.
 
Last edited:
The salary you see when you ask how good he is, or in the "Characters" screen after you hire him, isn't the same as "NPChar.quest.OfficerPrice" because his actual salary is calculated using 'CalcEncOfficerPrice', defined in "PROGRAM\Characters\CharacterUtilite.c":
Code:
int CalcEncOfficerPrice(ref officer)
{
   return makeint(sti(officer.quest.officerprice) * OFF_PRICE_SCALAR * PayScaleFactor());
}
'PayScaleFactor()' is defined in "CharacterUtilite.c":
Code:
float PayScaleFactor()
{
   ref mc = GetMainCharacter();
   int leadership = GetShipSkill(mc, SKILL_LEADERSHIP);
   int iron_will = GetOfficersPerkUsing(mc, "IronWill");
   float leadership_factor = 1.0 - makefloat(leadership)*makefloat(1 + iron_will)/40.0;
   float difficulty_factor = makefloat(GetDifficulty() + 1)*0.5;
   return leadership_factor * difficulty_factor * SALARY_MULTIPLIER;
}
So the officer's salary takes account of your "Leadership" skill and "Iron Will" ability, plus the variables OFF_PRICE_SCALAR and SALARY_MULTIPLIER. The same system is presumably used for other officers, e.g. those recruited in taverns, which is why the officers I showed in post #20 have similar salaries.

OFF_PRICE_SCALAR is defined in "PROGRAM\InternalSettings.h", SALARY_MULTIPLIER is set in the "Options" menu in game. So you have two ways of controlling officer salaries - all officers, not just ex-crewmembers.
 
Back
Top