Skip to content
ShalokShalom edited this page Dec 21, 2024 · 25 revisions

Logic Nodes Reference: Basic nodes

This reference was generated automatically. Please do not edit the page directly, instead change the docstrings of the nodes in their Python files or the generator script and open a pull request. Thank you for contributing!

This reference was built for Armory 2023.11.


Node Categories

Logic

Logic nodes are used to control execution flow using branching, loops, gates etc.

Alternate Output

Activates the outputs alternating every time it is active.

Alternate Output node

Sources: Python | Haxe

Branch

Activates its true or false output, according to the state of the plugged-in boolean.

Branch node

Sources: Python | Haxe

Call Function

Calls the given function that was created by the Function node.

Call Function node

Sources: Python | Haxe

Case Index

Compare the given Compare value with the other inputs for equality and return the index of the first match. This is particularly helpful in combination with the Select node.

See also:

Case Index node

Inputs:

  • Compare: the value to be compared
  • Value: values for the dynamic comparison

Outputs:

  • Index: the index of the first equal value, or null if no equal value was found.

Sources: Python | Haxe

Function

Creates a reusable function that can be called by the Call Function node.

Function node

Sources: Python | Haxe

Function Output

Sets the return value for the given function.

See also:

Function Output node

Sources: Python | Haxe

Gate

Logic nodes way to do "if" statements. When activated, it compares if its two inputs are being Equal, Greater Equal, Less Equal, Not Equal, or Between, regardless of variable type, and passes through its active input to the output that matches the result of the comparison.

"And" and "Or" are being used for booleans only, and pass through the input when both booleans are true (And) or at least one (Or).

Gate node

Sources: Python | Haxe

Invert Boolean

Inverts the plugged-in boolean. If its input is true it outputs false.

Invert Boolean node

Sources: Python | Haxe

Invert Output

Activates the output if the input is not active.

Invert Output node

Sources: Python | Haxe

Is False

Passes through its activation only if the plugged-in boolean equals false.

See also:

Is False node

Sources: Python | Haxe

Is Not Null

Passes through its activation only if the plugged-in value is not null.

See also:

Is Not Null node

Sources: Python | Haxe

Is Null

Passes through its activation only if the plugged-in value is null (no value).

See also:

Is Null node

Sources: Python | Haxe

Is True

Passes through its activation only if the plugged-in boolean equals true.

See also:

Is True node

Sources: Python | Haxe

Loop

Resembles a for-loop (for (i in from...to)) that is executed at once when this node is activated.

See also:

Loop node

Inputs:

  • From: The value to start the loop from (inclusive)
  • To: The value to end the loop at (exclusive)

Outputs:

  • Loop: Active at every iteration of the loop
  • Index: The index for the current iteration
  • Done: Activated once when the looping is done

Sources: Python | Haxe

Loop Break

Terminates the currently executing loop (only one loop is executed at once).

See also:

Loop Break node

Sources: Python | Haxe

Loop Continue

continues to the next loop.

See also:

Loop Continue node

Sources: Python | Haxe

Merge

Activates the output when at least one connected input is activated. If multiple inputs are active, the behaviour is specified by the Execution Mode option.

Merge node

Outputs:

  • Active Input Index: [Available if Execution Mode is set to Once Per Input] The index of the last input that activated the output, -1 if there was no execution yet on the current frame.

Options:

  • Execution Mode: The node's behaviour if multiple inputs are active on the same frame.
    • Once Per Input: If multiple inputs are active on one frame, activate the output for each active input individually (simple forwarding).
    • Once Per Frame: If multiple inputs are active on one frame, trigger the output only once.
  • New: Add a new input socket.
  • X Button: Remove the lowermost input socket.

Sources: Python | Haxe

Null

A null value that can be used in comparisons and conditions.

Null node

Sources: Python | Haxe

Once Per Frame

Activates the output only once per frame if receives one or more inputs in that frame If there is no input, there will be no output

Once Per Frame node

