You want to randomly select a “discrete variable”? I mean select randomly a number from a set of isolated points?
Something like: Selecting a random number from {1,5,8} can return 1, 5 or 8?
If the sets has few numbers, you could do it manually:
[code]Conditions: No conditions
Actions: Do = Random(2) to variable “RandomIndex”
Conditions: Variable "RandomIndex" is = 0
Actions: Do = 1 to variable "SelectedNumber"
Conditions: Variable "RandomIndex" is = 1
Actions: Do = 5 to variable "SelectedNumber"
Conditions: Variable "RandomIndex" is = 2
Actions: Do = 8 to variable "SelectedNumber"[/code]
If there are many numbers, do it manually, number per number, would be tedious. But you can do it with structure variables too, just use a structure like this:
Set
0 = 1
1 = 5
2 = 8
Then just:
Do = Variable(Set[ToString(Random(2))]) to variable "SelectedNumber"
In both cases I’m just “mapping” the possible values from the Random(x) function to the values from the set (the values from Random(x) would be something like indices)
I don’t know If I am gonna use this logic for my game or not, I just asked out of curiosity but it might be help full for people. So what you should do is pin a forum here that states " First search for the similar forum, if it doesn’t answer your question, then write a forum. Thank you!"