RPGAIO Forums
Random number nodes - Printable Version

+- RPGAIO Forums (http://rpgaio.logicspawn.co.uk/forums)
+-- Forum: Discussion and Showcase (http://rpgaio.logicspawn.co.uk/forums/forumdisplay.php?fid=4)
+--- Forum: Tips and Tricks (http://rpgaio.logicspawn.co.uk/forums/forumdisplay.php?fid=11)
+--- Thread: Random number nodes (/showthread.php?tid=728)



Random number nodes - maniak - 10-10-2018

Here are a couple more nodes that produce a Random Int or Random Float and add the value to another node.


Important: You need to change the file extensions to ".cs" (I had to upload them with the extension ".txt" because ".cs" files are not accepted)

Caution
These nodes should not have any side-effects but just in case you should backup your GameData file before using them
If something does go wrong, delete the new node files from your project and restore your GameData backup.

Random Float
Outputs a random Float value between the min and max, and adds it to the target node value
[attachment=175]

Random Int
Same as above except it produces an Integer instead of a float.
[attachment=174]



How To Install
You can install these nodes by placing the class files in your project.
In my case I created a new folder called 'Custom' in this location: Assets/RPGAIO/Scripts/RPGMaker/Nodes/Custom
You can put them somewhere else if you like ... but I didn't test it.

*Don't forget to change the extension*
[attachment=176]



RE: Random number nodes - florent1789 - 10-11-2018

very usefull, thanks a lot


RE: Random number nodes - Wrofir - 10-12-2018

This is as opposed to the current true false random node?


RE: Random number nodes - maniak - 10-12-2018

(10-12-2018, 08:50 AM)Wrofir Wrote: This is as opposed to the current true false random node?

Yes, these two nodes both output a value in the range Min-Max and add it to the Target node variable.

The default random node does not output the actual random value but instead follows a True or False path based on the comparison result.