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

Thanks & Questions

little_jos

Landlubber
Hi everybody,

first of all i woukd like to thank the whole POTC Build Mod modding team for such an awesome mod world as the one they have created. I discovered build 13 some years ago, and just loved it. A short while ago i came back to find Build 14 beta 1.
Sadly patch 6 would not behave properly on my computer.
Unbelievably patch 7 would came the very same day i decided to stop trying.
Patch 7 is running smooth.
So thanks. Thanks for the mod, and THANKS for the latest patch.

Now, the questions, and please forgive me if this is not the proper forum where to ask them.
I've been messing around with the text archives a little bit, just to add some flavour to my liking (and maybe creating a short campaing) and i'm starting to grasp some things, yet i find difficult to find/understand how the damage mechanics are/work. Can somebody point me in the right direction, or explain how melee & accuracy, piercing and blocking are taken into account?

and, Where can i find the code that manages the recrutable officers in taverns? Sometimes i don't find much sense in a level 4 captain recruiting a much more competent level 7 first mate...

well, thanks in advance, and thank again!
 
Welcome to the forum, mate; I hope you'll have a good time with us here! :onya`

For the damage calculations, have a look at PROGRAM\Loc_ai\LAi_events.c and LAi_fightparams.c .

I'm not sure about the officers, but I think PROGRAM\Dialog_func.c is your best bet. :doff
 
Hey there!

I read a bit the code in LAi_fightparams.c and got the melee and gun damage mechanics. About the melee, after some (quite rough) calculations, and please correct me if i'm wrong, the main factor seems to be the level of-and the level difference between- contenders, as a lower level character would get damage-beefed against a superior level character. As i said i might be wrong, didn't get much time and my c++ habilities are quite long untrained.

By the way, may i move further discussion/help over this issue to that "melee improvements" topic? is that ok?

Thanks in advance!
 
Go right ahead, mate! That's probably a better idea in the first place, since I'm not too familiar with that code and Baste has recently been rewriting it, so he should be able to help you much better. :yes
 
It seems you've understood the piercing calculations so I won't talk about that. About the melee damage calculations, as far as I've understood it, it is like this:
First a calculation based on the weapon's minimum and maximum damage is done:
Code:
float LAi_BladeCalcDamage(aref attack)
{
//Ðàñ÷èòûâàåì ïîâðåæäåíèå îò ñàáëè
float min = 10.0;
float max = 10.0;
if(CheckAttribute(attack, "chr_ai.dmgbldmin"))
{
min = stf(attack.chr_ai.dmgbldmin);
}
if(CheckAttribute(attack, "chr_ai.dmgbldmax"))
{
max = stf(attack.chr_ai.dmgbldmax);
}
float dmg = min + (max - min)*(rand(100)*0.01);
return dmg;
}
Then, any abilities are taken into account:
Code:
	float dmg = LAi_BladeCalcDamage(attack);
dmg = dmg*kDmg;
//Àòòàêà ñâîåé ãðóïïû
kDmg = 1.0;
if(IsCharacterPerkOn(enemy, "BasicDefense")) kDmg = 0.9;
if(IsCharacterPerkOn(enemy, "AdvancedDefense")) kDmg = 0.8;
if(IsCharacterPerkOn(enemy, "SwordplayProfessional")) kDmg = 0.7; // Baste
dmg = dmg*kDmg;
float damage = LAi_BladeApplySkills(attack, enemy, dmg);
And then, the contenders skills are taken into account:
Code:
float LAi_BladeApplySkills(aref attack, aref enemy, float dmg)
{
//Ó÷èòûâàåì ñêèëû
float aSkill = LAi_GetCharacterFightLevel(attack);
float eSkill = LAi_GetCharacterFightLevel(enemy);
if(aSkill >= eSkill)
{
dmg = dmg*(1.0 + 2.0*(aSkill - eSkill));
}else{
dmg = dmg*(1.0 + 0.5*(aSkill - eSkill));
}
// NK -->
dmg *= (0.75 + fRand(GetSummonSkill(attack, SKILL_SNEAK))/(40.0/3.0));
dmg *= (1.5 - fRand(GetSummonSkill(enemy, SKILL_SNEAK))/(40.0/3.0));
float piercing = 0.05;
float block = 0.01;
if(CheckAttribute(attack, "chr_ai.piercing"))
{
piercing = stf(attack.chr_ai.piercing);
}
if(CheckAttribute(enemy, "chr_ai.block"))
{
block = stf(enemy.chr_ai.block);
}
if(piercing > block*2 && piercing > 0.1) dmg *= (1.0 + fRand(piercing)/2.0);
if(sti(attack.index) == GetMainCharacterIndex()) dmg *= (1.45 - 0.15*GetDifficulty()); // NK Diff Mod
else { if(sti(enemy.index) == GetMainCharacterIndex()) { dmg *= (0.85 + 0.15*GetDifficulty()); } } // NK Diff Mod
// NK <--
return dmg;
}
"FightLevel" is the character's melee combat skill divided by 10.

This is how it works at the moment, but I am going to try some more changes to it. Anyway, the level of the contenders aren't taken into account, but their skills are. I hope this explains it at least somewhat. :)
 
Back
Top