I've noticed a lot common expressions and the like that come somewhat normally to me, being something of a bother to others that I work with regularly. We spend a lot of time in noteboxes and script commands writing evals to do crazy custom things. I've seen how a ton of inspiration can quickly be halted by a lack of knowledge of scripting... also, I hate repeating my own code.
Please keep in mind that documentation will probably be limited for some time, as this plugin will be growing rather rapidly, and I may simply need to get it out before it gets written up. Hang in there. I'll get it all documented one day.
Utilities post on RM Forums (n/a)
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]
[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
Should this plugin not work for you for any reason, please notify me by creating a GitHub issue, emailing me at email@example.com, or message me in any social convention you happen to see me in.
Thanks, and happy scripting!