Page 1 of 1

current max exp

Posted: Sat Mar 26, 2016 5:27 pm
by RayB
In Grim 2 the maximum experience needed for a level up starts out at 1000. This maximum increases as the game progresses. Is there a function I can use to get the current maximum experience needed for a level up at any point in the game? I know I can use setSkillPoints() or addSkillPoints() or trainSkill() to add level ups but I would like to know how many experience points are needed to get to the next level up.

Re: current max exp

Posted: Sat Mar 26, 2016 5:30 pm
by AndakRainor
This function returns xp needed to level up for the current level:

Code: Select all

levels = {1,2,3,4,5,6,7,8,9,10,20,25,50,50,50,50,100,100,500,1000}
function xpUp(level) return level>0 and levels[math.min(#levels,level)]*1000 or 0 end