Sources: Python | Haxe

Output Sequence

Activates the outputs one by one sequentially and repeatedly.

Output Sequence node

Sources: Python | Haxe

Output to Boolean

Converts a signal to a boolean value. If the input signal is active, the boolean is true; if not, the boolean is false.

Output to Boolean node

Sources: Python | Haxe

Pulse

Sends a signal repeatedly between the given time interval until you stop it.

Pulse node

Inputs:

  • Start: Starts to send the signals
  • Stop: Stops to send the signals
  • Interval: The interval between the signals

Sources: Python | Haxe

Select

Selects one of multiple values (of arbitrary types) based on some input state. The exact behaviour of this node is specified by the Execution Mode option (see below).

Select node

Outputs:

  • Out: [Available if Execution Mode is set to From Input] Activated after the node was executed.
  • Value: The last selected value. This value is not reset until the next execution of this node.

Options:

  • Execution Mode: Specifies the condition that determines what value to choose.
    • From Index: Select the value at the given index. If there is no value at that index, the value plugged in to the Default input is used instead (null if unconnected).
    • From Input: This mode uses input pairs of one action socket and one value socket. Depending on which action socket is activated, the associated value socket (the value with the same index as the activated action input) is forwarded to the Value output.
  • New: Add a new value to the list of values.
  • X Button: Remove the value with the highest index.

Sources: Python | Haxe

Switch Output

Activates the outputs depending of the value. If the "value" is equal to "case 1", the output "case 1" will be activated.

Switch Output node

Outputs:

  • Default: Activated if the input value does not match any case.

Sources: Python | Haxe

Value Changed

Upon activation through the In input, this node checks whether the given value is different than the value from the last execution of this node.

Value Changed node

Outputs:

  • Changed: Activates if the value has changed compared to the last time the node was executed or if the node is executed for the first time and there is no value for comparison yet.
  • Unchanged: Activates if the value is the same as it was when the node was executed the last time.
  • Is Initial: Activates if the value is equal to the value at the first time the node was executed or if the node is executed for the first time. This output works independently of the Changed or Unchanged outputs.

Sources: Python | Haxe

Wait for All Inputs

Activate the output when all inputs have been activated at least once since the node's initialization. Use This node for parallel flows. Inputs don't need to be active at the same point in time.

Wait for All Inputs node

Inputs:

  • Input[0-n]: list of inputs to be activated

Outputs:

  • Output: output triggered when all inputs are activated

Sources: Python | Haxe

While True

Loops while the condition is true.

See also:

While True node

Inputs:

  • Condition: boolean that resembles the result of the condition

Outputs:

  • Loop: Activated on every iteration step
  • Done: Activated when the loop is done executing

Sources: Python | Haxe

Event

On Application State

Listens to different application state changes.

On Application State node

Sources: Python | Haxe

On Event

Activates the output when the given event is received.

See also:

On Event node

Sources: Python | Haxe

On Init

Activates the output on the first frame of execution of the logic tree.

On Init node

Sources: Python | Haxe

On Remove

Activates the output when logic tree is removed

On Remove node

Sources: Python | Haxe

On Render2D

Registers a 2D rendering callback to activate its output on each frame after the frame has been drawn and other non-2D render callbacks have been executed.

On Render2D node

Sources: Python | Haxe

On Timer

Activates the output when a given time elapsed (optionally repeating the timer).

On Timer node

Inputs:

  • Duration: the time in seconds after which to activate the output
  • Repeat: whether to repeat the timer

Sources: Python | Haxe

On Update

Activates the output on every frame.

On Update node

Options:

  • Update: (default) activates the output every frame.
  • Late Update: activates the output after all non-late updates are calculated.
  • Physics Pre-Update: activates the output before calculating the physics. Only available when using a physics engine.

Sources: Python | Haxe

Send Event to Object

Sends a event to the given object.

See also:

Send Event to Object node

Inputs:

  • Event: the identifier of the event
  • Object: the receiving object

