How to disable Max HP on level up?

Hi, everyone!

Does anyone know how to disable max HP rolls when leveling up?

I know that in NWN 1 after the 1st level, you roll your class Hit Die and then add the CON modifier, but in NWN 2, it seems that each level up gives you max HP, which is something that I dislike, as I got used to playing it the “PnP way” with NWN:EE, and BG/IWD games.

I tried searching for this around the net, but I haven’t had any luck so far.

The closest thing that I got to was this Steam guide describing the opposite process for NWN:EE, so I figured I might try it out by adding the “Max Hit Points=0” line to the “nwn2player.ini” file, but unfortunately, it did not work.

So, I’m wondering, would anyone here know how to do this?

Are there any mods, or .ini tweaks that I could use to make this possible, or is it hardcoded?

1 Like

Hi Klaus99
this can be done in different ways.

  1. a way in file 2d to reduce hp for the required class to 2, but still 2 hp will remain.
  2. the way to use scripts
    e.g. module heartbeat
    if a player has hp more than 1, then he loses all “extra hp”.
    1 hp - YouTube

that is: if you want the players to have health, say no more than 60 hp, just change the script a little and that’s it. if something is not clear, you can always ask me or someone else.
if you want to remove the damage animation, maybe you can also turn it off somehow.-this just example

here is an example script

void main()
object oPC = GetFirstPC();

int nHP = GetCurrentHitPoints(oPC);	 
int newHP = nHP-1;//leace player only 1 hp
effect eDamage = EffectDamage(newHP,DAMAGE_TYPE_DIVINE);

//player have more than 1 hp. we reset hp
if(nHP>1){ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage,oPC);



here files
example area.7z (600.4 KB)
if you know how to create modules
just open an empty toolset

!!!it is important that the name is empty so that there is no confusion of names, my area is called area 1.

and export my erf file
then set the spawn point in area 1 and save the module.
then run the module and look at the result.

for those who are interested in this topic can be used to manage the amount of hp received using

if/else condition

GetLevelByClass// Determine the levels that oCreature holds in nClassType.
// - nClassType: CLASS_TYPE_*
// - oCreature
int GetLevelByClass(int nClassType, object oCreature=OBJECT_SELF);

1 Like

You’re brave, I’d be dead in seconds :woozy_face:

1 Like

Thank you for the suggestion @lord_XD, but that’s not really what I wanted.

I don’t want to gain only 1 HP on level-up. Instead, I want to do it the PnP way of rolling the Hit Die and then adding any CON modifiers to it.

For example:

A Human Fighter with 16 (+3) CON

At 1st level, he would have 13 HP (10 (class) + CON (+3) = 13). He gets a maximized roll on his hit die (d10) because at the first level, all classes get their hit die maximized, and then apply the CON bonuses (if any).

At 2nd level (and any level after that), he would now have to roll his class Hit Die (i.e. d10) and then add the CON bonus

So for example, at level 2, let’s say I rolled 5 on the d10. I add the CON bonus (+3) to that roll, and now I go from 13 HP to 21 HP.

On level 3, let’s say I roll a 3. Once again, I add the CON bonus (+3), and add the sum to my total hit points, which are now 27 HP.

On level 4, let’s say I got unlucky and rolled a 1. I add the CON bonus, and now my HP goes from 27 to 31.

And so on with the rest of the levels…

The way the game currently handles it is by giving you the maximum roll each time you level up. So, in the previous example above, that Human Fighter would have:

  • 13 HP at level 1
  • 26 HP at level 2
  • 39 HP at level 3
  • 52 HP at level 4


pretty sure it’s inaccessible …

we’d need a function like SetMaxHitPoints(int iHp, object oCreature)

that alters hitpoints away from the hardcode-calculated value …


did you read?

you can realize what you want, you just need to take away the extra hp - do you understand my point?

say if you’re a fighter do like
get current hits
then the second variable throw a die let’s say d10
dropped out for example 4 and set this value
as a variable and save it

and at the next level repeat
we get we have a variable 4 is unshakable + D10
throw a bone, get 9 hp.
we subtract from the total number xn which is 20 -13 and we get the number which must be subtracted from the total number
and we take away only 7 hp when resting
and we have 13 hp.

we can do without the function- im sure.we just need variables .

