Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ruby Extensions
#1
Ruby Extensions
by Mystinar
Jan 12 2011

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Below is a bunch of extra functions I've written for the base ruby classes to extend functionality in different ways. Most of these are math related. I don't take credit for all of these. It was a few years ago that I wrote this code, so I don't recall where I got some of it.

One piece of code I'd like to point out is the Integer.sum function, which adds all the numbers from 1..X without iteration. This code is useful for generating a character's experience point table. For example, if you wanted experience points to progress at the same rate as in Dungeons and Dragons, you would use:

actor.level.sum * 1000


To use these scripts, just create a new script in the script editor (preferably placed above Game_Temp) and paste the code below into it:

Extensions.rb
}




Users browsing this thread: