# (39) 's Extra Blueprint Nodes for You as a Plugin, No C++ Required!

**URL:** <https://forums.unrealengine.com/t/39-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/3448>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [April 29, 2014, 1:27am UTC](https://forums.unrealengine.com/t/39-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/3448 "2014-04-29T01:27:59Z")\
**Posts on this page:** 1\
**Showing post:** 781

<div class="post-metadata">

**Author:** ![SaxonRah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SaxonRah](https://forums.unrealengine.com/u/SaxonRah)\
**Post date:** [April 10, 2015, 8:06am UTC](https://forums.unrealengine.com/t/39-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/3448/781 "2015-04-10T08:06:47Z")

</div>

> [@;195924](#):
>
> Dear Community,
> 
> **Community member SaxonRah has gifted us with a whole new set of Randomization nodes!**
> 
> Check out these pics!
> 
> ![Random.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/8/0858fa93ffa13156b338cb432bb29734eff85459.png)&stc=1
> 
> ![Randon3.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/d/6d8e8be73a4a6fd8dbcf767f7dcaf1af963f2e45.png)&stc=1
> 
> ```auto
> 
> **Latest Version of My Plugin Has The Additions**
> 
> https://wiki.unrealengine.com/File:VictoryPlugin.zip
> 
> ```
> 
> **C++ Code**
> 
> Here is the C++ code for SaxonRah’s additions to my Victory BP Library
> 
> .h
> 
> ```auto
> 
> /** Seed Rand with value passed
> * @param seed - value to pass to the prng as the seed
> */
> UFUNCTION(BlueprintCallable, Category = "VictoryBPLibrary|Random")
> static void seedRand(int32 seed);
> 
> /** Seed Rand with current
> */
> UFUNCTION(BlueprintCallable, Category = "VictoryBPLibrary|Random")
> static void seedRandWithTime();
> 
> /** Seed Rand with entropy
> * @param seed - value to pass to the prng as the seed
> */
> UFUNCTION(BlueprintCallable, Category = "VictoryBPLibrary|Random")
> static void seedRandWithEntropy();
> 
> /** Random Bool - Bernoulli distribution
> * @param fBias - Bias of Bernoulli distribution
> * @return uniformly distributed bool based on bias parameter
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static bool RandBool_Bernoulli(float fBias);
> 
> /** Random Integer - Zero to One Uniform distribution
> * @return int32 - uniform distribution from 0 to 1
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static int32 RandInt_uniDis();
> 
> /** Random Integer - MIN to Uniform distribution
> * @param iMin - Minimum value of uniform distribution
> * @param iMax - Maximum value of uniform distribution
> * @return int32 - uniform distribution from iMin to iMax parameters
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static int32 RandInt_MINMAX_uniDis(int32 iMin, int32 iMax);
> 
> /** Random Double - Zero to One Uniform distribution
> * @return double - uniform distribution from 0 to 1
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static float RandFloat_uniDis();
> 
> /** Random Double - Uniform distribution based on MIN to parameters
> * @param fMin - Minimum value of uniform distribution
> * @param fMax - Maximum value of uniform distribution
> * @return double - uniform distribution from fMin to fMax parameters
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static float RandFloat_MINMAX_uniDis(float fMin, float fMax);
> 
> /** Random Bool - Bernoulli distribution - Mersenne Twister
> * @param fBias - Bias of Bernoulli distribution
> * @return uniformly distributed bool based on bias parameter
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static bool RandBool_Bernoulli_MT(float fBias);
> 
> /** Random Integer - Zero to One Uniform distribution - Mersenne Twister
> * @return int32 - uniform distribution from 0 to 1
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static int32 RandInt_uniDis_MT();
> 
> /** Random Integer - MIN to Uniform distribution - Mersenne Twister
> * @param iMin - Minimum value of uniform distribution
> * @param iMax - Maximum value of uniform distribution
> * @return int32 - uniform distribution from iMin to iMax parameters
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static int32 RandInt_MINMAX_uniDis_MT(int32 iMin, int32 iMax);
> 
> /** Random Float - Zero to One Uniform distribution - Mersenne Twister
> * @return float - uniform distribution from 0 to 1
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static float RandFloat_uniDis_MT();
> 
> /** Random Float - Uniform distribution based on MIN to parameters - Mersenne Twister
> * @param fMin - Minimum value of uniform distribution
> * @param fMax - Maximum value of uniform distribution
> * @return float - uniform distribution from fMin to fMax parameters
> */
> UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
> static float RandFloat_MINMAX_uniDis_MT(float fMin, float fMax);
> 
> ```
> 
> .cpp
> 
> ```auto
> 
> /**
> * Contributed by: SaxonRah
> * Better random numbers. Seeded with a random device. if the random device's entropy is 0; defaults to current for seed.
> * can override with seed functions;
> */
> //----------------------------------------------------------------------------------------------BeginRANDOM
> std::random_device rd;        
> unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
> 
> std::mt19937 rand_MT;
> std::default_random_engine rand_DRE;
> 
> /** Construct a random device and set seed for engines dependent on entropy */
> void UVictoryBPFunctionLibrary::constructRand()
> {
> seed = std::chrono::system_clock::now().time_since_epoch().count();
> 
> if (rd.entropy() == 0)
> {
> seedRand(seed);
> }else{
> seedRand(rd());
> }
> }
> /** Set seed for Rand */
> void UVictoryBPFunctionLibrary::seedRand(int32 _seed)
> {
> seed = _seed;
> }
> 
> /** Set seed with for Rand */
> void UVictoryBPFunctionLibrary::seedRandWithTime()
> {
> seed = std::chrono::system_clock::now().time_since_epoch().count();
> }
> 
> /** Set seed with entropy for Rand */
> void UVictoryBPFunctionLibrary::seedRandWithEntropy()
> {
> seedRand(rd());
> }
> 
> /** Random Bool - Bernoulli distribution */
> bool UVictoryBPFunctionLibrary::RandBool_Bernoulli(float fBias)
> {
> std::bernoulli_distribution dis(fBias);
> return dis(rand_DRE);
> }
> 
> /** Random Integer - Uniform distribution */
> int32 UVictoryBPFunctionLibrary::RandInt_uniDis()
> {
> std::uniform_int_distribution<int32> dis(0, 1);
> return dis(rand_DRE);
> }
> /** Random Integer - Uniform distribution */
> int32 UVictoryBPFunctionLibrary::RandInt_MINMAX_uniDis(int32 iMin, int32 iMax)
> {
> std::uniform_int_distribution<int32> dis(iMin, iMax);
> return dis(rand_DRE);
> }
> 
> /** Random Float - Zero to One Uniform distribution */
> float UVictoryBPFunctionLibrary::RandFloat_uniDis()
> {
> std::uniform_real_distribution<float> dis(0, 1);
> return dis(rand_DRE);
> }
> /** Random Float - MIN to Uniform distribution */
> float UVictoryBPFunctionLibrary::RandFloat_MINMAX_uniDis(float fMin, float fMax)
> {
> std::uniform_real_distribution<float> dis(fMin, fMax);
> return dis(rand_DRE);
> }
> 
> /** Random Bool - Bernoulli distribution - Mersenne Twister */
> bool UVictoryBPFunctionLibrary::RandBool_Bernoulli_MT(float fBias)
> {
> std::bernoulli_distribution dis(fBias);
> return dis(rand_MT);
> }
> 
> /** Random Integer - Uniform distribution - Mersenne Twister */
> int32 UVictoryBPFunctionLibrary::RandInt_uniDis_MT()
> {
> std::uniform_int_distribution<int32> dis(0, 1);
> return dis(rand_MT);
> }
> /** Random Integer - Uniform distribution - Mersenne Twister */
> int32 UVictoryBPFunctionLibrary::RandInt_MINMAX_uniDis_MT(int32 iMin, int32 iMax)
> {
> std::uniform_int_distribution<int32> dis(iMin, iMax);
> return dis(rand_MT);
> }
> 
> /** Random Float - Zero to One Uniform distribution - Mersenne Twister */
> float UVictoryBPFunctionLibrary::RandFloat_uniDis_MT()
> {
> std::uniform_real_distribution<float> dis(0, 1);
> return dis(rand_MT);
> }
> /** Random Float - MIN to Uniform distribution - Mersenne Twister */
> float UVictoryBPFunctionLibrary::RandFloat_MINMAX_uniDis_MT(float fMin, float fMax)
> {
> std::uniform_real_distribution<float> dis(fMin, fMax);
> return dis(rand_MT);
> }
> 
> ```

I know it’s not a riveting change but i notice i failed to use proper var names for the float variables. It should be better now.

---

_[View the full topic](https://forums.unrealengine.com/t/39-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/3448)._
