Tagflag

Villager
Member
Joined
Nov 29, 2015
Messages
16
Reaction score
6
First Language
German
TF_RandomNumberGenerator v1.0.0
by Tagflag

 

About this plugin
This plugin creates a random number and stores it into a in-game variable.
You can also call the wait command to use variables (like a random one).
 
So you can combine both functions to let birds sing at random intervals.
 
You get a random number based on min-max values, remember min and max values are included that means that a random value between 5 and 10 can be:
5, 6, 7, 8, 9 or 10.

How to Use
Use as plugin commands in events:

TF_RandomNumber x y zx = min, y = max, z = variable id to store the random number example: TF_RandomNumber 5 10 2
this stores a random number between 5 and 10 (example: 7) in variable id 2 you then can access the variable with the escape sequence: \V[2]
 
 

TF_Wait variable_idJust replace variable_id with variable number, example: TF_Wait 2
ececutes the wait command for variables's value in frames.

Demo
Here is a example project, best you open it in RPG Maker and look at it (after you played it first if course :p ).

It's very short < 1 minute. File size: ~ 20MB

http://www.mediafire.com/download/xeci2qaiorqgetg/RandomNumberExample.rar

Script
You can download the plugin here:

http://www.mediafire.com/view/0jadyb3a3cp9v3t/TF_RandomNumberGenerator.js

Legal stuff

You can use this plugin in commercial and non-commercial projects.

You are free to duplicate, distribute and modify this plugin however you want.

To give credits to me is optional.

In case of ditribution: don't claim to be the creator of this script. f you modified it, leave my name in the plugin ("@ author:" you can change of course).

If you use it in a game, then it would be nice if you tell me about it. I would love to try it :D

FAQ
Q: Will "TF_RandomNumber" also work with only 2 argument, like "TF_RandomNumber x y"?
A: No, it has to be 3, otherwise it will get ignored. If you have more arguments (like 4), then it will work but only use the first 3.

Q: Why no screenshots?
A: There is nothing much to show.

Q: Will you add more to this plugin?
A: Yes, there are still a few things I want to add/change.

Q: Are the commands like "TF_RandomNumber" case-sensitive?

A: No, you can even write "tF_RaNdOm_NuMbEr" if you have the time  :)

Q: Why do you add TF infront your plugin name?
A: So I can find it in my plugins list, you can change this plugins file name without breaking it.

Extra Notes
If you have questions/problems, find erros/typos or have praise/complaints then let me know! I answer everything I can.
 

Rito

Veteran
Veteran
Joined
Jun 29, 2015
Messages
107
Reaction score
50
First Language
French
I have a question :

Why its so that we can do so without plugin ? ^^ "

 

1448897324-sans-titre.jpg
 
Last edited by a moderator:

Tagflag

Villager
Member
Joined
Nov 29, 2015
Messages
16
Reaction score
6
First Language
German
Thank you Rito! I just learned something new.

To tell the truth: I totally missed that one! :o

I was looking for that random option for so long, but it appears I just skipped over it. Now that I had a hint, I actually found it. Well, at least it was a good exercise.

But the plugin allows also to use "wait" with variables, so it's not useless just yet. :p

Maybe I should rename it?
 

Rito

Veteran
Veteran
Joined
Jun 29, 2015
Messages
107
Reaction score
50
First Language
French
Yes I think it would be better ^^

I started using rpg maker since its XP version (2003 if I remember correctly) and it already existed.
 

Janusz

Veteran
Veteran
Joined
Jul 4, 2015
Messages
26
Reaction score
4
Primarily Uses
You can always improve your script with arrays example: five different random values from 1 to 5 -> array = [1, 5, 3, 4, 2]

and/or adding sorting system for those numbers for example:  array = [23, 34, 17, 28] then sorted_array_by_value = [17, 23, 28, 34] or by array position: pos_arrays_by_lowest_value = [2, 0, 3, 1].

This could be used for tournament draws or other similiar things with one or two code lines instead multiple script calls.

Sorry for bad english.

Editi: Typo error from [2, 0, 4, 1] to [2, 0, 3, 1]
 
Last edited by a moderator:

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
456
Reaction score
241
First Language
English
Primarily Uses
RMMZ
You could try to come up with a 'Seed' system, like in The Binding of Isaac, where the player can access & input seeds that determine how things are randomly generated. It's rather difficult to implement this by default because games like rogue-likes tend to heavily use randomly generated variables & inputting a single seed from the 'Input Number' event command & using it to pre-set multiple variables would be a difficult task (especially since the Input Number option only lets the player enter numbers & not letters or symbols).
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

Work starts today at 2pm. I hate jeans, but the dress code says I have to wear them... That's how I discovered I was a plus size. Shopping for my first pair of jeans.
Anyhow, I'll post a new video on TheDazzlingsAreBack as soon as I'm able to.
dEj6ha4.png

WIP :)
Added some cliffs / walls / roofs to the tilesheet and am currently working on roof objects to make them prettier and more variable. And of course, windows and doors that fit to the game's style.
I also adjusted the grass color but i have some issues with my display, so if it looks weird, please let me know :)
Updated the dev logs for the game I'm working on! Check it out here
Alright, I left the modern girl in fantasy brain's hands while I get my - MODERN GIRL WHAT HAPPENED?! I blame fantasy brain for this.

WinaElemental.png
I just realized that, while I was waiting for our little Easter Game to be approved in the Completed Games Thread, the game was already listed for more than a week, without me noticing x.x

So ... very delayed happy easter to everyone I guess? : D

Forum statistics

Threads
110,565
Messages
1,054,282
Members
143,681
Latest member
LittenDev
Top