if you understand me-you can do this.
or maybe if no one sure in my idea-
funny - as if I need it most of all. direct sports interest.
i can do that by myself and give proof. :sweat_smile:

Ah, that’s a shame. I thought there would be a way to do it somehow.

@kevL_s I’ve seen several of your posts on these forums, and you seem most knowledgeable about this.

Would it be possible to find out how NWN 1 does it?

In NWN 1, whenever you gain a level, you roll your hit die, but with the release of the Enhanced Edition, there is now an option of enabling “Max HP on level-up”, plus, I’ve heard that Beamdog managed to un-hardcode a lot of stuff in the toolset, so maybe there’s something in there that would help in creating a mod for NWN 2 as well.

I’d do it myself, but I’ve never dabbled with the Toolset or the scripting in both games :frowning:

not really. Nwn1/EE is basically completely different program code.

There are people sorta randomly working on writing an opensource executable for Nwn2 and access to MaxHP could be implemented there …

Nwnx4 for multiplayer could also back-engineer our current executable and implement a function that sets MaxHP … but that could get tricky since a bunch of things depend on the value.

Eg. what @lord_XD is suggesting is, i think to set an extra variable that tracks how much to decrease a character’s hitpoints each time the character rests. Then hit the character with a damage-effect after resting. But it’s not as simple as that, it seems to me; the MaxHP would still appear on the inventory/character/partybar GUIs (so they should be tweaked i guess) … and i doubt that a player would like to get hit with damage right after resting … and the character would also need to be hit with damage if healed above the altered maximum … so overall things should really be kept consistent with the hardcode … or so it seems to me.

plus roughly speaking other things like effect TempHP (which adds hp to the current/maximum value) would likely need some special consideration …

additionally the function GetMaxHitPoints() should then be altered to return the decreased maximum …

/and so it goes


RandomHPOnLevelUp.7z (9.2 KB)
As others have said, there’s no good way of doing it, but if you’d like a questionable way of doing it instead I have something you can put in your override. The basic functions seem fine, but I’m not particularly inclined to test a whole playthrough with it right now, and I am not at all confident it won’t run into any issues (nothing game-breaking likely, but still).

A few things to know: it lowers max HP by adjusting hit die in classes.2da, and adjusting max HP separately. This very likely has unintended consequences elsewhere, because anything that relies on this value will be incorrect. For regular enemies this shouldn’t be an issue because they have pre-defined HP values, but if anything tries to level up it’ll use these lower values and will have low HP. Off the top of my head I can’t think of much that does this, but I’m sure they exist.

This does, however, include party members - there’s no good way of capturing party member levelups, so you have to run a script manually when they first join, and after each time you level them up. Open up the console, enable debug mode (type “debugmode 1”), followed by “rs rhp_onlevel” while targeting the party member and it should work.

Upon joining, party members will have the lowest HP possible (1 per level + CON/feat bonuses). You can increase it yourself by a specified value by running the script “rhp_increasemaxhp(x)”. (Roll some dice to decide what, if you like! Just remember they get 1 HP per level already, so make sure to account for that.)

This also counts for the PC if you start a whole new campaign (such as going from OC to MoTB), as the variable tracking max HP does not carry over.

If you ever notice that, within the same campaign, your max HP drops similarly low despite working previously, run the script “rhp_init”.

All of this could be automated, but I’ve already spent enough time on it as is, if you (or somebody else) try it out and find that it’s working reasonably well I might return to it and fix it up.


@Akhacha - Off topic: I just wanted to say that it’s great to see a new person here on the vault that seems to be great at scripting and who works with NWN2! Thank you for contributing your knowledge, Akhacha! :slightly_smiling_face:


There are people sorta randomly working on writing an opensource executable for Nwn2 and access to MaxHP could be implemented there …

That sounds interesting. If they manage to do it, I bet it could open up plenty of options for modding the game, which is really nice :slight_smile:

Is there a website or a blog or something where these guys post their progress? I would really like to see how the project turns out.

@Akhacha Thanks for the scripts, it seems to somewhat work. I only tested it on a couple of characters with different stats and feats, and using the console to give them XP to level up.

So far, on each level-up the hit points gained are randomized, which is great. I did notice however that having a negative CON modifier doesn’t affect the results as it should.

