BGE Logic Nodes Add-on.

V 0.2.8

Reference.

Overview

The add-on allows the user to build logic statements connecting nodes.

 

All the nodes added to the tree are transformed into cells of a network. This network of cells is then pulsed one time per frame during the execution of the game. The net result of this pulse is that the network is evaluated as a set of statements: the parameters that need to be filled with values are filled, the conditions that needs to be checked are checked, the actions that need to be executed are executed. All this happens once per frame. In this execution model, saying that “when the condition A is TRUE, the action B will be executed” means that if the condition is TRUE, the action will be executed one time every frame.

There are three kind of nodes: parameters (green), conditions (yellow), actions (orange).

A parameter is an unconditioned value: it always has a value. A parameter may need to be linked to other cells to have a valid value but nonetheless it will have one.

A condition is a node that emits a TRUE or FALSE value. Some conditions operate by themselves, like the Always condition in the previous image, some may need other conditions, like a And condition:

 

The value emitted by a Condition can be used to form other conditions or to activate Actions or as a parameter – if the boolean alternative TRUE / FALSE makes sense as a parameter in some logic setup.

Actions are conditioned tasks. When the input condition of an action is TRUE, the action is executed. As said before, that means that for each frame in which the condition is TRUE, the action will be executed once. If the action says “move the object 1 unit in some direction” and the actions is  TRUE on every frame, then the object will move 1 unit every frame.

For its output to be executed in the game, a logic tree must be applied to some object.

Each object gets its own copy of the logic tree.

The consequence of that is that both objects will execute the same logic process but some of the parameters in the tree may have different values. For example, named A and B to objects that shares the same logic tree in the blender interface, the parameter “Owner Game Object” will be A, when the A's instance of the tree is executed, and B when the B's instance of the tree is executed.



List of the available nodes.

Parameters

Action Status

 

The Action Status parameter returns the current status of a blender animation (which is called action, presumably because animations are just a kind of action).

The parameter requires a Game Object. If no game object is supplied or if the game object is invalid – because it has been removed from the game – the parameter values will be FALSE, FALSE, NONE, 0.0

The input Game Object is the object that is – or may be – playing an action.

The Layer integer value can be specified directly in the node or supplied with an input. The Layer is the index of the animation channels available to the game object that will be queried.

The output Is Playing is TRUE if the game object is playing some action in the Layer channel, FALSE otherwise.

The output Not Playing is TRUE if the game object is not playing an action in the Layer channel, FALSE otherwise.

The output Action Name is some string if the game object is playing an action in the given Layer, None otherwise. If it is not None, the string is equal to the name of the played action, as seen in the blender interface.

The output Action Frame is the index of the frame currently played by the action in the given layer of the game object, if an action is playing in that layer, otherwise is 0.0

 

Active Camera

 

The Active Camera parameter returns the active camera (a game object, likely to be of type bge.types.KX_Camera) of the input scene.

The output value is a camera object if the input scene is not None and not invalid, otherwise it will be None.

The input scene is a KX_Scene instance (commonly the output of a Current Scene parameter or of a Find Scene action)

 

Arithmetic Op

 

The Arithmetic Op takes two values and return the result of an operation on both.

The input values A and B can be anything that supports the addition, subtraction, multiplication or division operator. For example, “+” is available for strings, so A and B can be strings, but divide is not, so A and B cannot be string if the operator is the division. Matrices can be multiplied, Game Objects cannot. A Vector can be multiplied by a scalar but not added to a scalar or vice versa.

 

Current Scene

 

The Current Scene parameter has a single output that has always the value of the current scene. The current scene is a bge.types.KX_Scene instance and it refers to the scene in which the logic network – which is a plain python module controller in logic brick terms – is executed.

Usually this is the scene you're working on when building the tree – but that really depends on your workflow.

 

Game Object's Parent

Access to the parent of a game object.

The Child Game Object input is the Game Object whose parent will be returned.

The Parent Game Object is the parent of the input child object.


Get Game Object Member

 

This parameter takes an object, usually a Game Object, and returns the value of one of its members. The member is a python attribute of the given object. In the common case, this parameter is used to get values like the position, the color, the orientation or the name of a game object.

