Announcement
Announcement
| 2nd Quarter Contest Announcement posted! See the Community Announcements section. |
![]() ![]() |
Mar 30 2012, 07:56 PM
Post
#1
|
|
![]() ![]() Type: Undisclosed Alignment: Chaotic Good |
I was looking for some help with understanding, and perhaps changing some of the script related to gaining XP.
I have realized that between levels the XP needed to gain the next level increases too much for my game. It all takes place in the same town for this set of characters, so they will be fighting a lot of creatures with the same amount of XP given... There is only minimal stat growth between levels in this game, so it only makes sense that XP shouldn't grow so fast. Even at the slowest settings the game provides, the growth in xp takes way too long. I am wondering at this point what my options are to DRASTICALLY reduce the amounf of XP growth between levels. I've copied a section of the Calculations to hopefully provide a visual for people. Please help, because I have been seeking an answer for quite awhile and, obviously, don't want to edit any scripts without knowing what I'm doing. CODE #--------------------------------------------------------------------------
# * Calculate Experience #-------------------------------------------------------------------------- def make_exp_list @exp_list[1] = @exp_list[100] = 0 m = actor.exp_basis n = 0.75 + actor.exp_inflation / 200.0; for i in 2..99 @exp_list[i] = @exp_list[i-1] + Integer(m) m *= 1 + n; n *= 0.9; end end -------------------- "Rule #13: Think faster, shoot slower."
How few there are who have courage enough to own their faults, or resolution enough to mend them. -Benjamin Franklin I support: Spoiler: |
|
|
|
Mar 31 2012, 06:10 PM
Post
#2
|
|
![]() Meowthos the zombie cat!! ![]() Type: Coder Alignment: Lawful Good |
you've found the right section of code to edit. This is the code that calculates how much xp is required to get to a given level. The array @exp_list is where the results are stored (so if you want to know how much exp is required to reach level 43, you would look at @exp_list[43] for the value).
actor.exp_basis and actor.exp_inflation are the values you can set in the database. The rest is just maths that works out the value in each cell of your exp_list (if you look you can see it works out each value in order, changing the values of m and n in between and referring to the previous value) Now, you could edit the script you found that in directly to change the values until you're satisfied, but it is much better to override the method. To do this, create a new script in the materials section. Fill it with this code: CODE class Game_Actor #-------------------------------------------------------------------------- # * Calculate Experience #-------------------------------------------------------------------------- def make_exp_list @exp_list[1] = @exp_list[100] = 0 m = actor.exp_basis n = 0.75 + actor.exp_inflation / 200.0; for i in 2..99 @exp_list[i] = @exp_list[i-1] + Integer(m) m *= 1 + n; n *= 0.9; end end end As it is lower down in your script list it will take precedence. This will allow you to fiddle with the values to your heart's content while leaving the original intact. All you have to do is make sure that by the end of your method you have filled the array @exp_list with the values required to reach each level. (oh, and this will make the graphs in the database be completely irrelevant too Hope this helps This post has been edited by mithos: Mar 31 2012, 06:12 PM -------------------- I've been away for a while. Here's my really quite old stuff
Spoiler: |
|
|
|
Apr 1 2012, 05:53 AM
Post
#3
|
|
![]() ![]() Type: Undisclosed Alignment: Chaotic Good |
it does! thank you very much! I ended up copying the code into a file for safety and editing it earlier today... I found a setting that worked for my game! Only now I know how to do it better if I have to change anything in the future! Thanks mithos!
-------------------- "Rule #13: Think faster, shoot slower."
How few there are who have courage enough to own their faults, or resolution enough to mend them. -Benjamin Franklin I support: Spoiler: |
|
|
|
Apr 2 2012, 03:06 AM
Post
#4
|
|
![]() Master of the DarkSyde of Cheese! ![]() Type: Undisclosed Alignment: Lawful Evil |
is this fixed, ready to be closed?
-------------------- |
|
|
|
Apr 3 2012, 11:18 PM
Post
#5
|
|
![]() ![]() Type: Undisclosed Alignment: Chaotic Good |
-------------------- "Rule #13: Think faster, shoot slower."
How few there are who have courage enough to own their faults, or resolution enough to mend them. -Benjamin Franklin I support: Spoiler: |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 19th May 2013 - 07:29 PM |
|
|