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 -
bool AddXP(ref chref, string expName, int _exp, string group)
{
int cn,xp,cidx,i;
float xpmult;
bool LevelUp = false;
//First catch some weird cases which shouldn't happen in the first place. let log if they do happen.
if(!CheckAttribute(chref,"index")) { return false; if(DEBUG_EXPERIENCE>0) Trace("XP ERROR: Character "+GetMySimpleName(chref)+" has no index");}
if(sti(chref.index)<0) { return false; if(DEBUG_EXPERIENCE>0){ Trace("XP ERROR: Character "+GetMySimpleName(chref)+" has index smaller than 0");} }
if(_exp < 0)
{
_exp = -(_exp);
if(DEBUG_EXPERIENCE>0) Trace("XP ERROR: NEGATIVE XP CALL");
}
if(_exp == 0)
{
if(DEBUG_EXPERIENCE>0) Trace("XP ERROR: ZERO XP CALL");
return false;
}
if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Called AddXP for "+GetMySimpleName(chref)+" with skill: "+expName+" and xp: "+_exp+" and group: "+group);
//Add a difficulty multiplier
float diffmult = 1.0-((GetDifficulty()-1.0) / 6.0); //Let's make it a bit less dependent on difficulty
//If we are only doing the player we can return here (for performance reasons)
if(group == XP_GROUP_PLAYER)
{
xpmult = GetXPmult(expName);
xp = makeint(makefloat(_exp)*xpmult);
if(AddXPtoChar(chref, expName, makeint(diffmult*xp))) LevelUp = true;
return LevelUp;
}
//Check for shared experience
bool SharedXP = GetOfficersPerkUsing(chref,"SharedExperience");
if(DEBUG_EXPERIENCE>1) { if(SharedXP) Trace("XP LOG: SharedXP is active"); }
//Now handle the officers
if(group == XP_GROUP_OFFIC)
{
//First see if we are an officer or companion of a group.
cidx = FindCaptainIndex(chref);
if(cidx > -1)
{
if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Captain found so let's check for captain instead");
//We seem to be part of a larger party so let's check for the whole party
if(AddXP(&Characters[cidx], expName, _exp, XP_GROUP_OFFIC)) LevelUp = true;
return Levelup;
}
else
{
//Seems we are the captain so let's first assign some XP to ourself
if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Checking Officer captain with id "+chref.index);
if(AddXP(chref, expName, _exp, XP_GROUP_PLAYER)) LevelUp = true;
//If we are the captain then assign xp to the characters
for(i=0; i < GetPassengersQuantity(chref); i++)
{
cn = GetPassenger(chref, i);
if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Checking Officer "+i+" with id "+cn);
//Filter prisoned characters
if(CheckAttribute(Characters[cn],"prisoned") && sti(Characters[cn].prisoned)) continue;
//Check if this officer deserves the XP
if (IsOfficerOf(&Characters[cn],chref))
{
//We need to be an officer, passengers don't get any experience at all because they are only "passengers"
float skillmult = GetOfficerSkillFactor(&Characters[cn], expName) / 2; //this will make 100% skill contribution give 100% XP and 50% skill contribution give 50% XP
if(SharedXP || expName == "") skillmult = 1; //If SharedXP is active we should always have 100% XP
if(DEBUG_EXPERIENCE>1) Trace("XP LOG: skillmult = "+skillmult);
if(skillmult > 0)
{
if(AddXP(&Characters[cn], expName, makeint(_exp*skillmult), XP_GROUP_PLAYER)) LevelUp = true;
}
}
else
{
DumpAttributes(&Characters[cn]);
}
}
}
}
//Now handle the companions
if(group == XP_GROUP_PARTY)
{
//Check if there is a leader of the group
cidx = GetCompanionOf(chref);
if(cidx > -1)
{
//If there is a leader let's call the function for him instead
if(AddXP(&Characters[cidx], expName, _exp, XP_GROUP_PARTY)) LevelUp = true;
return LevelUp;
}
else
{
//If we are the leader then give XP to the characters
if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Checking companions");
if(GetCompanionQuantity(chref) > 0)
{
for(i=0; i < 4; i++)
{
cn = GetCompanionIndex(chref, i);
if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Checking Companion "+i+" with id "+cn);
//Filter prisoned characters
if(CheckAttribute(Characters[cn],"prisoned") && sti(Characters[cn].prisoned)) continue;
//Add multiplier for companions
xp = makeint(_exp*XP_GAIN_COMPANION);
//Now add the XP to the companion and maybe his officers
if(AddXP(&Characters[cn], expName, xp, XP_GROUP_OFFIC)) LevelUp = true;
}
}
}
}
//returns true if there is a levelup somewhere
return LevelUp;
}
Do you mean "party" or "specific character"? If not, I'm not sure I quite understand....XP is either for party or officers (or player in some edge cases)
So if it gets called for a random character, it will try to find a captain for that character and then apply the function to ALL other characters assigned to that same captain?If the function is called for officers it will determine all of the officers for the captain. If you are not the captain of this group it will find the captain and call it again for the officer group.
This post of yours is why we've been thinking about how this should be handled in the first place:I don't see why it has to be this complicated. In the stock game everyone got the XP they personally owned, and if the character had the perk "Shared Experience" then other active officers got a share of it as well. In the Build Mod active officers all got a share anyway, and a larger share if the character who earned it had "Shared Experience". I'd rather like that back, not least because it's how I train my officers in Melee.
You observed that your officers weren't getting ANY "Shared XP" anymore until you got the "Shared XP" perk yourself.In the stock game, officers only gained a portion of your XP increase if you had the "Share Experience" perk.
For much of the history of the Build Mod, they'd get a little XP whenever you did, and a bigger portion if you had "Share Experience".
Now we seem to be back to stock behaviour. Playing with the 17th December update, I notice my officers gaining nothing, at least until I got "Share Experience". This tends to make officers less useful because while they're gaining nothing unless they killed someone or did something directly themselves, you're rising through the levels and gaining perks, to the point where you'll probably have all the important perks before the navigator, gunner and boatswain have earned their respective sets of perks. Having played various versions of PoTC back to the stock game, I know what "Share Experience" is for (in the stock game it was one of the first perks I got, and is likely to become so again). New players may not notice it lurking at the bottom of a now very long list of perks, let alone realise how important it is if you want your officers to progress.
Party = you + companionsDo you mean "party" or "specific character"? If not, I'm not sure I quite understand....
As you said. Although thinking about it more there is a logic flaw now which will prevent them from getting xp for fencing etc. Will fix that later today.So if it gets called for a random character, it will try to find a captain for that character and then apply the function to ALL other characters assigned to that same captain?
So the difference is whether the function gets called at sea or on shore?Party = you + companions
Officers = you + shoreparty
My first impression would be that fencing shouldn't really be shared in the first place.As you said. Although thinking about it more there is a logic flaw now which will prevent them from getting xp for fencing etc. Will fix that later today.
That seems fair enough to me; provides a specific use for that skill, after all.If you want to help them gain fencing xp you need to get sharedxp.
But I think we shouldn't need that now.@Pieter Boelen we could always add a dialog option to your officers where you can trainer them at a certain skill (if you are higher in that skill) but it will cost you. I would say it would cost you money. We might be able to later make this into a more immersive function with "trainers" or something like that but for now it would allow people to get theire officers up to a certain level if they want.
same here. Altough after the public release I do want to look into something like that eventually I think .But I think we shouldn't need that now.
Why bother? That would just be adding more micro-management. Plenty other things to take care of!same here. Altough after the public release I do want to look into something like that eventually I think .
Because I like character building .Why bother? That would just be adding more micro-management. Plenty other things to take care of!
Or unless we pretend that merely being present at a battle and watching what the veterans do helps a novice gain experience, the way soldiers become veterans in reality.My first impression would be that fencing shouldn't really be shared in the first place.
Unless we pretend that when you get Shared XP, all characters who gain fencing XP serve as "Fencing Instructors" for the other officers.
No, I train them by having them involved in fights and looking after them.@Grey Roger indicates that he likes to train his officers in melee without actually having them involved in fights.
While that seems a bit counter-intuitive to me, it may become important later in the game.
That is exactly what I do - hire an officer with low "Melee", then take him into fights. Not boardings, he's been told to stay out of those; but he will be present when we run into thugs or highwaymen. I have high "Melee" skill at this point and so does at least one other officer, so between us we can keep the novice alive. He gets some XP for being in the party involved in the fight, and eventually his skill builds up to the point where he can be allowed into boardings.Imagine hiring an officer with low fencing at a time when enemies are always relatively strong.
Then if they have to gain that XP themselves, you'd HAVE to take them into fights.
And when you do, they'll probably die instantly. So then some sort of "simulated fencing practice" does seem required.
If the officers-to-be-trained do participate in the fighting, they definitely get the XP for it. Right?Hmmm.... I see where you are getting at @Grey Roger could you please test with the latest Version is your way of "Training" them still works?
If they participate they get XP. But if they just Keep theire distance and don't do anything they wont.If the officers-to-be-trained do participate in the fighting, they definitely get the XP for it. Right?
Or should the shore party, with Shared XP, get EXTRA fighting XP when other characters in the party gain it?
That might end up being a bit much....?
Also in Fencing then?If you have SharedXP they will also get XP gained by others.