class VisualScriptCustomNode
package godot
extends VisualScriptNode › Resource › Reference › Object
A custom Visual Script node which can be scripted in powerful ways.
Static variables
staticread onlySTEP_EXIT_FUNCTION_BIT:Int
Hint used by godot.VisualScriptCustomNode._Step
to tell that control should stop and exit the function.
staticread onlySTEP_GO_BACK_BIT:Int
Hint used by godot.VisualScriptCustomNode._Step
to tell that control should return back, either hitting a previous godot.VisualScriptCustomNode.stepPushStackBit
or exiting the function.
staticread onlySTEP_PUSH_STACK_BIT:Int
Hint used by godot.VisualScriptCustomNode._Step
to tell that control should return to it when there is no other node left to execute.
This is used by godot.VisualScriptCondition
to redirect the sequence to the "Done" port after the true
/false
branch has finished execution.
staticread onlySTEP_YIELD_BIT:Int
Hint used by godot.VisualScriptCustomNode._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 godot.VisualScriptFunctionState
.
Constructor
Methods
_GetInputValuePortHint(idx:Int):Int
Return the specified input port's hint. See the godot.PropertyHint
hints.
_GetInputValuePortType(idx:Int):Int
Return the specified input port's type. See the godot.Variant_Type
values.
_GetOutputValuePortHint(idx:Int):Int
Return the specified output port's hint. See the godot.PropertyHint
hints.
_GetOutputValuePortType(idx:Int):Int
Return the specified output port's type. See the godot.Variant_Type
values.
_GetText():String
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).
_GetWorkingMemorySize():Int
Return the size of the custom node's working memory. See godot.VisualScriptCustomNode._Step
for more details.
_Step(inputs:Array, outputs:Array, startMode:Int, workingMem:Array):Dynamic
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 godot.VisualScriptCustomNode_StartMode.beginSequence
, 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 godot.VisualScriptCustomNode._GetWorkingMemorySize
.
When returning, you can mask the returned value with one of the STEP_*
constants.