i just noticed that in "Random event" No Repeat is used, i will edit this script and set it to No Repeat also for better clarity.
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
/*--- __ECO__ __ACTION__ ---*/
// http://hutonggames.com/playmakerforum/index.php?topic=8665.msg41731#msg41731
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Math)]
[Tooltip("Pick a random weighted Int picked from an array of Ints.")]
public class RandomWeightedInt : FsmStateAction
{
[CompoundArray("Ints", "Int", "Weight")]
public FsmInt[] ints;
[HasFloatSlider(0, 1)]
public FsmFloat[] weights;
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmInt result;
[Tooltip("Don't repeat the same Int twice in a row.")]
public FsmBool noRepeat;
private int randomIndex;
private int lastIndex = -1;
public override void Reset()
{
ints = new FsmInt[3];
ints[0] = 1;
ints[1] = 2;
ints[2] = 3;
weights = new FsmFloat[] {1,1,1};
result = null;
noRepeat = false;
}
public override void OnEnter()
{
PickRandom();
Finish ();
}
void PickRandom()
{
if (ints.Length == 0)
{
return;
}
if (noRepeat.Value)
{
do
{
randomIndex = ActionHelpers.GetRandomWeightedIndex(weights);
} while ( randomIndex == lastIndex);
lastIndex = randomIndex;
result.Value = ints[randomIndex].Value;
}else
{
randomIndex = ActionHelpers.GetRandomWeightedIndex(weights);
result.Value = ints[randomIndex].Value;
}
}
}
}
when i have some extra time i will make a bundle from the other randoms and implement No Repeat to them.