2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 09:03:48 +08:00
<class name= "VisualScriptCustomNode" inherits= "VisualScriptNode" version= "4.0" >
2017-09-13 04:42:36 +08:00
<brief_description >
2017-09-28 18:07:20 +08:00
A scripted Visual Script node.
2017-09-13 04:42:36 +08:00
</brief_description>
<description >
2017-09-28 18:07:20 +08:00
A custom Visual Script node which can be scripted in powerful ways.
2017-09-13 04:42:36 +08:00
</description>
<tutorials >
</tutorials>
<methods >
2021-08-22 09:52:44 +08:00
<method name= "_get_caption" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the node's title.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_category" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the node's category.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_input_value_port_count" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the count of input value ports.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_input_value_port_hint" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "input_idx" type= "int" />
2021-05-22 21:19:57 +08:00
<description >
Return the specified input port's hint. See the [enum @GlobalScope.PropertyHint] hints.
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_input_value_port_hint_string" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "input_idx" type= "int" />
2021-05-22 21:19:57 +08:00
<description >
Return the specified input port's hint string.
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_input_value_port_name" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "input_idx" type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the specified input port's name.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_input_value_port_type" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "input_idx" type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2019-12-07 06:09:20 +08:00
Return the specified input port's type. See the [enum Variant.Type] values.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_output_sequence_port_count" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the amount of output [b]sequence[/b] ports.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_output_sequence_port_text" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "seq_idx" type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the specified [b]sequence[/b] output's name.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_output_value_port_count" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the amount of output value ports.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_output_value_port_hint" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "output_idx" type= "int" />
2021-05-22 21:19:57 +08:00
<description >
Return the specified output port's hint. See the [enum @GlobalScope.PropertyHint] hints.
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_output_value_port_hint_string" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "output_idx" type= "int" />
2021-05-22 21:19:57 +08:00
<description >
Return the specified output port's hint string.
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_output_value_port_name" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "output_idx" type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2021-05-22 21:19:57 +08:00
Return the specified output port's name.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_output_value_port_type" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2021-08-22 09:52:44 +08:00
<argument index= "0" name= "output_idx" type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2021-05-22 21:19:57 +08:00
Return the specified output port's type. See the [enum Variant.Type] values.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_text" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the custom node's text, which is shown right next to the input [b]sequence[/b] port (if there is none, on the place that is usually taken by it).
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_get_working_memory_size" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return the size of the custom node's working memory. See [method _step] for more details.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_has_input_sequence_port" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "bool" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
Return whether the custom node has an input [b]sequence[/b] port.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-08-22 09:52:44 +08:00
<method name= "_step" qualifiers= "virtual const" >
2021-07-30 21:28:05 +08:00
<return type= "Variant" />
<argument index= "0" name= "inputs" type= "Array" />
<argument index= "1" name= "outputs" type= "Array" />
<argument index= "2" name= "start_mode" type= "int" />
<argument index= "3" name= "working_mem" type= "Array" />
2017-09-13 04:42:36 +08:00
<description >
2017-09-28 18:07:20 +08:00
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 [code]inputs[/code] array contains the values of the input ports.
[code]outputs[/code] is an array whose indices should be set to the respective outputs.
2019-06-22 07:04:47 +08:00
The [code]start_mode[/code] is usually [constant START_MODE_BEGIN_SEQUENCE], unless you have used the [code]STEP_*[/code] constants.
2017-09-28 18:07:20 +08:00
[code]working_mem[/code] is an array which can be used to persist information between runs of the custom node.
2019-06-22 07:04:47 +08:00
When returning, you can mask the returned value with one of the [code]STEP_*[/code] constants.
2017-09-13 04:42:36 +08:00
</description>
</method>
</methods>
<constants >
2017-11-25 06:16:30 +08:00
<constant name= "START_MODE_BEGIN_SEQUENCE" value= "0" enum= "StartMode" >
2017-09-28 18:07:20 +08:00
The start mode used the first time when [method _step] is called.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "START_MODE_CONTINUE_SEQUENCE" value= "1" enum= "StartMode" >
2019-12-07 06:09:20 +08:00
The start mode used when [method _step] is called after coming back from a [constant STEP_PUSH_STACK_BIT].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "START_MODE_RESUME_YIELD" value= "2" enum= "StartMode" >
2019-12-07 06:09:20 +08:00
The start mode used when [method _step] is called after resuming from [constant STEP_YIELD_BIT].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "STEP_PUSH_STACK_BIT" value= "16777216" >
2017-09-28 18:07:20 +08:00
Hint used by [method _step] to tell that control should return to it when there is no other node left to execute.
2019-04-17 19:42:56 +08:00
This is used by [VisualScriptCondition] to redirect the sequence to the "Done" port after the [code]true[/code]/[code]false[/code] branch has finished execution.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "STEP_GO_BACK_BIT" value= "33554432" >
2019-12-07 06:09:20 +08:00
Hint used by [method _step] to tell that control should return back, either hitting a previous [constant STEP_PUSH_STACK_BIT] or exiting the function.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "STEP_NO_ADVANCE_BIT" value= "67108864" >
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "STEP_EXIT_FUNCTION_BIT" value= "134217728" >
2017-09-28 18:07:20 +08:00
Hint used by [method _step] to tell that control should stop and exit the function.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "STEP_YIELD_BIT" value= "268435456" >
2017-09-28 18:07:20 +08:00
Hint used by [method _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].
2017-09-13 04:42:36 +08:00
</constant>
</constants>
</class>