tuxemon.event.actions.set_random_variable module

final class tuxemon.event.actions.set_random_variable.SetRandomVariableAction(var_key, var_value)[source]

Bases: EventAction

Set the key in the player.game_variables dictionary with a random value.

Script usage

set_random_variable <variable>,<value>:<value>
Script parameters:
  • variable – Name of the variable.

  • values – Multiple values of the variable separated

  • with “ – “.

Parameters:
  • var_key (str) –

  • var_value (str) –

name: ClassVar[str] = 'set_random_variable'
start()[source]

Called only once, when the action is started.

For all actions, you will need to override this method.

For actions that only need to run one frame you can simply put all the code here. If the action will need to run over several frames, you can init your action here, then override the update method.

Return type:

None

var_key: str
var_value: str