Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Is it possible to change EXP gaining into a formula?

Ok, I have no idea if this goes here or in Script Request or in any of the forums, so don't get up me.

Now, I was just wondering if it was possible to change the way of gaining EXP by giving it a formula/method to work with instead of giving it a straight forward number.

For example, apparently in Pokemon, they have a formula for gaining EXP depending on various things.

Method: ((a*b)*L) / 7
a = 1 (+0.5 if Pokemon is traded or enemy is trainer)
b = The Base Experience the Pokemon has
L = The level of the Pokemon

So, if I was a newb who started his first battle versing a Lv.5 Bulbasaur with a Squirtle and I won, the result would be:

((1.5*64)*5)/7
(1.5*64) = 96
(96*5) = 480
480/7 = 68.5
68.5 = 68 (Always Rounds Down)

(a) is 1.5 because the opponent is a trainer
(b) is 64 because a Bulbasaur's Base EXP is 64
(L) is 5 obviously because it's level is 5

Is it possible to have something like this?
I'm also using Yanfly's Enemy Level Control script as well. Please do not get up me if it is really easy.

Hope someone can help me.
 
If you are asking for help making the script yourself, it goes here.
If you are asking for someone to do it for you, it goes in Script Requests.

a, b, L are all properties of the enemy, yes? (I've never poke'd a mon)

How do you intend to indicate if the enemy has been traded or is a trainer?
(Element, Text in name, other...)

From whence did you acquire Yanfly's script? a link would be cool.
It will be needed to get the enemies level.

Be Well
 
The simplest way I found to implement a custom xp table (generated by a formula or anything else), is to overwride the Game_Player.make_exp_list method, and filling the @exp_list property by whateve xp amountr you want, providing you don't go over the 9,999,999 limit.
 
Oooop !!!!

1/ It is the Game_Actor.make_exp_list; not the Game_Player

2/ If this is the xp allowance that needs to be dynamiclly computed, better look at and overwrite the the Game_Troop.exp_total method, gaining infos from the enemy variable in te loop
 
The Game_Troop.exp_total is the method that returns the xp gained in a battle. In the standard version of RGSS, it simply loops into the defeated enemies and adds the xp of each one.
I f you want something more 'computerized', you have to rewrite this, adding your own formula. The problem is that the informations you need must be available. And in the standard RGSS, there is no equivalence of 'monster lvl', 'tainer', and 'monster tradinf'. You have to implement them yourself before using them.

Hope this helps
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top