Module GameTypes :: Class SCA_IController
[frames] | no frames]

Class SCA_IController

PyObjectPlus --+        
               |        
          CValue --+    
                   |    
     SCA_ILogicBrick --+
                       |
                      SCA_IController
Known Subclasses:

Base class for all controller logic bricks.

Instance Methods
bool
isA(game_type)
Check if this is a type or a subtype game_type. (Inherited from GameTypes.PyObjectPlus)
    Deprecated
int
getState()
Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active.
list [SCA_ISensor]
getSensors()
Gets a list of all sensors attached to this controller.
SCA_ISensor
getSensor(name)
Gets the named linked sensor.
list [SCA_IActuator]
getActuators()
Gets a list of all actuators linked to this controller.
SCA_IActuator
getActuator(name)
Gets the named linked actuator.
integer
getExecutePriority()
Gets the execution priority of this logic brick. (Inherited from GameTypes.SCA_ILogicBrick)
string
getName()
Returns the name of the CValue. (Inherited from GameTypes.CValue)
KX_GameObject
getOwner()
Gets the game object associated with this logic brick. (Inherited from GameTypes.SCA_ILogicBrick)
 
setExecutePriority(priority)
Sets the priority of this logic brick. (Inherited from GameTypes.SCA_ILogicBrick)
Instance Variables
sequence supporting index/string lookups and iteration. actuators
a list of actuators linked to this controller.
int executePriority
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). (Inherited from GameTypes.SCA_ILogicBrick)
bool invalid
Test if the object has been freed by the game engine and is no longer valid. (Inherited from GameTypes.PyObjectPlus)
string name
The name of this CValue derived object (read-only). (Inherited from GameTypes.SCA_ILogicBrick)
KX_GameObject or None in exceptional cases. owner
The game object this logic brick is attached to (read-only). (Inherited from GameTypes.SCA_ILogicBrick)
sequence supporting index/string lookups and iteration. sensors
a list of sensors linked to this controller
int bitmask state
the controllers state bitmask.
bool useHighPriority
When set the controller executes always before all other controllers that dont have this set.
Method Details

getState()

 

Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. This for instance will always be true however you could compare with a previous state to see when the state was activated. GameLogic.getCurrentController().state & GameLogic.getCurrentController().owner.state

Returns: int

Deprecated: Use the state property

getSensors()

 

Gets a list of all sensors attached to this controller.

Returns: list [SCA_ISensor]

Deprecated: use the sensors property

getSensor(name)

 

Gets the named linked sensor.

Parameters:
  • name (string)
Returns: SCA_ISensor

Deprecated: use the sensors[name] property

getActuators()

 

Gets a list of all actuators linked to this controller.

Returns: list [SCA_IActuator]

Deprecated: Use the actuators property

getActuator(name)

 

Gets the named linked actuator.

Parameters:
  • name (string)
Returns: SCA_IActuator

Deprecated: use the actuators[name] property


Instance Variable Details

actuators

a list of actuators linked to this controller.
  • note: the sensors are not necessarily owned by the same object.
  • note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
Type:
sequence supporting index/string lookups and iteration.

sensors

a list of sensors linked to this controller
  • note: the sensors are not necessarily owned by the same object.
  • note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
Type:
sequence supporting index/string lookups and iteration.

state

the controllers state bitmask. This can be used with the GameObject's state to test if the controller is active.
Type:
int bitmask

useHighPriority

When set the controller executes always before all other controllers that dont have this set. note: Order of execution between high priority controllers is not guaranteed.
Type:
bool