Module KX_SCA_AddObjectActuator :: Class KX_SCA_AddObjectActuator
[frames | no frames]

Class KX_SCA_AddObjectActuator

SCA_ILogicBrick --+    
                  |    
      SCA_IActuator --+
                      |
                     KX_SCA_AddObjectActuator


Edit Object Actuator (in Add Object Mode)

Warning:

An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer.

This will genereate a warning in the console:

ERROR: GameObject OBName has a AddObjectActuator ActuatorName without object (in 'nonactive' layer)

Method Summary
KX_GameObject getLastCreatedObject()
Returns the last object created by this actuator.
list [vx, vy, vz] getLinearVelocity()
Returns the initial linear velocity of added objects.
string getObject()
Returns the name of the game object to be added.
integer getTime()
Returns the lifetime of the added object, in frames.
  setLinearVelocity(vx, vy, vz)
Sets the initial linear velocity of added objects.
  setObject(obj)
Sets the game object to add.
  setTime(time)
Sets the lifetime of added objects, in frames.
    Inherited from SCA_ILogicBrick
integer getExecutePriority()
Gets the execution priority of this logic brick.
KX_GameObject getOwner()
Gets the game object associated with this logic brick.
  setExecutePriority(priority)
Sets the priority of this logic brick.

Method Details

getLastCreatedObject()

Returns the last object created by this actuator.
Returns:
A KX_GameObject or None if no object has been created.
           (type=KX_GameObject)

getLinearVelocity()

Returns the initial linear velocity of added objects.
Returns:
list [vx, vy, vz]

getObject()

Returns the name of the game object to be added.

Returns None if no game object has been assigned to be added.
Returns:
string

getTime()

Returns the lifetime of the added object, in frames.
Returns:
integer

setLinearVelocity(vx, vy, vz)

Sets the initial linear velocity of added objects.
Parameters:
vx - the x component of the initial linear velocity.
           (type=float)
vy - the y component of the initial linear velocity.
           (type=float)
vz - the z component of the initial linear velocity.
           (type=float)

setObject(obj)

Sets the game object to add.

A copy of the object will be added to the scene when the actuator is activated.

If the object does not exist, this function is ignored.

obj can either be a KX_GameObject or the name of an object.
Parameters:
obj
           (type=KX_GameObject or string)

setTime(time)

Sets the lifetime of added objects, in frames.

If time == 0, the object will last forever.
Parameters:
time - The minimum value for time is 0.
           (type=integer)

Generated by Epydoc 2.1 on Thu Feb 1 00:12:33 2007 http://epydoc.sf.net