The output value depends on the chosen member. It can be a vector, a matrix, a string…

The output will be None if the game object is missing or if it is invalid.

 

Get Game Object Property

 

This parameter returns the value of a game object property. Each game object in the blender game engine has an associated and initially empty set of key-value pairs. This parameter is used to access the values in that set.

The input Object is the game object from where to get the values. If it is None or Invalid, the output of the parameter will be Default value.

The input Name is the string key associated with the requested value. If it missing or empty, the output of the parameter will be the Default value.

The Default value is the value returned if, for any reason, it is not possible to get the requested value from the object (there is no such value, the key is not valid, there is no object).

It is important to remember that the Default value is never set: if the object has not the value with the requested name, the parameter will return the default value but the object will still have no value associated with the given key.

To store the value one has to either use the Set Game Object Property action or use the blender game logic panel.

 

Get Global Value

 

The Get Global Value parameter returns a value shared among all trees.

The system allows the creation of multiple named dictionaries of values. Each one of these dictionaries is identified by a unique name, chosen by the user.

The ID input is a string denoting the unique name of the shared key-value set the user wants to access. Typing something like “My Game Data” means that the key and the value will be retrieved from a shared dictionary that all trees can access via the ID “My Game Data”.

The Key input is a string that defines the unique name of the requested value.

The Default value is the value that the parameter will return if there is no value with the requested Key in the global values set with the given ID.

Global value accessed with this parameter can be persistent – meaning that they might have been written to a file, in bgelogic/storage subdirectory of the main game file.

To store a value in a global dictionary one can use the Set Global Value action. That action also handles the optional persistence of the values.

 

Value

The Value parameter is a constant value. The value can be chosen to be None, a scalar, a string, a boolean, a vector or the result of a constant expression.


Mouse Data

 

The parameter Mouse Data gives access to the position of the mouse cursor, in normalized screen space coordinates – that is from 0.0 to 1.0, with 0.5 being the center.

X is the position along the X axis

Y is the position along the Y axis

DX is the translation of the mouse position along the X axis since the last game frame.

DY is the translation of the mouse position along the Y axis since the last game frame.

DWHEEL is the scroll direction of the mouse wheel (-1, 0 or 1)

(X,Y,0) is a Vector whose first two components are the X and Y positions.

(DY, DY, 0) is a Vector whose first two components are the DX and DY translations.

 

Orientation

 

 

The Orientation parameter is 3x3 rotation Matrix. The X,Y and Z inputs are angle in radians. The Orientation input is another 3x3 Matrix. If there is no Orientation input, the value of the Matrix is the value of the euler angle set (X,Y,Z).

If there is an Orientation input, the rotation component along the X, Y or Z axis is replaced by the corresponding X, Y, Z input angle. To avoid this replacement, the X, Y or Z angle must be set to None.

The Orientation output is a 3x3 Matrix obtained with the aforementioned substitution process.

The XYZ Rad Euler output is the euler angle set (X,Y,Z), obtained from the output matrix.

The X Rad is the X component of that euler angle set – the rotation along the X axis.

The Y Rad is the Y component of that euler angle set – the rotation along the Y axis.

The Z Rad is the Z component of that euler angle set – the rotation along the Z axis.

 

Owner Game Object

 

The Owner Game Object is the game object to which this logic tree is applied. When a tree is applied to multiple objects, because each object will get an instance of the tree, the Owner Game Object parameter will return, for each tree instance, a different game object. That allows the tree to be applied to different things without one interfering with the others.

The output is never None and never invalid. Unless there is a bug.

 

Python Module Function

 

The Python Module Function is a parameter whose ouput is a set of four value, resulting from the application of a function defined in a python module to a set of four inputs.

The Module input is a string, whose value corresponds to the name of the python module that contains the invoked function.

The Member input is a string, whose value corresponds to the name of the python function (or callable member) that will be invoked.

If the Module or the Member inputs are None or empty, the parameter node will print the input values on the console – as a debug utility.

The four inputs are the values of anything that gets linked to it.

The four outputs are the values that the called function wants to expose to other cells.

The called function must take one argument. That argument is a cell object – the cell that represents the parameter node at runtime.

The cell has a list of inputs and a list of outputs.

Both lists have four slots.

The input list is called… inputs, the output list is called outputs.

For example, a function could be:

 

def do_something(cell):

 

In the body, to access the value of the input IN0, one could write:

 

some_value_0 = cell.inputs[0]

 

and

 

some_value_1 = cell.inputs[1]

some_value_2 = cell.inputs[2]

some_value_3 = cell.inputs[3]

 

The function does its work on the needed value then, if it wants to spit out some result, it can do so by filling the outputs slots:

 

cell.outputs[0] = some value

cell.outputs[1] = some other value

cell.outputs[2] = whatever

cell.outputs[3] = a thing

 

Non connected input slots have the default value None.

 

Time

 

The Time parameter returns two time relate values.

Time Per Frame is the time elapsed since the last game frame. This time value can be used to compute displacements that are the result of a velocity.

Timeline is the time elapsed since the start of the underlying network. If some action must happen after ten minutes are passed since the start of the game, one can use this value – provided that the tree It belongs to has also been started when the game did.

 

Value Switch

 

Value Switch takes two inputs A and B and returns either A or B, according to evaluation of a third input value, “True A, False B”. The default output is None. A and B can be anything, the input value for the “condition” can be any boolean value or any value that can be evaluated for truth – in the python sense of “if X then return A else return B”

 

Vector

 

The Vector parameter returns a Vector and each one of its components. The default value is the zero Vector and zero is also the default value of the outputs X, Y, Z.

If provided, the input Vector is used to set the components of the output Vector.

The input components X, Y and Z replaces the corresponding components of the input Vector, if they are not None.

The Normalized Vec output is the normalized output vector.


Vector 4

The Vector 4 parameter assembles and returns a vector and its components.

If the node has an input vector (with 3 or 4 components) AND some component inputs (any combination of X,Y,Z,W) the resulting vector is (a copy of) the same as the input one with the individual components replaced by the inputs that are not None.


 

Sound

The Sound parameter represents a sound object, for the purpose of… playing sound. The resulting Sound value is an instance obtained from the given sound file. It is possible, through other nodes, to start, stop or loop a single Sound. If one needs to play two instances of the same Sound at once, there must be two different Sound parameters, both using the same file path.

