Hi, in my project i use simple system on variable.
I can configure it and change for how i want.
In first, create player in "StoryInit":
/*---Players Stats start---*/
<<set $player to {
name: "",
level: 1,
strength: 1,
perception: 1,
endurance: 1,
charisma: 1,
intelligence: 1,
agility: 1,
skillpoints: 7,
}>>
/*---Players Stats end---*/
Then, create XP and level formulas:
/*---Players Level start---*/
<<set $pcNextLvl to ($player.level+1)>>
<<set $pcExpMod to ($player.intelligence*0.03)>> /*modificator for xp scaling*/
<<set $XPBase to 5>> /*for this variable can change MaxEXP */
<<set $XPBumpBase to ($XPBase*1.5)>> /*for this variable can change MaxEXP */
<<set $CurEXP to 0>> /* Current EXP for the game start */
/*---Players Level end---*/
And then, you can put this code in PassageHeader (for calculeting you MaxEXP in eve passage:
<<set $MaxEXP to Math.trunc((($XPBase*$pcNextLvl)+$XPBumpBase)*(1-$pcExpMod))>> /* Maximum EXP */
Then, you just use LVL-UP system you want (scaling stats, adding new, and other).
For example, after winning battle i use this :
/* after battle win*/
<<set $CurEXP to ($CurEXP + $expDrop)>>
<<set $battleMode to 0>>
<<if $CurEXP >= $MaxEXP>>
<<include LevelUp>>
<</if>>
----
/*in PassageHeader*/
<<if $CurEXP >= $MaxEXP>>
<<include LevelUp>>
<</if>>
And in "LevelUp":
<<set $player.level to ($player.level++)>>
<<set $CurEXP to $CurEXP-$MaxEXP>>
<<set $CurHP to $MaxHP>>
We adding 1 level to current, then we reset player EXP to new, and set health to max (restore it).
You can make other things with this code.
Adding stats like +1 to Strenght, or not restore health.