iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
 
Reply to this topicStart new topic
> XP script questions..., I need some changes....
kingmakerspider
post Mar 30 2012, 07:56 PM
Post #1



Group Icon


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:


Go to the top of the page
 
+Quote Post
   
mithos
post Mar 31 2012, 06:10 PM
Post #2


Meowthos the zombie cat!!
Group Icon


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 tongue.gif )

Hope this helps smile.gif

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:


If it's in one of my threads you can use it so long as you read this, and give me a link to any derivatives (i.e. works based off mine). Credit Mithos.
Full legal bit
(Click image for human-readable version :P )
My Stuff:
My Games:
Spoiler:

Story <60%> Mapping<20%> Art<80%> Scripts<97%> Database<50%>
The Legend of Zelda: Restoration of Time Story<20%> Mapping<0%> Art<2%> Scripts<70%> Database<0%>
Absolute Power Story<21%> Mapping<0%> Art<2%> Scripts<0%> Database<0%>

My Sprites:
My Scripts:
I support:
Spoiler:





Go to the top of the page
 
+Quote Post
   
kingmakerspider
post Apr 1 2012, 05:53 AM
Post #3



Group Icon


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:


Go to the top of the page
 
+Quote Post
   
Neosky
post Apr 2 2012, 03:06 AM
Post #4


Master of the DarkSyde of Cheese!
Group Icon


Type: Undisclosed
Alignment: Lawful Evil




is this fixed, ready to be closed?


--------------------


Remember, Remember the 5th of November...
Spoiler:



If you are new, please go through this spoiler for VERY useful links.
Spoiler:





Tarris Thread || User Forum || Tarris Hold Website || Twitch.tv
Go to the top of the page
 
+Quote Post
   
kingmakerspider
post Apr 3 2012, 11:18 PM
Post #5



Group Icon


Type: Undisclosed
Alignment: Chaotic Good




QUOTE (neosky @ Apr 1 2012, 08:06 PM) *
is this fixed, ready to be closed?

I believe so, thank you.


--------------------
"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:


Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 28th July 2014 - 09:39 PM

RPGMakerVX.net is an Privacy Policy, Legal.