The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: shintashi on November 09, 2010, 03:19:49 AM

Title: [RESOLVED] calculating exp without an equation?
Post by: shintashi on November 09, 2010, 03:19:49 AM
Say I wanted arbitrary experience lists, like prime numbers...

you know, like

3
5
7
11
13
17

etc.

Is there a way to make my own custom chart? Like either with a series of if...return statements or an array like [3,5,7,13,17...] ?

I can do equation based experience fine, but when I try to do if then statements,
this little monster causes an error.

    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
Title: Re: calculating exp without an equation?
Post by: cozziekuns on November 09, 2010, 04:08:59 AM
Here ya go. (http://rmrk.net/index.php/topic,39209.0.html)
Title: Re: calculating exp without an equation?
Post by: shintashi on November 19, 2010, 02:50:35 AM
got a modified version of it to work ^^

will probably have to come back to it to make multiple charts for different classes, since I couldn't get the base code to work (probably have to insert it into main)
Title: Re: calculating exp without an equation?
Post by: shintashi on November 21, 2010, 07:00:40 PM
Here's a working version of three different classes. To make more classes, just add another when #... and "@exp_list = {" before the "else"

    def make_exp_list
    actor = $data_actors[@actor_id]
    case actor.class_id
    when 1 #first class
    @exp_list = {
      1 => 0,
      2 => 2200,
      3 => 4400,
      4 => 8800,
      5 => 16500,
      6 => 30000,
      7 => 55000,
      8 => 100000,
      9 => 200000,
      10 => 400000,
      11 => 600000,
      12 => 800000,
      13 => 1000000,
      14 => 1200000,
      15 => 1500000,
      16 => 1800000,
      17 => 2100000,
      18 => 2400000,
      19 => 2700000,
      20 => 3000000
      }
    when 2 #second class
    @exp_list = {
      1 => 0,
      2 => 3000,
      3 => 5500,
      4 => 10000,
      5 => 22000,
      6 => 44000,
      7 => 88000,
      8 => 150000,
      9 => 250000,
      10 => 500000,
      11 => 750000,
      12 => 1000000,
      13 => 1250000,
      14 => 1500000,
      15 => 1750000,
      16 => 2000000,
      17 => 2250000,
      18 => 2500000,
      19 => 2750000,
      20 => 3000000
      }
    else #base class
          @exp_list = {
      1 => 0,
      2 => 2000,
      3 => 4000,
      4 => 8000,
      5 => 16000,
      6 => 32000,
      7 => 64000,
      8 => 125000,
      9 => 250000,
      10 => 500000,
      11 => 750000,
      12 => 1000000,
      13 => 1250000,
      14 => 1500000,
      15 => 1750000,
      16 => 2000000,
      17 => 2250000,
      18 => 2500000,
      19 => 2750000,
      20 => 3000000
      }
      end #end case
  end # end exp list
Title: Re: [RESOLVED] calculating exp without an equation?
Post by: shintashi on November 21, 2010, 07:16:23 PM
to use, insert the code listed in my previous post in your "Calculate EXP" section of Game Actor, and comment out or delete the previous def make_exp_list. I recommend commenting it out first in case of a glitch.