For example, I created an Elf Wizard with 6 CON (-2).

Without your scripts, his HP on the 1st level was 2, and on each subsequent levels, he gained 2 HP. So it went from 2 to 4 to 6, etc.

When using your scripts however, on the 1st level, he had 4 HP (?), instead of 2 somehow, and on each subsequent level ups, up to level 20, he would gain HP in the range from 2-4, instead of 1-2 (hit die + CON = d4 + (-2) = 1 to 2)

I didn’t have Toughness feat or any similar feats that would affect the character’s HP.

Another thing that I noticed was that after de-leveling him (by giving him negative XP), his total health did not change and stayed the same (around 50 in this case) as when he was level 20. This behavior does not appear when running the game without the scripts, as his HP is reseted back to 2.

Upon joining, party members will have the lowest HP possible (1 per level + CON/feat bonuses).

I noticed that as well. After skipping the tutorial/Harbor Fair area, you and your companions are given enough experience for level 3, and I noticed that Amie and Bevil had only 3 HP (4 for Bevil because of his Toughness feat).

That’s all the testing that I did.

Overall, I think it’s an interesting workaround, so thank you for sharing. If you can somehow create a script without altering the 2DA files, or reducing companions HP, that’d be great, but I doubt we could do much at this point, as it seems to be hardcoded.

The only hope we have is for that open-source project that @kevL_s mentioned, or until someone figures out a way to un-hardcode functions from the game files.

Negative CON bonuses are a bit complicated, because it seems the game enforces a minimum of 1 HP per level regardless of other stats, and then the math becomes a bit of a mess if you were to gain CON from equipment or buffs.

Doing it without adjusting 2da files I don’t see any way of making happen, because there’s simply no effect that can do this. Adding bonus HP is doable, but it can’t be a negative value, so this is the only option available.

Companion HP is lowered, but that’s why you have to run the script upon having them join, as well as after leveling them. It’s doable to automate this, but time and effort and all that, and it’s also a question of how much interest there would be in a solution as this, as it’s definitely an awkward workaround.


Thanks for the link!

It looks like a great idea. I wish team Xoreos the best with this project if they’re still working on it (seeing as how the last release was 3 years ago).

1 Like

That bugged me too. As already said you can somewhat script your way around the issue. Personally i just altered the HitDie column in classes.2da and lowered it to half the original amount +1. A fighter for example gets 6 HP on level up. This was done to all classes and monsters and creates an even playing field without devaluing spells. I hated that max HP just transformed damaging spells into worthless trash.
Nowadays I also like playing DnD tabletop without random HP. Getting unlucky with the dice leaves you with a crippled fighting class - destroying the “balance”.

On another note: did someone find out which hex address to edit to change the given ability points at character generation? I’d like to lower them to something in the range of 25-28 points.

How did this elf ever survive wizard school ? If he messes up any of his first flame spells he’s dead !

Do that and I don’t want to play anymore :sob:

Personally I look at hit points as nothing to do with how much you can get hit because that’s a bit silly. The idea that after a couple of months of adventuring you can get stabbed by twenty orcs and walk away is ridiculous.

I would’ve thought that what would make more sense is that you learn to avoid getting hurt as your fighting experience grows. Wizards learn less because they’re not in the thick of it and too busy reading, rogues get more “dodgy” and that sort of thing. So the more fights you get involved in the better your chances of not taking that lethal blow.

In a big fight you lose your focus as things get more hectic or when dealing with a more experienced fighter you’re overwhelmed by their skill and healing potions are just a bit of magic to get your focus back.

The weapons used in fantasy games are very dangerous with any contact, hit your finger with a small hammer when banging in a nail and you’re incapacitated for a while so you cannot shrug off a hit with an axe or walk around like a human porcupine after dealing with goblin archers. If that was the case you’d be doing a monty python knight having nothing but a flesh wound.

Bring on the hit points, the more the merrier.

1 Like

let’s get by
those that the player has lost? - let him believe that they are not.

how do you like a warrior with 1 hit - try to survive!
Now defeat the dragon! How? This will be interesting.:sweat_smile:
This will make it more interesting than the usual boring game of hack and slash.
I really like this idea. I’ll have to try it on the players.