Random Actuator Bool Bernoulli: seed

seed
  • Starting seed for the random generator
     
  • 0 = not random
     
  • Starting seed has no effect with Bool Bernoulli Random generator

Type: 
  • integer

Range:

  • 0 to 300,000
Bool Bernoulli:
  • Random Generator returns True or False.
     
  • Starting seed has no effect.
     
  • Chance of it being True or False is determined by a percentage you choose.
Sample Code


################  get the starting seed for the random generator

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the actuator attached to the controller
# my actuator is named Flip

act = cont.actuators["Flip"]

# get the starting seed for the random generator
start_seed = act.seed
 
Sample Code


################  Set the starting seed for the random generator

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the actuator attached to the controller
# my actuator is named Flip

act = cont.actuators["Flip"]

# set the starting seed to 80
act.seed = 80