じ☆ve冰风 发表于 2026-7-23 09:04:18

[TF] Random Number Generator

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
 
 

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
).

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


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.


本贴来自国际rpgmaker官方论坛作者:Tagflag处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/tf-random-number-generator.51878/
页: [1]
查看完整版本: [TF] Random Number Generator