Author Topic: GetChallengeRating() gives 0.0f for PCs!?  (Read 476 times)

Legacy_Vendel_Arlefeldt

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
GetChallengeRating() gives 0.0f for PCs!?
« on: January 07, 2016, 08:51:25 am »


               

I have been trying to use the function float GetChallengeRating(object o). It works fine for NPCs, giving the toolset-rounded CR values I expect (A level 1 character of CR 0.66 in the toolset is rounded to CR=0.5, which is what the function returns).


However, trying to use the function on my PC consistently yields 0.000000, even after leveling the character to well past level 10.


What is up with this? Is there some other way I can get the CR of my PC via scripting?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
GetChallengeRating() gives 0.0f for PCs!?
« Reply #1 on: January 08, 2016, 04:35:10 am »


               


I have been trying to use the function float GetChallengeRating(object o). It works fine for NPCs, giving the toolset-rounded CR values I expect (A level 1 character of CR 0.66 in the toolset is rounded to CR=0.5, which is what the function returns).


However, trying to use the function on my PC consistently yields 0.000000, even after leveling the character to well past level 10.


What is up with this? Is there some other way I can get the CR of my PC via scripting?




t doesnt work on PCs


 


but there is a workaround, make a copy of the PCand runs the functon on the copy, then delete it (just theory untested)


               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
GetChallengeRating() gives 0.0f for PCs!?
« Reply #2 on: January 08, 2016, 05:54:08 am »


               

You need the Toolset to have CR calculated.  CopyObject() will copy over the CR of 0, and the game simply uses the value from the blueprint.


 


So the process to do this would involve converting either a player file or a database object entry into a creature blueprint and then running the Toolset on that.



               
               

               
            

Legacy_Vendel_Arlefeldt

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
GetChallengeRating() gives 0.0f for PCs!?
« Reply #3 on: January 08, 2016, 04:06:35 pm »


               

WhiZard, you are, sadly, right. A copy of my PC also has CR 0.0. And no matter how many feats I give my character, as long as it is level 1, another lvl 1 NPC is always the yellow "Challenging", when I examine. It does not seem like CR really works the way it is supposed to. Seems to be almost 100% based on levels = Hit Dice. How disappointing.



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
GetChallengeRating() gives 0.0f for PCs!?
« Reply #4 on: January 08, 2016, 10:28:19 pm »


               Out of interest, does the CR increase if you use a script to level up an NPC? Or is it predetermined by the toolset?
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
GetChallengeRating() gives 0.0f for PCs!?
« Reply #5 on: January 08, 2016, 10:48:51 pm »


               


Out of interest, does the CR increase if you use a script to level up an NPC? Or is it predetermined by the toolset?




 


The CR increments by one for each level gained, regardless of the actual CR increase that the Toolset would assign the result.


 


EDIT:  To further illustrate what happens, I am quoting myself from the wiki talk page on challenge rating


 



 


There is an in-game method of changing challenge rating. That is when an NPC levels up (through the scripting command LevelUpHenchman()) the CR is raised by one for each level the NPC gains. This can cause the CR to become different from the Toolset value. For instance, if I were to take a level 29 epic shadowlord (summon) and put its exact statistics into the Toolset, it would be valued at a CR of 36 instead of its in game value of 31 (at level 1 the creature is valued at a CR of 3 so 28 +1 = 29 and 28 +3 = 31). The main cause of such a difference is that LevelUpHenchman() will always roll maximum HP, while the Toolset bases its value on average; thus henchman that are leveled up will tend to be undervalued when it comes to challenge rating.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
GetChallengeRating() gives 0.0f for PCs!?
« Reply #6 on: January 08, 2016, 10:52:59 pm »


               


WhiZard, you are, sadly, right. A copy of my PC also has CR 0.0. And no matter how many feats I give my character, as long as it is level 1, another lvl 1 NPC is always the yellow "Challenging", when I examine. It does not seem like CR really works the way it is supposed to. Seems to be almost 100% based on levels = Hit Dice. How disappointing.




 


The challenge level text is a comparison of the NPC's CR to your hit dice.  It should change to tougher messages when the NPC has enough added benefits to go well above his hit dice.  Try giving an NPC an absurdly large amount of HP and you will see an impossible rating when compared to your PC of equal hit dice.


               
               

               
            

Legacy_Vendel_Arlefeldt

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
GetChallengeRating() gives 0.0f for PCs!?
« Reply #7 on: January 09, 2016, 05:50:19 am »


               

The other way around does not work, I can tell you. I compared a level 1 NPC of HP=5 to my level 1 PC with HP=144 and a lot of added feats. Still yellow "Challenging".