GetChallengeRating for PC

    object oPC = GetFirstPC();
    SendMessageToPC(oPC,"My CR = "+FloatToString(GetChallengeRating(oPC)));

Any idea why the above prints 0.000? The Lexicon says:

Challenge ratings are stand alone. In other words, the value is not in comparison to anything, but rather a straight up value.

I think in D&D v3 PC’s do not have a CR.


1 Like

It returns 0.0 for PCs. CR is tied to a creature’s blueprint.

1 Like

You can create your own custom function in NWScript that calculates player CR though.

That would be quite complicated however, it can be done dynamically, but the values will be probably not what you expect. The vanilla CR values aren’t exactly matching real power (for example devastating critical has 0.5cr and so does epic dodge, and useless feat such as perfect health has 1.0.

So I guess it would be better to just chain if conditions in this way:

CR = hitdice;
if(hasfeat(devast)) CR+= 5;
if(hasfeat(epicdodge)) CR+= 4;

quite a lot of work what do you need this for?

1 Like

Thanks. That makes sense now specially how there is a recalculate creature CRs in the build options.

I’m trying to create balance encounters using the standard encounter system and want to see how the CRs of the PC and monsters compared. Any idea how the standard encounter system works? Does it run its own CR functions that is not exported to NWScript on the PC or does it just work off HD alone?

Yes you’re absolutely right the CR system have plenty of holes but it is better than just working on HD alone as equipment makes a huge difference in higher levels.

checked the engine code in debugger but it is extremely complicated, i didn’t see the code to calculate CR anywhere

i know however that having associates along yourself can cause encounter to select tougher enemies, it depends on monster selection and their CR in encounter but it can happen

1 Like

Thanks for the info. Looks like it is just one big black box. LOL

Ideally I’d like to know what it would spawn in any particular situation without having to test it out every time. Maybe I should just make my own encounter system.

Not only that, but it takes into account the CR (or equivalent) of your associates. In testing various henchmen, I have found a significant difference in random encounters between the weak henchmen (CR 1/2) and the powerful ones (CR 2).

1 Like