Random actuator

Hey, I’m kind of new with game logic and Python. I’m trying to create a simulation and I need some simple cubes to go to a frontdesk and then decide wether a cube can enter to the building or not. I’m trying to use a random actuator so I can use the Bernoulli distribution and randomly select (under a specific rate, like 1 out of 10 cannot enter) who can enter and who can’t. So far I’m having problems in getting the status (bool : true/false) of the actuator so I can use the info to separete the cubes. Which bge.types.SCA_RandomActuator property can I use to get the status? or how could I do that in some other way?

Thanks in advance

very simple solution:

you can use your sensor and controller connection to add at the end an property assign actuator and than simply get the state of the property again by an sensor and do you task with it

example:


Random      and                 property
sensor ---- controller ----- actuator


property     and                 (do your stuff)
sensor ---- controller ----- actuator
^
|
if property equal True


if you need some python help just ask again

Pretty simple:

define a property (boolean type would be enough)

activate a random actuator with
-> Seed: 0 (to use the timer)
-> Distribution: Bool Bernoulli
-> Property: the name of the above property
-> Chance: as you like

That is all.