So here's the basic code I found in game actor:
# * Calculate EXP
#--------------------------------------------------------------------------
def make_exp_list
actor = $data_actors[@actor_id]
@exp_list[1] = 0
pow_i = 2.4 + actor.exp_inflation / 100.0
for i in 2..100
if i > actor.final_level
@exp_list[i] = 0
else
n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
@exp_list[i] = @exp_list[i-1] + Integer(n)
end
end
end
I want to modify it so the experience requirement is based on (level)*(level+2)*(10 + inflation)
with inflation being an integer from say, 0-30.
Can it be done?
The first equation: (level)*(level+2) produces integers 1-9999, when level range is 1-99 by the way.
Umm, try:
def make_exp_list
actor = $data_actors[@actor_id]
@exp_list[1] = 0
for i in 2..100
if i > actor.final_level
@exp_list[i] = 0
else
@exp_list[i] = (i*(i + 2))*(actor.exp_inflation)
end
end
end
And you would set exp inflation where you normally set it in the database. Umm, note that I excluded the 10 + since you can set inflation from 0-50 in the database, so you could just make the range 10-40 if you only wanted it to be within that range.
If you really want the 10 + for whatever reason, then just change this line:
@exp_list[i] = (i*(i + 2))*(actor.exp_inflation)
to:
@exp_list[i] = (i*(i + 2))*(10 + actor.exp_inflation)
@exp_list[i] = (i*(i + 2))*(actor.exp_inflation / 10)
I just realized needed to set the numbers to base. it appears the default "inflation" is 10, so I divided by 10.
so level 2 = (2*(2+2=4)) = 8.
What do you have the inflation set at? 10?
It should be 8 * inflation, since level*(level+2) = 2*(2+2) = 8
Unless you meant that it should be previous level * (previous level + 2); I assumed you meant the goal level and wrote the code with that in mind.
If you want it to be previous level, then change:
@exp_list[i] = (i*(i + 2))*(actor.exp_inflation)
to:
@exp_list[i] = ((i -1)*(i + 1))*(actor.exp_inflation)
i don't know how to manually over ride the database. The basis and inflation defaults are both 10.
If I could edit some stuff in the database, programming this thing would be 100 times faster.
Just click the exp curve bar on the actor page in the database, and move the slide bars at the bottom of the window that comes up.
The modified formula won't show up in the database though - but it will still work in-game
that works for basis, but in my version of the program, the inflation cannot be set below 10 - even if I manually type in 0 or 1, it resets to 10. That's why I divided by 10 in the script. Am I missing something or do I have to know Ruby to change the data base?
Oh, no you're right about Inflation. And you can't use Ruby to change the database. But why divide by 10? Shouldn't you just subtract it if you want the minimum to be 0?
Quote from: modern algebra on April 22, 2010, 08:13:32 PM
Oh, no you're right about Inflation. And you can't use Ruby to change the database. But why divide by 10? Shouldn't you just subtract it if you want the minimum to be 0?
I tried subtracting 9 but it crashed.
You would think a base multiplier of (10-9) would be the same as x1, but apparently not. :-\
Well, you might not have had the right syntax. Was it:
@exp_list[i] = (i*(i + 2))*(actor.exp_inflation - 9)?
Quote from: modern algebra on April 22, 2010, 08:40:20 PM
Well, you might not have had the right syntax. Was it:
@exp_list[i] = (i*(i + 2))*(actor.exp_inflation - 9)?
yes, that's what i put, then the thing went haywire for a while.
Well, works fine when I tested it.
yes, it does work now. I think I misplaced a space or something.