The File input is a string, denoting the relative or absolute path of a sound File. It looks like a sound in blender can be played as a 3D sound only if it is mono. A path is relative if it starts with a double forward slash (//). Internally, the relative path is transformed into an absolute path by calling bge.logic.expandPath (which should result in a path relative to the path of the main blender file of the game).

The Sound output is the node representation of the sound file. The Sound socket is blue, so it should be clear who can use a sound.

The Is Playing output signals if the sound is playing (TRUE) or not (FALSE).

The Current Frame output is the position (in seconds) of the playing sound. It can be used in conjunction with other nodes to do stuff like executing some action when a sound track has reached or past a certain threshold point.


Formatted String

The Formatted String parameter takes some input values and returns a string. The intended purpose is to show on the user interface information strings like how much life the player has, how many bullets are available or the name of an enemy… things like that.

The Format String input is the string one would pass to the “format” function of a python string (like “something”.format(the_format_string)). What can go in that format string is defined by that format function. Basically, {} is A, B, C or D, {0} is A, {1} is B, {2} is C, {3} is D. One can use {0:.2f} to format a decimal value with two digits after the dot, and so forth.

The four inputs A, B, C and D are the values that can be used in the format string. There are four of them for an arbitrary decision on my part.


Distance

The distance parameter returns the distance between two values.

The A and B inputs can be game objects, vectors or sequences of 3 decimal values, in any combination.



Armature Bone Status

The Armature Bone Status parameter gives access to the position, orientation and scale value of an armature's bone.

The Armature Object input is a game object that points to a game armature. In the game engine, armatures are translated into KX_GameObject instances so it possible to access an armature using one of the lookup nodes that seeks Game Object instances.

The Bone Name input is the name of the bone we want to access, as seen in the blender interface.

The XYZ Pos, XYZ Rot and XYZ Scale outputs returns the position, rotation and scale of the bone, as vectors. The rotation is always expressed in XYZ euler form.

 

Screen Position

The Screen Position parameter converts the world position (of a Game Object or as a Vector 3) into a normalized screen location (-1.0 to 1.0, where 0.5 is the center of the screen)

The Game Object /Vector input is the world position (of the Game Object or packed into a Vector3) to translate

The Camera input is the Camera relative to which the world position is transformed

The Screen X output is the resulting x value (horizontal axis) in the normalized screen coordinate system

The Screen Y output is the resulting y value (vertical axis) in the normalized screen coordinate system


World Position

The World Position parameter translates a screen position (in normalized screen coordinates) into a world position (vector 3)

The Camera input is the camera object relative to which the translation occurs.

The Screen X input is the normalized (-1.0 to 1.0, where 0.5 is the center of the screen) value along the horizontal axis

The Screen Y input is the normalized value along the vertical axis

The Depth value is a scalar (float, double, integer…) that represents the distance from the camera plane in world coordinates of the resulting 3d point.


Conditions

Always

 

The Always condition returns TRUE for the first network pulse and FALSE all other times. If Repeat is ON, the condition returns TRUE all the time. With Repeat OFF, the condition can be used to execute actions just once, the first time the network is executed. With Repeat ON, it can be used to activate actions once every frame.

 

And

 

The And condition output is TRUE if both A and B input values are TRUE, it is FALSE if any of A or B is FALSE. The purpose is to do something when two conditions are both TRUE (like keeping the mouse button and the shift key pressed to activate some action)

 

And List

The And List condition returns TRUE if all the linked input values are TRUE. It is not necessary to fill all the input sockets, the condition works with up to six input values.


Collision

 

The Collision condition is used to detect collisions between game objects. The “When Colliding” output is TRUE fo as long as the input Game Object is in collision with another object.

The Game Object input is the object whose collision with other objects are monitored. If the input Game Object is None or invalid, the Collision returns FALSE, None, None, None.

The Game Object output is the object with whom the monitored object is in collision.

The Point output is a Vector denoting the contact point of the collision.

The Normal output is a Vector denoting the normal at the contact point. More or less.

 

Key Pressed

 

The Key Pressed condition is used detect the state of a keyboard's key.

If Pulse is OFF, the output of the condition is TRUE the first time the key is pressed and FALSE from then on until the key is released. After the release, the condition will by TRUE again when the key is pressed and so no.

If Pulse is ON, the condition remaing TRUE until the key is released.

The monitored key can be chosen by pressing the Press & Choose button and then pressing the requested key or by using an input value. The input value is a string that corresponds to the name of one of the blender constants for a keyboard key.

 

Key Released

 

The KeyPressed condition works the same as the Key Released condition, but for release events.

 

Mouse Pressed

 

The Mouse Pressed condition is the analog of Key Pressed for mouse buttons. The button input takes a string equal to the fully qualified name of one of the bge constants that identifies a mouse button (for example bge.events.LEFTMOUSE)

 

Mouse Released

 

Mouse Released does the same as Mouse Pressed but for button release events.

 

Logic Operations

 

The Logic Operations condition remains TRUE for as long as the result of the selected logic operation, applied to the two input values, is also TRUE

 

Check Distance

The Check Distance condition checks the distance between two values and returns True or False according to the result of a logic operation between that distance and a threshold

The Check input is the logic operation performed between the computed distance and the Dist value

The A input is a Vector, a Game Object or a sequence of 3 decimal values

The B input is a Vector, a Game Object or a sequence of 3 decimal values

The Dist input is the value to check the computed distance against

The Hyst input is the hysteresis value to apply when the check operation is a greater than or less that or greater than/equal to or less that/equal to value. When the input is specified, it acts as a threshold on subsequent activations of the condition, like a small pause an object will take before to start following again a target.

The Out output returns TRUE for as long as the condition check is satisfied.


Logic Network Status

 

 

The Logic Network Status condition monitors the status of a logic network – that is the runtime version of a Logic Tree – and returns if it is running or not.

The Game Object input is a game object that may or may not have a tree installed.

The Tree Name input is the name of the logic tree as seen in the blender interface.

If the game object is None or invalid, the condition returns FALSE for both outputs.

If the game object has the given network installed and running, the If Running output will be TRUE. If the network is not running, it will return FALSE. If Stopped works the contrary.

 

Mouse Targeting

 

The Mouse Targeting condition monitors an object for Mouse Enter, Mouse Over and Mouse Exit events. When the mouse cursor enters the projected surface of the object, the output On Mouse Enter will be TRUE, once, until the mouse exists the surface and then enters a second time…

The On Mouse Over output is TRUE for as long as the mouse cursor stays inside the projected surface of the object.

The On Mouse Exit output is TRUE when the mouse cursor exits the surface, then it will be FALSE until the cursor enters and then exits again.

The Point and Normal output are the Point and the Normal to the surface of the object where the mouse cursor is.

If the input Game Object is None or invalid, the output is FALSE, FALSE, FALSE, None, None.

 

Not

 

The Not condition returns TRUE if the input Condition is FALSE and FALSE if the input Condition if TRUE. When Pulse is OFF (input value FALSE), the condition will return the negated input Condition once, then it will return FALSE until the input Condition changes its value. When Pulse is ON (input value TRUE), the condition will constantly return the negated value of the input Condition.

 

Not None

 

The Not None condition returns TRUE if the input Value is not None, FALSE, if it is None.

 

None

The None condition returns TRUE if the input Value is None, FALSE if it is not None


Once

 

The Once condition return TRUE if the input Condition is TRUE, for one network pulse/loop/cycle whatever, then it will always return FALSE

 

Or

 

The Or condition returns TRUE if either A or B is TRUE, if returns FALSE if both input A and B are FALSE

 

Or List

The Or List condition returns TRUE if any of the linked values is also TRUE. It is not necessary to fill all the sockets, the condition works with up to six inputs.


Time Elapsed

 

The Time Elapsed condition outputs TRUE after a certain amount of seconds have passed since the start of the underlying logic network. If Repeat is checked (or the linked input evaluates to TRUE), the output will be TRUE once every given seconds. The Seconds input takes a floating point value.

 

Value Changed

 

The Value Changed condition monitors a Value and becomes TRUE when the value changes. The condition will then return FALSE until the value changes again.

The Old Value output returns the old value, the New Value output returns the new value.

The Value input can be any value.

If Initialize is ON, the condition takes the first value as the initial one and signals when the input value changes from that.

If Initialize is OFF, the first comparison in done against None.

 

Value Changed To

 

The Value Changed To condition monitors a value and signals when it changes into some other specific value. The output value becomes TRUE the first time the change is detected and then stays FALSE until the change is detected again.

 

Mouse Pressed On

The Mouse Pressed On condition is a short cut for the common task of doing something when the user clicks on a game object.

The button input controls which button must activate the check

The Game Object input represents the Game Object that must be under the mouse cursor when the mouse button is pressed to activate the condition.

The When Pressed On output is TRUE if the user pressed the mouse button when the Game Object is under the cursor (then it becomes false waiting for another “click”), it is FALSE if the user didn't press the mouse button, the cursor was not pointing at Game Object or the condition triggered and the mouse button has not been released and pressed again.


Mouse Wheel Moved

The Mouse Wheel Moved condition detects the movement of the mouse wheel.

The scroll input controls which direction of the wheel should be monitored. Scroll Up (integer value 1) detects the mouse scrolling toward positive values, Scroll Down (input integer 2) detects the mouse scrolling toward negative values, Scroll Up or Down (input integer 3) detects the mouse wheel scrolling in any “direction”.

The output condition is TRUE whenever the requested scroll happens.


Actions

Add Object

 

The Add Object actions adds a game object to a scene every time the input Condition is True. The added object is returned from the Added Object output.

The Name input is a string equal to the name of an object contained in an inactive layer of the given Scene.

The Life input measures for how many logic ticks the object will remain in the scene, before to be automatically removed. If zero, the object won't be removed – unless one does so by other means.

 

Align Axis to Vector

The Align Axis to Vector action aligns the local axis of a game object to a world direction – expressed as a x,y, z vector.

The Condition input determines when the action is executed – as long as the input is TRUE.

The Game Object input is the Game Object whose axis will be aligned (so the object rotates).

The Vector input is a x,y,z vector that represent the target world direction of the alignment. The vector can be specified in the field as a sequence of decimal numbers separated by any non numeric character sequence (like 1 1 1 or 1,1,1 or 1, 1, 1 and so on)

The axis input is the local axis of the game object that will be aligned.

The Factor input is a 0.0 – 1.0 value that represent how close the local axis will be aligned (0.0 not even a bit, 1.0 parallel).


Follow Path

This action moves a Game Object along a path. The path is defined as a sequence of points derived from the children of a game object. It means that you have to create an object – ideally an empty one that will be passed to the Path input. The world positions of all the children of that object will be the points of the path. The order is established by the name of each children. If the parent object is “Empty” and it has three children “A”, “C”, “B”, the path resulting from using “Empty” as the game object linked to the Path input will be A.worldPosition, B.worldPosition, C.worldPosition. While it might look a bit complicate, creating a path is actually quite simple: create an empty object, duplicate it the make the duplicate a child of the empty. That will be the first point of the path. To add the second point, select the child, shift-d and move it, to add a third point, shift-d and move it. And so on, Altering the position of the children will also alter the path points.

The Condition input activates the action. The condition must be continuously true for the action to operate.

The Moving Object input is the Game Object that will be translated along the path.

The Rotating Object input is the Game Object that will be rotated to look at the next point in the path. This can be the same as Moving Object or another object – usually a child of the moving object, like a turret.

The Path input is the aforementioned parent of a set of children-points

The Loop input is a boolean (TRUE/FALSE) that controls whether the action should loop the object along the path or not (a patrolling character will loop along the path until something happens that stops the follow path action)

The Optional Navmesh Object is a navmesh object. When the navmesh is present, the path will be defined using the information of the navmesh – instead of being a sequence of straight lines among the Path points.

The Move as Dynamic input is a boolean value (TRUE/FALSE) that controls whether the moving object should be translated varying its position of through its dynamic velocity components. Moving a dynamic object by settings its position (that is with “Move As Dynamic” to False) might cause the physic engine to warp it over obstacles – depending on how fast it moves, how thin the obstacle is, how big is the time step between updates of the physic engine. A static object cannot be moved via its velocity (so Move As Dynamic must be False)

The Lin Speed input is the value of the linear speed at which the object is moved.

The Reach Threshold value controls the minimum distance that the center of the moving object must reach from the current destination point in the path before to move to the next point. In general this value should be at least as big as the radius of a sphere surrounding the model, otherwise the object will never “reach” the current point.

The Look At input controls whether the Rotating Object (if defined) should be oriented toward the next point of the path.

The Rot Axis is the axis or rotation that will be changed to orientate the Rotating Object. For a walking character this is the Z axis. A turret placed on a wall might use the Y or X axis.

The Front input is the local front axis of the rotating object. If a character is set to walk forward when its Y value increases, the front axis is Y+.

The Rot Speed is the angular speed (radians per second) at which the rotating object rotates. If None, the rotating object is instantaneously oriented toward the current point of the path.


Move To

The Move To action moves an object toward a point. The output of the action signals when the destination has been reached.

The Move As Dynamic input works like the same input in Follow Path.

The Destination XYZ input is a vector (or a sequence of 3 decimals) representing the destination point. If this vector is the position of an object, Move To will behave like a Follow action.

The Stop At Distance input controls the minimum distance from the target that the moving object must reach to consider the destination reached. This should be no less than the radius of the moving object.


Replace Mesh

The Replace Mesh node replaces the mesh of a game object with another mesh.

The Condition controls when the action is executed (as long as it is TRUE).

The Target Game Object is the Game Object whose current mesh will be replaced.

The New Mesh Name input is the blender name of the mesh object that will be used as a replacement.

The Use Display input (TRUE/FALSE) controls whether the new mesh will replace the visible mesh of the game object.

The Use Physics input (TRUE/FALSE) controls whether the new mesh will replace the physics mesh of the game object.


Rotate To

This action rotates an object toward a position.

The target position is a vector or a sequence of 3 decimal values.

The rot axis is the axis along which the object will be rotated. The Z axis for a common character standing on ground.

The front input is the front axis of the object: the direction in which the object is considered moving forward.

The speed is the angular velocity of the rotation – radians per second.


Move To with Navmesh

This action behaves like a combination of Move To and Rotate To along the points that a navigation mesh returns as the path the object must follow to reach a certain position.

The Moving Object and Rotating Object can be the same game object or different ones if the part that must look at the moving direction is different than the moving body itself.

The Navmesh Object is a navigation mesh Game Object

The Destination input is a Vector or a sequence of three decimal values

The Move as Dynamic input is the same as the one in Follow Path

The Linear Speed and Reach Threshold controls the velocity of the object and the minimum distance the object must reach to stop the action – or move to the next point determined by the navigation mesh.

The Look At controls whether the Rotating Object must be oriented toward the next point, rotating around Rot Axis and facing Front axis at the given Rot Speed in radians per second.

The output condition is True when the object reaches the destination.


Add Scene

 

The Add Scene action adds a scene, identified by its name as seen in the blender interface, to the game as an overlay or a background, every time the input Condition is TRUE.

The Name input is a string.

 

Apply Motion/Rotation/Force/Torque

 

The Apply Value to Game Object actions applies a motion or rotational displacement, a force or a torque to a Game Object, every time the Condition is TRUE.

All applied inputs are 3 component Vectors (or list/tuple equivalents).

The rotation is in radians.

If the input Game Object is None or invalid, the action does nothing

 

Camera Pick

 

The Camera Pick action picks an object from a camera.

The pick aim can be a pair of floats, a vector or a game object. The aim is a pair of floats, the camera picks the first object located at the normalized screen position denoted by the pair. When the aim is a game object or a vector, the camera picks the first object in the direction that goes from the camera position to the aim position.

The Property input, when not empty or None, filters the pickable objects by possession of a property with that name.

The Distance input is the maximum distance at which an object can be picked.

The Has Result output is TRUE if the camera actually picks an object, it is FALSE if there is no target to pick.

The Picked Object output is the object that has been picked or None, if there is no result.

The Picked Point is the point on the surface of the target that has been picked.

The Picked Normal is the normal to the surface at thatn point.

 

 

Dynamic Object Controller

 

The Dynamic Object Controller moves and rotates two objects in a way compatible with a FPS or TPS navigator.

The Body Object must be a game object with physics set to Dynamic. The Head Object should be a KX_Camera – or a node whose child is a KX_Camera object but it can really be any game object.

When the Condition is True, the action evaluates the various “motion” conditions to rotate the body object along the Z axis and the camera along the X axis, to move the body object on the Y axis (forth-back) and the X axis (left-right), to apply a positive force value on the Z axis when it jumps.

The Head Rot Arc Size input determines the maximum and minimum orientation of the Head Object on the X axis, it is an angle in radians.

The Head Rot Speed is the speed of the rotation of the Head Object, in radians per second.

The Body Rot Speed is the speed of the rotation of the Body Object, same unit.

The Walk Speed and the Run Speed are the speeds at which the Body Object moves and runs, in unit per second.

The Jump Force is the measure of the force applied to the Z axis of the Body Object to make it jump.

The Body Object doesn't jump when jumping or flying (there's a check against the Z component of the velocity).

The inputs for the controls are condition results (TRUE/FALSE values), not keyboard keys or mouse buttons.

 

Find Game Object

 

The Find Game Object action finds and returns a game object.

If the condition is missing, the action will be executed once when the network starts and it will keep its value, if anything is found, until it becomes invalid.

If the condition is linked, the action will execute when the condition is TRUE until an object is found. When an object is found the action is not executed again, no matter what the condition state, until the found object becomes invalid. So this thing actually searches an object and the keeps it memorized.

The action can search for an object among all the objects in a given game scene or among the children (recursively) of some game object.

The From Scene input gives the action the scene to search in.

The From Parent input gives the action the parent object to search in.

The Query input is a string. The string is a query executed on the name of each scanned object. The query has the form:

[*]token[*]

The prefix and postfix asterisks are optional.

When there is no asterisk, the token is the exact name the action must look for.

The form *token means “the name must end with token”, the form “token*” means “the name must start with token”.

 

Find Scene