Action: GotoRandom(chance, label ID A, label ID B)

Related Actions: gosub, gosubrandom, goto, repeat, exitloop, exitevent
Related Events: label
See also: FKiSS, Events, Actions

gotorandom(chance, label ID A, label ID B)

First defined in: FKiSS3
Processing immediately jumps from this action to one of the specified labels. When that label finishes, processing of the current event does not continue.
Which label is processed is determined randomly where chance is the percentage that label ID A will be chosen instead of label ID B.

chance

chance is a value between 1 and 100 and may be a number or a variable.

label ID A
label ID B

In FKiSS3, label ID A and label ID B may be label ID numbers or a variables representing label ID numbers.
In FKiSS4, label ID A and label ID B may be label IDs (number or symbolic name) or a variables representing label ID numbers.

Example:

;@ gotorandom(50, 5, 7) ; 50% chance of going to label 5; otherwise, go to label 7.
;@ gotorandom(Odds, ThisLabel, ThatLabel)