PaterBrown
Landlubber
Hi!
I hope you can understand me, because i am not a native english speaker ....
i have the same problem you have in GoF 2 (last patch). For all ships with more than 100 Sail Health Points you cannot repair the sail to 100% by you own reapir (only at shipyard).
After looking at all the code lines, i think i know where that problem comes from (the original code was only writen for 100 Sail HP, so there was never a difference in Sail HPs and percent).
All first codes are in Program/characters/CharacterUtilite
GetSailPercent
-> get the percent of the actual sail (actual SP / max SP * 100)
GetSailRPD (i think RPD = Repair Per Day)
-> value in percent (depends on skills)
GetSailSPP (SPP = Sailcloth Per Percent)
-> value of goods need for repair Per 1% (depends on Builder perk and ship class)
GetSailRepairDay
now all these values get loaded:
-> repPercent (Repair per Day in percent)
-> matQ (needed material)
-> tmpf (check if and how many sailcoth are on ship)
after that there is a check if there are enough goods for the full sail repair per day
then there is "return repPercent;"
if you look now at Program/battle_interface/BattleInterface
you find that in ProcessDayReapair there are the above listed commands and a new one: ProcessSailRepair
That one is writen in Program battle_interface/utils
in ProcessSailRepair there is a long code about checking if mast is down or not
and then every single sail get repaired by "OneSailDmgRepair" (one by one)
and know there is the actual repair with "OneSailDmgRepair":
1. there is a check if that special sail is damaged
2. check if more repair value than damage -> full repair of that special sail and return that repaired value (because the complete repair value get reduced by it and then next sail get checked)
3. if less repair value than damage, use it to repair sail, then stop
and somewhere in these two commands there is the main problem:
all single sails (they have sail health points) together get repaired by A PERCENT VALUE, but they should get repaired by:
(max Sail Health Points) * (repair value in Percent) / 100
(sail with refShip.SP = 500 get repaired with +5, not with +5% with is( 5% of 500) + 25)
i try to figure out where i can modify "OneSailDmgRepair" or "ProcessSailRepair" to actual repair the right amount of sail
i look at the value: fMakeRepair (in ProcessSailRepair)
float fMakeRepair = repPercent; -> is the amount of repair as a whole(the amount of repair points needed for repairing a single sail get subtract from this value), but in this code line it is a percent value (in original AoP COAS all ships have sail health points of 100 (ships_init, refShip.SP=100), so there was no difference between a percent value and the actual amount of Sail Health Points repaired per day
a possible solution is to modify this point so it becomes the real value:
IDEA: float fMakeRepair = repPercent * (refShip.SP) / 100
idea for changing the actual code: (same fSP as in GetSailPercent in CharacterUtilite)
float fSP = GetCharacterShipSP(chref);
float fMakeRepair = repPercent * fSP / 100
perhaps all my looking at this problem is wrong or useless,or i try to modify the code at the wrong position,
but there is a similar line in the command ProcessHullRepair (but there is no need for checking for falling mast and repair things (sails) one by one so it is much easier to understand)
float ProcessHullRepair(ref chref,float repPercent)
{
float dmg = 100.0 - GetHullPercent(chref);
if(dmg==0.0) return 0.0;
if(repPercent>dmg) repPercent=dmg;
int blotsQuantity = GetBlotsQuantity(chref);
int repBlots = makeint(blotsQuantity*repPercent/dmg);
DeleteBlots(chref,repBlots);
float baseHP = makefloat(GetCharacterShipHP(chref));
chref.ship.HP = baseHP+(repPercent-dmg)*baseHP/100.0;
if(sti(chref.ship.HP) > baseHP)
{
chref.ship.HP = baseHP;
}
return repPercent;
}
By the way, if you want to talk about this idea, you can PM me a skype or TS3 address and we can perhaps talk better about it!
I hope you can understand me, because i am not a native english speaker ....
i have the same problem you have in GoF 2 (last patch). For all ships with more than 100 Sail Health Points you cannot repair the sail to 100% by you own reapir (only at shipyard).
After looking at all the code lines, i think i know where that problem comes from (the original code was only writen for 100 Sail HP, so there was never a difference in Sail HPs and percent).
All first codes are in Program/characters/CharacterUtilite
GetSailPercent
-> get the percent of the actual sail (actual SP / max SP * 100)
GetSailRPD (i think RPD = Repair Per Day)
-> value in percent (depends on skills)
GetSailSPP (SPP = Sailcloth Per Percent)
-> value of goods need for repair Per 1% (depends on Builder perk and ship class)
GetSailRepairDay
now all these values get loaded:
-> repPercent (Repair per Day in percent)
-> matQ (needed material)
-> tmpf (check if and how many sailcoth are on ship)
after that there is a check if there are enough goods for the full sail repair per day
then there is "return repPercent;"
if you look now at Program/battle_interface/BattleInterface
you find that in ProcessDayReapair there are the above listed commands and a new one: ProcessSailRepair
That one is writen in Program battle_interface/utils
in ProcessSailRepair there is a long code about checking if mast is down or not
and then every single sail get repaired by "OneSailDmgRepair" (one by one)
and know there is the actual repair with "OneSailDmgRepair":
1. there is a check if that special sail is damaged
2. check if more repair value than damage -> full repair of that special sail and return that repaired value (because the complete repair value get reduced by it and then next sail get checked)
3. if less repair value than damage, use it to repair sail, then stop
and somewhere in these two commands there is the main problem:
all single sails (they have sail health points) together get repaired by A PERCENT VALUE, but they should get repaired by:
(max Sail Health Points) * (repair value in Percent) / 100
(sail with refShip.SP = 500 get repaired with +5, not with +5% with is( 5% of 500) + 25)
i try to figure out where i can modify "OneSailDmgRepair" or "ProcessSailRepair" to actual repair the right amount of sail
i look at the value: fMakeRepair (in ProcessSailRepair)
float fMakeRepair = repPercent; -> is the amount of repair as a whole(the amount of repair points needed for repairing a single sail get subtract from this value), but in this code line it is a percent value (in original AoP COAS all ships have sail health points of 100 (ships_init, refShip.SP=100), so there was no difference between a percent value and the actual amount of Sail Health Points repaired per day
a possible solution is to modify this point so it becomes the real value:
IDEA: float fMakeRepair = repPercent * (refShip.SP) / 100
idea for changing the actual code: (same fSP as in GetSailPercent in CharacterUtilite)
float fSP = GetCharacterShipSP(chref);
float fMakeRepair = repPercent * fSP / 100
perhaps all my looking at this problem is wrong or useless,or i try to modify the code at the wrong position,
but there is a similar line in the command ProcessHullRepair (but there is no need for checking for falling mast and repair things (sails) one by one so it is much easier to understand)
float ProcessHullRepair(ref chref,float repPercent)
{
float dmg = 100.0 - GetHullPercent(chref);
if(dmg==0.0) return 0.0;
if(repPercent>dmg) repPercent=dmg;
int blotsQuantity = GetBlotsQuantity(chref);
int repBlots = makeint(blotsQuantity*repPercent/dmg);
DeleteBlots(chref,repBlots);
float baseHP = makefloat(GetCharacterShipHP(chref));
chref.ship.HP = baseHP+(repPercent-dmg)*baseHP/100.0;
if(sti(chref.ship.HP) > baseHP)
{
chref.ship.HP = baseHP;
}
return repPercent;
}
By the way, if you want to talk about this idea, you can PM me a skype or TS3 address and we can perhaps talk better about it!
Last edited: