NeMV - Utilities Not rated

Nekoyoubi

This is a set of JavaScript helper methods for various aspects of RMMV. Some items will only be available with the proper plugins installed, but no extra plugins are required in order to use it.


Tags nemv javascript utilities

Introduction

This is a set of JavaScript helper methods for various aspects of RMMV. Some items will only be available with the proper plugins installed, but no extra plugins are required in order to use it.

Usage

Various utility methods are presented here to assist you in your development of notetag evals, event script commands, or even plugins. Here they are, and a couple of examples of their use. Please note that the method prefixes ("NeMV" and "nemv") are interchangeable for your typing convenience.

! IMPORTANT !

Not everything in this plugin is documented. Some methods have yet to get write-ups, so don't be afraid to dig in and see what everything does. I will be updating this and its documentation as often as I am able, but this will more than likely grow in function faster than I can write entries for it. As such it will probably remain in an alpha-state (doesn't mean "scary", just not "feature-complete") for quite some time.

Array.random(skipOne?) [returns a random value from the array]

This helper is actually added to the JavaScript [Array] object itself. It allows you to easily pick a value out of a set without having to worry about the [Math]. The optional skipOne parameter is a convenience for you to easily skip the zeroth index (useful for looking at $data[Type] arrays) from RMMV's database.

$dataSkills.random(true) // returns a random skill
["Hey!","Hello!","Hi!"].random() // returns a random greeting

NeMV.chance(ratio|percent) [returns true|false]

Simply an easy access to random chance. Calling the method with a string (text) will attempt to turn it into a ratio check (e.g. "1:15", "2/30", "3 out of 45", and "4 in 60" will all return the same), and will compare the result of that ratio against a random number, returning success or failure.

nemv.chance(20) // returns true 20% of the time
nemv.chance("37 out of 42") // returns true ~88% of the time

Support

Should this plugin not work for you for any reason, please notify me by creating a GitHub issue, emailing me at [email protected], or message me in any social convention you happen to see me in.

Thanks, and happy scripting!

Available versions
This version doesn't have plugin dependencies.

User reviews (0)


This plugin doesn't have any review.