Sources: Python | Haxe

Send Global Event

Sends the given event to all objects in the scene.

See also:

Send Global Event node

Inputs:

  • Event: the identifier of the event

Sources: Python | Haxe

Input

Cursor In Region

Detect cursor in specific region.

Cursor In Region node

Inputs:

  • Center X/Y: The position of the center in pixels.
  • Width: Width of the region in pixels.
  • Height: Height of the region in pixels.
  • Angle: Rotation angle in radians. Rotation is clockwise.

Outputs:

  • On Enter: Activated after the cursor enters the region.
  • On Exit: Activated after the cursor exits the region.
  • Is Inside: True if inside the region. False otherwise.

Sources: Python | Haxe

Gamepad

Activates the output on the given gamepad event.

See also:

Gamepad node

Inputs:

  • Gamepad: the ID of the gamepad.

Options:

  • State: the state of the gamepad button to listen to.
  • Button: the gamepad button that should activate the output.

Sources: Python | Haxe

Gamepad Coords

Returns the coordinates of the given gamepad.

See also:

Gamepad Coords node

Inputs:

  • Gamepad: the ID of the gamepad.

Sources: Python | Haxe

Gamepad Sticks

Activates the output on the given gamepad event.

See also:

Gamepad Sticks node

Inputs:

  • Gamepad: the ID of the gamepad.

Options:

  • state: the state of the gamepad stick to listen to.
  • stick: the gamepad stick that should activate the output.
  • axis: the gamepad stick axis value

Sources: Python | Haxe

Get Cursor Location

Returns the mouse cursor location in screen coordinates (pixels).

Get Cursor Location node

Sources: Python | Haxe

Get Cursor State

Returns the state of the mouse cursor.

See also:

Get Cursor State node

Outputs:

  • Is Hidden Locked: true if the mouse cursor is both hidden and locked.
  • Is Hidden: true if the mouse cursor is hidden.
  • Is Locked: true if the mouse cursor is locked.

Sources: Python | Haxe

Get Gamepad Started

.

Get Gamepad Started node

Sources: Python | Haxe

Get Input Map Key

Get key data if it exists in the input map.

Get Input Map Key node

Sources: Python | Haxe

Get Keyboard Started

.

Get Keyboard Started node

Sources: Python | Haxe

