Ah, I didn't realize that Level 1 NPCs also had the feature to adjust NPC XP on rejoining. Thanks for pointing this out to me, this could be exactly what I am looking for.
It seems you are familiar with how this mod works in this regard. What does "more closely match the player character's experience" means exactly? So how does the mod achieve this and what could be altered in said baf- or bcs-style to change the mechanism?
The baf-file is the uncompiled script file - aka before installation of the mod component, the compiled baf-file is a bcs-file and present in your
BG2 installation after installing that mod component.
Name and location of the file in question:
before:
Your
BG2 directory\level1npcs\xpmod\fjxpmooc.baf
conveniently editable by any text editor worth his salt (ConTEXT, Notepad+, Crimson etc.).
after:
fjxpmooc.bcs
editable by using Near Infinity or
DLTCEP, there are probably some more programs which I forgot, but those two are the most up-to-date, and most commonly used programs for general purpose editing/modding.
Content of this file and function:
A lot of if -> then clauses comparing
xp values of your main character to the newly joined party member, and adding a certain amount of
xp to said party member based on those if -> then clauses.
If your main character has more
xp it's
AddXpObject(LastSummonerOf(Myself),100)
for example.
If it's the other way around, and your main character has less
xp, it's
AddXpObject(LastSummonerOf(Myself),-100)
for example.
Scripts are parsed from top to bottom, therefore it begins with the highest possible
xp achievable in a normal game:
IF
CheckStatGT(Player1,7999999,44)
CheckStatLT(LastSummonerOf(Myself),7000000,44)
THEN
RESPONSE #100
AddXpObject(LastSummonerOf(Myself),1000000)
END
IF
Check if main character has more than 7999999
xp AND
Check if newly joined party member has less than 7000000
xpTHEN
add 1000000
xp to the newly joined party member.
END
Slight detour:
That's by the way exactly the point where it breaks apart in heavily modded games, with mods which remove the xp-cap and extend the level cap to level 50, dole out many high xp rewards to the party to reach such a high level, and with a theoretical absolute xp-cap of 45,000,000 xp (a fighter/mage/thief or fighter/mage/cleric). To clarify, it's breaking apart because it doesn't add any more xp after that 8,000,000 mark in such games.
Level 50 rules without an xp-cap greatly benefit multi-classed characters (several classes are raised simultaneously) and to a lesser extent dual-classed characters (abandon one class to advance in another). That's due to the fact that even the slowest advancing class (Druid) reaches its cap at 17,500,000 xp.Detour to Icewind Dale 1 + all addons:
Multi-class characters rule the Heart of Fury difficulty due to a removed xp-cap with a level 30 cap still in place.
As there are no Continue() after AddXpObject() the script starts over from the top.
Example:
Main character (mc) with 8,000,000
xpNew party member (npm) with initally 2,500,000
xp1. As that if clause posted above is true, it awards npm with 1,000,000
xp.
2. Npm has a new
xp value of initial value + 1,000,000
xp.
3. If if clause is still true, go to 1.
That repeats itself until npm reaches 7,500,000
xp.
If you're reading that script from top to bottom, you'll notice that the potential
xp difference keeps getting larger the more
xp the main character has. That's the place where you could fine tune it to your liking by using smaller
xp comparison steps and adjusting the added
xp accordingly.
In case you're wondering why it takes such a huge amount of code if it could have been solved by simply doing something like that:
NewXP=GetXP(Player1)
SetXP(PlayerX, NewXP)
That's due to the limitations of the game engine.
10th
Avast! You cannot defeat our titan-mounted submarine staffed by cannibal vikings! - Nodwick
"I grab his deceased spirit and piledrive it back into his body, duplicating raise dead." - Psyren Oots board