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!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
Indeed I HATE unnecessary code duplication. That's just asking for trouble.SBGetShoreLeavePay calculates (reduced) salaries all by itself, while it should use the common routines.
I plan to, but I'll need to use the functions that calculate officer salaries, so first I want to be sure those are correct.So if you can address that too, it'll be much appreciated.
Good news! Thanks again.Well, I'm getting somewhere with that officers' stuff. I hope to finish fixing this one (together with crew hire prices) tomorrow.
I'm not sure if you reasonably can apply that multiplier to officer prices.By the way, this particular piece of code didn't seem to apply SALARY_MULTIPLIER...
Ha! Well, we wouldn't want the game to be too easy, would we? People have been complaining before that they make money too quickly.All my fixes so far are making things more expensive, mwa-ha-ha!
I meant it wasn't applied when paying the crew on shore leave.I'm not sure if you reasonably can apply that multiplier to officer prices.
Ah! Sorry, I wasn't quite paying attention....I meant it wasn't applied when paying the crew on shore leave.
It is applied to all officer prices (at least all that I have checked so far). It was so before my fixes and will remain so.
Thanks, I think I'll able to finish this myself. Either way, I'm done for today, so feel free to focus on other things.If you need any help let me know. else I will focus on other stuff
// ***** 1: WORK OUT PAY FOR CREW *****
float amCrewPaymentQ = 5 + amCrewQty*12
amCrewPaymentQ *= (1.0 - (makefloat(amLeaderShip)*makefloat(1.0+GetOfficersPerkUsing(amCaptainChar,"IronWill"))/40.0)) * (0.5 + makefloat(GetDifficulty())*0.5);
if (TRACELOG == 1) { Trace("shore leave pay calculation: raw crew pay " + amCrewPaymentQ); }
// ***** 2: REDUCE CREW PAY *****
if (amCrewPaymentQ > 0) { amCrewPaymentQ /= SHORE_LEAVE_PAY_REDUCTION; }
int tempnumz1;
int tempnumz2;
string tempstringz1;
string tempstringz2;
int tempnumz3;
int tempnumz4;
int tempnumz5;
int tempnumz6;
for(tempnumz1=0; tempnumz1<TOWNS_QUANTITY; tempnumz1++) // screwface
{
tempstringz1 = "port" + tempnumz1;
if(!CheckAttribute(zMainChar,"ShipBerthing."+tempstringz1)) continue; // screwface
for (tempnumz2=1; tempnumz2<5; tempnumz2++)
{
tempstringz2 = "slot" + tempnumz2;
if(!CheckAttribute(zMainChar,"ShipBerthing." + tempstringz1 + "." + tempstringz2)) continue; // screwface
tempnumz3 = zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).status;
if (tempnumz3 > 0)
{
tempnumz4 = sti(zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).nowdue);
tempnumz5 = sti(zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).dailycost);
tempnumz4 += tempnumz5;
zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).nowdue = tempnumz4;
tempnumz4 = sti(zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).daysinberth);
tempnumz4 += 1;
zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).daysinberth = tempnumz4;
}
if (tempnumz3 == 2 && sti(worldMap.date.day) == 7)
{
tempnumz4 = sti(zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).crewnowdue);
tempnumz5 = sti(zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).captainindex);
tempnumz6 = GetCrewQuantity(GetCharacter(tempnumz5));
tempnumz4 += SBGetShoreLeavePay(tempnumz5,tempnumz6);
zMainChar.ShipBerthing.(tempstringz1).(tempstringz2).crewnowdue = tempnumz4;
}
}
}
That's the only explanation that I could think of.But why that 5 is added in the very beginning? Does it represent a nominal berthing fee that you pay even if you do not happen to have any crew?
int SHORE_LEAVE_PAY_REDUCTION = 4;
...
// ***** 3: WORK OUT OWN PAY AND OFFICERS' PAY *****
...
for(tempnumam1 = 1; tempnumam1 < 4; tempnumam1++)
{
tempnumam2 = GetOfficersIndex(amCaptainChar, tempnumam1);
if(tempnumam2 == -1) continue;
if(CheckAttribute(Characters[tempnumam2],"quest.OfficerPrice") && GetRemovable(&Characters[tempnumam2]))
{
tempfloatam1 = CalcEncOfficerPrice(Characters[tempnumam2])/5; // LDH 16Apr09
if (TRACELOG == 1) { Trace("shore leave pay calculation: officer taken into account, idx " + tempnumam2 + ", pay " + tempfloatam1); }
amOfficerPaymentQ += tempfloatam1;
}
}
...
if (amOfficerPaymentQ > 0) { amOfficerPaymentQ /= SHORE_LEAVE_PAY_REDUCTION; }
Where is that done? I see a factor of 5 there. Or is that crew factor of 4 applied to officers as well so that it becomes 4*5=20?CalcEncOfficerPrice returns the monthly officer's salary as shown on the interface screen. So, while crew salary on shore leave is quartered, officers' payments are reduced by a factor of 20(!).
Yep, in the last line of the quoted part.Or is that crew factor of 4 applied to officers as well so that it becomes 4*5=20?
Sounds to me like it should be "total crew pay + total officer pay) * SHORE_LEAVE_PAY_REDUCTION" or something like that.Yep, in the last line of the quoted part.
I had a quick look at that and it seems to be technically "Not a Bug".There is an unrelated problem with berthing charges: "Note however that berthing charges will be high (0 / month) and you will continue to pay the crew...". Without my changes it's still 0/month, so that's a separate issue.
switch (sti(ShipsTypes[STNum].class))
{
case 8: ShipCostBracket = 0; break;
case 7: ShipCostBracket = 0; break; // bracket 0 is for boats (class 7) - in this bracket berthing is free
case 6: ShipCostBracket = 1; break; // bracket 1 is for small to medium ships (classes 6 to 4)
case 5: ShipCostBracket = 1; break; // bracket 2 is for capital ships (classes 3 and 2)
case 4: ShipCostBracket = 1; break; // bracket 3 is for battleships
case 3: ShipCostBracket = 2; break; // bracket 4 is for manowars
case 2: ShipCostBracket = 2; break;
case 1:
switch(ShipsTypes[STNum].name)
{
case "Manowar1": ShipCostBracket = 4; break;
case "Manowar2": ShipCostBracket = 4; break;
case "Manowar_gub": ShipCostBracket = 4; break;
//default:
ShipCostBracket = 3; break;
}
break;
}
switch (PortCostBracket)
{
case 0: tempcoefficient -= 0.5; break;
case 2: tempcoefficient += 0.5; break;
}
// STEP 1/2: SET PRICING BRACKETS
int ShipCostBracket = (9-sti(ShipsTypes[STNum].class))/2;
if (TRACELOG == 1) { trace("ship placed in ship cost bracket " + ShipCostBracket); }