Or Controller: state

state
  • Returns the State Mask group the controller belongs to.

Type: 
  • integer

Values:

  • 1 = State Mask group 1
  • 2 = State Mask group 2
  • 4 = State Mask group 3
  • 8 = State Mask group 4
  • 16 = State Mask group 5
  • 32 = State Mask group 6
  • 64 = State Mask group 7
  • 128 = State Mask group 8
  • 256 = State Mask group 9
  • 512 = State Mask group 10
  • 1024 = State Mask group 11
  • 2048 = State Mask group 12
  • 4096 = State Mask group 13
  • 8192 = State Mask group 14
  • 16384 = State Mask group 15
  • 32768 = State Mask group 16
  • 65536 = State Mask group 17
  • 131072 = State Mask group 18
  • 262144 = State Mask group 19
  • 524288 = State Mask group 20
  • 1048576 = State Mask group 21
  • 2097152 = State Mask group 22
  • 4194304 = State Mask group 23
  • 8388608 = State Mask group 24
  • 16777216 = State Mask group 25
  • 33554432 = State Mask group 26
  • 67108864 = State Mask group 27
  • 134217728 = State Mask group 28
  • 268435456 = State Mask group 29
  • 536870912 = State Mask group 30
Or Controller:
  • A python controller is needed to run the python script used to access any actuators connected to a Controller
     
  • A controller can belong to one and only one state mask group
Sample Code


################  get the state mask group the controller belongs to

# import bge module
import bge

# get the python controller
# Note: My Python controller and Or controller are attached to same game object

python_controller = bge.logic.getCurrentController()

# get the game object that owns the controller
obj = python_controller.owner

# get the Or Controller attached to the game object
# my Or Controller is named Or_1
or_controller = obj.controllers["Or_1"]

# get the state mask group the Or controller belongs to
group = or_controller.state