RPG Maker Forums

Hi, thanks for looking at my thread. The editor only allows ranges (f.e. 1 to 10), and not specific numbers (f.e. 2, 7, and 9), which is very limiting. So, in short, I'd like to have a script that can generate a random number from an array.

More specifically, what I need is a script that allows me to put a plugin command something like this: random(4, 7, 99, 102). This should generate either number 4, number 7, or number 99, and stores the drawn number in variable 102 (so the last number is the variable it should be stored at). I hope this is clear, I'm not sure how to explain it better. Just to be clear, I really need it to be a plugin command I can call from the editor, not pre-defined arrays from the script.

I will personally only need to generate a random number from arrays of exactly 10 numbers. However, if you'd like to post this script for others as well, it may be better to leave the length of the array up to the user (this is probably more difficult to code?). The last number should always be the variable number the random number will be stored at.

Thanks in advance if you can help me! Of course, you will be credited in my game (I plan to upload it here on the forums once it's done).

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top