Ohh, sorry, forgot to reply yesterday.
In case you really wrote
level^3 as a formula, that is NOT how you do what you want in Ruby.
That should be
level**3 instead.
You can always put this right at the beginning of the method:
This will make sure that it returns 0 for every formula on level 1.
And in case you need a simple debug print of the EXP values for your levels, you can use this little script:
Spoiler
Code:
module Graph
def self.show(min,max,aid)
(min..max).each do |lvl|
text_data($game_actors[aid],lvl)
end
end
def self.text_data(actor,lvl)
tx1 = actor.exp_for_level(lvl+1) - actor.exp_for_level(lvl)
tx2 = actor.exp_for_level(lvl)
v1 = sprintf("%*s", 8, tx1.to_s)
v2 = sprintf("%*s", 8, tx2.to_s)
t1 = sprintf("%*s", 3, lvl.to_s)
t2 = sprintf("%*s", 3, (lvl+1).to_s)
puts "Total XP to LVL #{t1}: #{v2},\tFrom LVL #{t1} to LVL #{t2}: #{v1}"
end
end
Put this snippet anywhere you want on the script list.
Use it in the game with this script call:
Code:
Graph.show(low,high,actor_id)
Replace
low with the lowest level you want to see.
Replace
high with the highest level you want to see.
Replace
actor_id with the ID of the actor you want to see.
You need to enable the console to see the debug prints, so if you haven't yet, make sure to enable it in the editor.
The script call will print the total EXP needed to achieve the levels and the EXP between 2 levels as well.