Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 3 posts ] 
    Jeff the Green
  Fri May 13, 2011 10:52 pm
AKA Jeffrey the Green
User avatar
Member

Jeff's Utilities Version: 1.1
By: Jeff the Green (Bearcat)

Introduction

This is a collection of utilities I wrote for my own use and will be necessary for most scripts I release post 2010. Until they're a part of the MACL, they'll be available as the standalone script here.

Features
The current list of methods is:
  • Array.average: returns the arithmetic mean (average) of all numeric elements of the array.
  • Array.geommean: returns the geometric mean of all positive numeric elements of the array.
  • Array.harmmean: returns the harmonic mean of all positive numeric elements of the array.
  • Array.permute: returns a random permutation of the array.
  • Array.permute!: permutes self.
  • Bitmap.draw_formatted_text_jeff: draws formatted text using many of the same codes as ccoa's UMS.
  • Bitmap.formatted_text_height_jeff: determines the height of formatted text with a certain width.
  • JeffUtilities.normal: generates a random number from a normal distribution.
  • JeffUtilities.pseudorand: generates a pseudorandom number using a seed stored in $game_system.

Screenshots

This is a bunch of scripting utilities, so it's hard to do a screenshot. If someone can think of one they'd like to see, I'll post it.


Script

Expand to see the code.


Instructions

Put below SDK (not required) and the MACL (required), and above any of my scripts.

Method specific (included in comments, but these are more explicit instructions for less-experienced scripters):
Array.average

Array.geommean

Array.harmmean

Array.permute

Array.permute!

Bitmap.draw_formatted_text_jeff

Bitmap.formatted_text_height_jeff

JeffUtilities.normal

JeffUtilities.pseudorand

JeffUtilities.permutation



Compatibility

Unless you have a class named "JeffUtilities," or methods in Bitmap called "draw_formatted_text_jeff" or "formatted_text_height_jeff" (which would, quite frankly, be weird), I foresee no problems.

Credits and Thanks

The Bitmap.draw_formatted_text_jeff method is based on Trickster's draw_formatted_text in the MACL and uses codes inspired by ccoa's UMS.

Author's Notes

I'll be updating this as I come up with new or better methods; anything that requires this script will specify the version number.

Terms and Conditions

Feel free to use these scripts in games however you like, with or without attribution. If you redistribute it without significant modifications, however, please leave the starting comment (the bit between "=begin" and "=end") as is and link back to this page.


Last edited by Jeff the Green on Sun Sep 04, 2011 12:11 pm, edited 2 times in total.

Top Top
Profile      
 

    Amy
  Wed Jun 08, 2011 3:49 pm
User avatar
Staff

Big Dumb Guy
Oh hey, that's great. I've been looking for a way to do better randomisation for a while now.


Top Top
Profile      
 

    Jeff the Green
  Sun Sep 04, 2011 12:10 pm
AKA Jeffrey the Green
User avatar
Member

Updated to v1.1.

New methods:
  • Array.average: returns the arithmetic mean (average) of all numeric elements of the array.
  • Array.geommean: returns the geometric mean of all positive numeric elements of the array.
  • Array.harmmean: returns the harmonic mean of all positive numeric elements of the array.
  • Array.permute: returns a random permutation of the array.
  • Array.permute!: permutes self.
  • Bitmap.formatted_text_height_jeff: determines the height of formatted text with a certain width.

Deprecated methods:
  • JeffUtilities.permutation: Replaced by Array.permute


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group