Get Mouse Lock (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Get Cursor State.

Deprecated. It is recommended to use the 'Get Cursor State' node instead.

Get Mouse Lock (Deprecated) node

Sources: Python | Haxe

Get Mouse Movement

Get the movement coordinates of the mouse and the mouse wheel delta. The multiplied output variants default to -1 to invert the values.

Get Mouse Movement node

Sources: Python | Haxe

Get Mouse Started

.

Get Mouse Started node

Sources: Python | Haxe

Get Mouse Visible (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Get Cursor State.

Deprecated. It is recommended to use the 'Get Cursor State' node instead.

Get Mouse Visible (Deprecated) node

Sources: Python | Haxe

Get Touch Location

Returns the location of the last touch event in screen coordinates (pixels).

Get Touch Location node

Sources: Python | Haxe

Get Touch Movement

Returns the movement values of the current touch event.

Get Touch Movement node

Sources: Python | Haxe

Keyboard

Activates the output on the given keyboard button event.

Keyboard node

Sources: Python | Haxe

Mouse

Activates the output on the given mouse event.

Mouse node

Sources: Python | Haxe

Mouse Coords (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Get Cursor Location.

Deprecated. It is recommended to use 'Get Cursor Location' node and the 'Get Mouse Movement' node instead.

Mouse Coords (Deprecated) node

Sources: Python | Haxe

On Gamepad (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Gamepad.

Deprecated. It is recommended to use the 'Gamepad' node instead.

On Gamepad (Deprecated) node

Sources: Python | Haxe

On Input Map

Send a signal if any input map key is started or released.

On Input Map node

Sources: Python | Haxe

On Keyboard (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Keyboard.

Deprecated. It is recommended to use the 'Keyboard' node instead.

On Keyboard (Deprecated) node

Sources: Python | Haxe

On Mouse (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Mouse.

Deprecated. It is recommended to use the 'Mouse' node instead.

On Mouse (Deprecated) node

Sources: Python | Haxe

On Surface (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Surface.

Deprecated. Is recommended to use the 'Surface' node instead.

On Surface (Deprecated) node

Sources: Python | Haxe

On Swipe

Activates the output on the given swipe event.

On Swipe node

Sources: Python | Haxe

On Tap Screen

Activates the output on tap screen event.

On Tap Screen node

Inputs:

  • Duration: touching time
  • Interval: interval between taps
  • Repeat: repetitions amount to validate

Outputs:

  • Done: the sequence success
  • Fail: the the sequence failure
  • Tap Number: number of the last tap
  • Coords: the coordinates of the last tap

Sources: Python | Haxe

On Virtual Button (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Virtual Button.

Deprecated. Is recommended to use 'Virtual Button' node instead.

On Virtual Button (Deprecated) node

Sources: Python | Haxe

Remove Input Map Key

Remove input map key.

Remove Input Map Key node

Sources: Python | Haxe

Sensor Coords

TO DO.

Sensor Coords node

Sources: Python | Haxe

Set Cursor State

Sets the state of the mouse cursor.

See also:

Set Cursor State node

Options:

  • Hide Locked: hide and lock or unhide and unlock the mouse cursor.
  • Hide: hide/unhide the mouse cursor.
  • Lock: lock/unlock the mouse cursor.

Sources: Python | Haxe

Set Input Map Key

Set input map key.

Set Input Map Key node

Sources: Python | Haxe

Set Mouse Lock (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Set Cursor State.

Deprecated. It is recommended to use the 'Set Cursor State' node instead.

Set Mouse Lock (Deprecated) node

Sources: Python | Haxe

Set Mouse Visible (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Set Cursor State.

Deprecated. It is recommended to use the 'Set Cursor State' node instead.

Set Mouse Visible (Deprecated) node

Sources: Python | Haxe

Surface Coords (Deprecated)

DEPRECATED. This node is deprecated and will be removed in future versions of Armory. Please use the following node(s) instead: Get Touch Movement, Get Touch Location.

Deprecated. Is recommended to use 'Get Touch Location' and 'Get Touch Movement' node instead.

Surface Coords (Deprecated) node

Sources: Python | Haxe

Touch

Activates the output on the given touch event.

Touch node

Sources: Python | Haxe

Touch In Region

Detect touch in specific region.

Touch In Region node

Inputs:

  • Center X/Y: The position of the center in pixels.
  • Width: Width of the region in pixels.
  • Height: Height of the region in pixels.
  • Angle: Rotation angle in radians. Rotation is clockwise.

Outputs:

  • On Enter: Activated after the cursor enters the region.
  • On Exit: Activated after the cursor exits the region.
  • Is Inside: True if inside the region. False otherwise.

Sources: Python | Haxe

Virtual Button

Activates the output on the given virtual button event.

Virtual Button node

Sources: Python | Haxe

Native

The Native category contains nodes which interact with the system (Input/Output functionality, etc.) or Haxe.

Call Haxe Static

Calls the given static Haxe function and optionally passes arguments to it.

Compatibility info: prior versions of this node didn't accept arguments and instead implicitly passed the current logic tree object as the first argument. In newer versions you need to pass that argument explicitly if the called function expects it.

Call Haxe Static node

Inputs:

  • Function: the full module path to the function.

Outputs:

  • Result: the result of the function.

Sources: Python | Haxe

Clear Console

Clears the system console.

Clear Console node

Sources: Python | Haxe

Detect Mobile Browser

Determines the mobile browser or not (works only for web browsers).

Detect Mobile Browser node

Sources: Python | Haxe

Expression

Evaluates a Haxe expression and returns its output.

Expression node

Outputs:

  • Result: the result of the expression.

Sources: Python | Haxe

Get Date and Time

Returns the values of the current date and time.

Get Date and Time node

Sources: Python | Haxe

Get Haxe Property

Returns a property of an Haxe object (via the Reflection API).

See also:

Get Haxe Property node

Sources: Python | Haxe

Get System Language

Returns the language of the current system.

Get System Language node

Sources: Python | Haxe

Get System Name

Returns the name of the current system.

Get System Name node

Sources: Python | Haxe

Load URL

Load the given URL in a new tab (works only for web browsers).

Load URL node

Sources: Python | Haxe

Print

Print the given value to the console.

Print node

Sources: Python | Haxe

Read File

Reads the given file and returns its content.

See also:

Read File node

Inputs:

  • File: the asset name of the file as used by Kha.
  • Use cache: if unchecked, re-read the file from disk every time the node is executed. Otherwise, cache the file after the first read and return the cached content.

Outputs:

  • Loaded: activated after the file has been read. If the file doesn't exist, the output is not activated.
  • Content: the content of the file.

Sources: Python | Haxe

Read JSON

Reads the given JSON file and returns its content.

See also:

Read JSON node

Inputs:

  • File: the asset name of the file as used by Kha.
  • Use cache: if unchecked, re-read the file from disk every time the node is executed. Otherwise, cache the file after the first read and return the cached content.

Outputs:

  • Loaded: activated after the file has been read. If the file doesn't exist, the output is not activated.
  • Dynamic: the content of the file.

Sources: Python | Haxe

Read Storage

Reads a value from the application's default storage file. Each value is uniquely identified by a key.

For a detailed explanation of the storage system, please read the documentation for the Write Storage node.

See also:

Read Storage node

Sources: Python | Haxe

Script

Executes the given script.

Script node

Sources: Python | Haxe

Set Haxe Property

Sets a property of an Haxe object (via the Reflection API).

See also:

Set Haxe Property node

Sources: Python | Haxe

Set Vibrate

Pulses the vibration hardware on the device for time in milliseconds, if such hardware exists.

Set Vibrate node

Sources: Python | Haxe

Shutdown

Closes the application.

Shutdown node

Sources: Python | Haxe

Write File

Writes the given string content to the given file. If the file already exists, the existing content of the file is overwritten.

This node is currently only implemented on Krom

See also:

Write File node

Inputs:

  • File: the name of the file, relative to Krom.getFilesLocation()
  • Content: the content to write to the file.

Sources: Python | Haxe

Write JSON

Writes the given content to the given JSON file. If the file already exists, the existing content of the file is overwritten.

This node is currently only implemented on Krom

See also:

Write JSON node

Inputs:

  • File: the name of the file, relative to Krom.getFilesLocation(), including the file extension.
  • Dynamic: the content to write to the file. Can be any type that can be serialized to JSON.

Sources: Python | Haxe

Write Storage

Writes a given value to the application's default storage file. Each value is uniquely identified by a key, which can be used to later read the value from the storage file.

Each key can only refer to one value, so writing a second value with a key that is already used overwrites the already stored value with the second value.

The location of the default storage file varies on different platforms, as implemented by the Kha storage API:

  • Windows: %USERPROFILE%/Saved Games/<application name>/default.kha
  • Linux: one of $HOME/.<application name>/default.kha, $XDG_DATA_HOME/.<application name>/default.kha or $HOME/.local/share/default.kha
  • MacOS: ~/Library/Application Support/<application name>/default.kha
  • iOS: ~/Library/Application Support/<application name>/default.kha
  • Android: <internalDataPath>/<application package name>/files/default.kha
  • HTML 5: saved in the local storage (web storage API) for the project's origin.

<application name> refers to the name set at Armory Exporter > Name, <application package name> is the generated package name on Android.

See also:

Write Storage node

Sources: Python | Haxe

Clone this wiki locally