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 -
time_events.c not sure but atleast there is the whole crew salary etcHello colleagues.
I would like to know the code where the amount of ship maintenance is programmed.
A colleague has created a new mission for the TEHO and I can't test it because of the high cost.
int GetSalaryForShip(ref chref)
{
int i, cn, iMax;
ref mchref, offref;
int nPaymentQ = 0;
float fExp;
mchref = GetMainCharacter();
float nLeaderShip = GetSummonSkillFromNameToOld(mchref,SKILL_LEADERSHIP);
float nCommerce = GetSummonSkillFromNameToOld(mchref,SKILL_COMMERCE);
float shClass = GetCharacterShipClass(chref);
if (shClass < 1) shClass = 6;
if (!GetRemovable(chref) && sti(chref.index) != GetMainCharacterIndex()) return 0; // считаем только своих, а то вских сопровождаемых кормить!!!
// экипаж
fExp = (GetCrewExp(chref, "Sailors") + GetCrewExp(chref, "Cannoners") + GetCrewExp(chref, "Soldiers")) / 100.00; // средний коэф опыта 0..3
nPaymentQ += makeint( fExp * stf((0.5 + MOD_SKILL_ENEMY_RATE/5.0)*200*GetCrewQuantity(chref))/stf(shClass) * (1.05 - (nLeaderShip + nCommerce)/ 40.0) );
// теперь самого капитана и его офицеров (тут главный герой не считается) так что пассажиров и оффицеров ниже
if(sti(chref.index) != GetMainCharacterIndex())
{
nPaymentQ += makeint(GetMoneyForOfficer(chref)*2/(nLeaderShip + nCommerce) );
// офицеры
for(i = 1; i < 4; i++) // в к3 нет офов у компаньона :(
{
cn = GetOfficersIndex(chref, i);
if( cn > 0 )
{
offref = GetCharacter(cn);
if (GetRemovable(offref)) // считаем только своих, а то вских сопровождаемых кормить!!!
{
nPaymentQ += makeint(GetMoneyForOfficerFull(offref));
}
}
}
}
if(sti(chref.index) == GetMainCharacterIndex()) // все пассажиры и офицеры для гл героя
{
iMax = GetPassengersQuantity(mchref);
for(i=0; i < iMax; i++)
{
cn = GetPassenger(mchref,i);
if(cn != -1)
{
if(!IsCompanion(GetCharacter(cn)))
{
offref = GetCharacter(cn);
if (GetRemovable(offref)) // считаем только своих, а то вских сопровождаемых кормить!!!
{
if(CheckAttribute(offref,"prisoned"))
{
if(sti(offref.prisoned)==true) continue;
}
nPaymentQ += makeint(GetMoneyForOfficerFull(offref));
}
}
}
}
}
return nPaymentQ;
}
// boal новый учет зп <--
time_events.c not sure but atleast there is the whole crew salary etc
EDIT: mayby in Crew.cthat looks like it would affect the upkeep of the crew
EDIT 2: sry no clueCode:int GetSalaryForShip(ref chref) { int i, cn, iMax; ref mchref, offref; int nPaymentQ = 0; float fExp; mchref = GetMainCharacter(); float nLeaderShip = GetSummonSkillFromNameToOld(mchref,SKILL_LEADERSHIP); float nCommerce = GetSummonSkillFromNameToOld(mchref,SKILL_COMMERCE); float shClass = GetCharacterShipClass(chref); if (shClass < 1) shClass = 6; if (!GetRemovable(chref) && sti(chref.index) != GetMainCharacterIndex()) return 0; // считаем только своих, а то вских сопровождаемых кормить!!! // экипаж fExp = (GetCrewExp(chref, "Sailors") + GetCrewExp(chref, "Cannoners") + GetCrewExp(chref, "Soldiers")) / 100.00; // средний коэф опыта 0..3 nPaymentQ += makeint( fExp * stf((0.5 + MOD_SKILL_ENEMY_RATE/5.0)*200*GetCrewQuantity(chref))/stf(shClass) * (1.05 - (nLeaderShip + nCommerce)/ 40.0) ); // теперь самого капитана и его офицеров (тут главный герой не считается) так что пассажиров и оффицеров ниже if(sti(chref.index) != GetMainCharacterIndex()) { nPaymentQ += makeint(GetMoneyForOfficer(chref)*2/(nLeaderShip + nCommerce) ); // офицеры for(i = 1; i < 4; i++) // в к3 нет офов у компаньона :( { cn = GetOfficersIndex(chref, i); if( cn > 0 ) { offref = GetCharacter(cn); if (GetRemovable(offref)) // считаем только своих, а то вских сопровождаемых кормить!!! { nPaymentQ += makeint(GetMoneyForOfficerFull(offref)); } } } } if(sti(chref.index) == GetMainCharacterIndex()) // все пассажиры и офицеры для гл героя { iMax = GetPassengersQuantity(mchref); for(i=0; i < iMax; i++) { cn = GetPassenger(mchref,i); if(cn != -1) { if(!IsCompanion(GetCharacter(cn))) { offref = GetCharacter(cn); if (GetRemovable(offref)) // считаем только своих, а то вских сопровождаемых кормить!!! { if(CheckAttribute(offref,"prisoned")) { if(sti(offref.prisoned)==true) continue; } nPaymentQ += makeint(GetMoneyForOfficerFull(offref)); } } } } } return nPaymentQ; } // boal новый учет зп <--
nPaymentQ += makeint( fExp * stf((0.5 + MOD_SKILL_ENEMY_RATE/5.0)*200*GetCrewQuantity(chref))/stf(shClass) * (1.05 - (nLeaderShip + nCommerce)/ 40.0) );
so as i sayed earlier scripts/Crew.c and u want to edit this line:now to the numbers and how to balance it, didnt spend muche time or thinking bout that but i did edited this line of code for a test and it workedCode:nPaymentQ += makeint( fExp * stf((0.5 + MOD_SKILL_ENEMY_RATE/5.0)*200*GetCrewQuantity(chref))/stf(shClass) * (1.05 - (nLeaderShip + nCommerce)/ 40.0) );
here i posted the vanila lnie of code, this will only affect crew wages, not officer wages and/or ship repair costs in the file above this line is a line that increases the wages aswell based on ur ship, wchich rank it is, so only adjusting that one number shuld alread have an impact on salarys in general
ship repair cost are calculated diffrently based on ship rank base ship cost, + in general i think the game difficulty shuld have something to do as how muche everything shuld cost more but saddly forgotten to check that one so i will check it mayby tonight and will post my findings
On a side note if u using Hooks mod then the file scripts/Crew.c is aswell in the mod so edit that one included in hes mod, so that the mod properly works
EDIT: the value *200* in middle of that line i guess its the base peso payment per crew member be4 that is the formula on increasing the wages based on ur crew exp if thay landlubers or sea dogs, and behind the 200 is the formula of cre quantity and ship class to further increase the wages then a small debuff based on ur leadership and trade skills.... so if u want to do it on fast without going into math, change the 200 to 100 u will lower the wages ~half, if ur crew will still be to greedy cut it to 50 or even 0, for mod testing ur crew can do some charity work
I like the sound of that... "charity work"...EDIT: the value *200* in middle of that line i guess its the base peso payment per crew member be4 that is the formula on increasing the wages based on ur crew exp if thay landlubers or sea dogs, and behind the 200 is the formula of cre quantity and ship class to further increase the wages then a small debuff based on ur leadership and trade skills.... so if u want to do it on fast without going into math, change the 200 to 100 u will lower the wages ~half, if ur crew will still be to greedy cut it to 50 or even 0, for mod testing ur crew can do some charity work
You welcomeThank you very much for the tip, I will try it.
You welcome
pls let me know if that helped or was more or less that what u where looking for, ty
Thank you very much for your help.Just wanted to add a ref. regarding officer wages.
Open scripts/Crew.c with notepad++. In line 80 " (if (CheckAttribute(Npchar, "Payment") && makeint(Npchar.Payment) == true) " if you set end value to false removes officer wage alltogether. Since its script this can be turned on/off without starting a new game.