VarRandom

From M.U.G.E.N Wiki

Jump to: navigation, search



State Controller: VarRandom

Sets the specified int variable to a random value. Float variables cannot be set by this controller.

Required parameters:
v = var_no (int)
var_no is the index of the int variable to affect. It must evaluate to an integer between 0 and 59.
Optional parameters:
range = least_val, greatest_val (int)
least_val and greatest_val specify the least and greatest values which can be assigned by this controller, respectively. The value assigned to the variable will be a randomly chosen integer from this range. range defaults to 0,1000. If only one argument is specified, that is considered to specify the range 0,(argument).
Notes:
If you have placed P2 in a custom state through a successful hit, do not use variable assignment within the custom states. Otherwise, you will overwrite P2's variables, which can cause unintended malfunction of the opponent player.

Example:

;Assign a random number between 0 and 500 to var(5).
type = VarRandom
v = 5
range = 500


Personal tools