VisualScriptCustomNode

Inherits: VisualScriptNode < Resource < RefCounted < Object

A scripted Visual Script node.

Description

A custom Visual Script node which can be scripted in powerful ways.

Methods

String

_get_caption ( ) virtual const

String

_get_category ( ) virtual const

int

_get_input_value_port_count ( ) virtual const

int

_get_input_value_port_hint ( int input_idx ) virtual const

String

_get_input_value_port_hint_string ( int input_idx ) virtual const

String

_get_input_value_port_name ( int input_idx ) virtual const

int

_get_input_value_port_type ( int input_idx ) virtual const

int

_get_output_sequence_port_count ( ) virtual const

String

_get_output_sequence_port_text ( int seq_idx ) virtual const

int

_get_output_value_port_count ( ) virtual const

int

_get_output_value_port_hint ( int output_idx ) virtual const

String

_get_output_value_port_hint_string ( int output_idx ) virtual const

String

_get_output_value_port_name ( int output_idx ) virtual const

int

_get_output_value_port_type ( int output_idx ) virtual const

String

_get_text ( ) virtual const

int

_get_working_memory_size ( ) virtual const

bool

_has_input_sequence_port ( ) virtual const

Variant

_step ( Array inputs, Array outputs, int start_mode, Array working_mem ) virtual const

Enumerations

enum StartMode:

  • START_MODE_BEGIN_SEQUENCE = 0 --- The start mode used the first time when _step is called.

  • START_MODE_CONTINUE_SEQUENCE = 1 --- The start mode used when _step is called after coming back from a STEP_PUSH_STACK_BIT.

  • START_MODE_RESUME_YIELD = 2 --- The start mode used when _step is called after resuming from STEP_YIELD_BIT.

Constants

  • STEP_PUSH_STACK_BIT = 16777216 --- Hint used by _step to tell that control should return to it when there is no other node left to execute.

This is used by VisualScriptCondition to redirect the sequence to the "Done" port after the true/false branch has finished execution.

  • STEP_GO_BACK_BIT = 33554432 --- Hint used by _step to tell that control should return back, either hitting a previous STEP_PUSH_STACK_BIT or exiting the function.

  • STEP_NO_ADVANCE_BIT = 67108864

  • STEP_EXIT_FUNCTION_BIT = 134217728 --- Hint used by _step to tell that control should stop and exit the function.

  • STEP_YIELD_BIT = 268435456 --- Hint used by _step to tell that the function should be yielded.

Using this requires you to have at least one working memory slot, which is used for the VisualScriptFunctionState.

Method Descriptions

  • String _get_caption ( ) virtual const

Return the node's title.


  • String _get_category ( ) virtual const

Return the node's category.


  • int _get_input_value_port_count ( ) virtual const

Return the count of input value ports.


  • int _get_input_value_port_hint ( int input_idx ) virtual const

Return the specified input port's hint. See the PropertyHint hints.


  • String _get_input_value_port_hint_string ( int input_idx ) virtual const

Return the specified input port's hint string.


  • String _get_input_value_port_name ( int input_idx ) virtual const

Return the specified input port's name.


  • int _get_input_value_port_type ( int input_idx ) virtual const

Return the specified input port's type. See the Variant.Type values.


  • int _get_output_sequence_port_count ( ) virtual const

Return the amount of output sequence ports.


  • String _get_output_sequence_port_text ( int seq_idx ) virtual const

Return the specified sequence output's name.


  • int _get_output_value_port_count ( ) virtual const

Return the amount of output value ports.


  • int _get_output_value_port_hint ( int output_idx ) virtual const

Return the specified output port's hint. See the PropertyHint hints.


  • String _get_output_value_port_hint_string ( int output_idx ) virtual const

Return the specified output port's hint string.


  • String _get_output_value_port_name ( int output_idx ) virtual const

Return the specified output port's name.


  • int _get_output_value_port_type ( int output_idx ) virtual const

Return the specified output port's type. See the Variant.Type values.


  • String _get_text ( ) virtual const

Return the custom node's text, which is shown right next to the input sequence port (if there is none, on the place that is usually taken by it).


  • int _get_working_memory_size ( ) virtual const

Return the size of the custom node's working memory. See _step for more details.


  • bool _has_input_sequence_port ( ) virtual const

Return whether the custom node has an input sequence port.


Execute the custom node's logic, returning the index of the output sequence port to use or a String when there is an error.

The inputs array contains the values of the input ports.

outputs is an array whose indices should be set to the respective outputs.

The start_mode is usually START_MODE_BEGIN_SEQUENCE, unless you have used the STEP_* constants.

working_mem is an array which can be used to persist information between runs of the custom node. The size needs to be predefined using _get_working_memory_size.

When returning, you can mask the returned value with one of the STEP_* constants.