VisualScriptCustomNode.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VisualScriptCustomNode" inherits="VisualScriptNode" version="3.3">
  3. <brief_description>
  4. A scripted Visual Script node.
  5. </brief_description>
  6. <description>
  7. A custom Visual Script node which can be scripted in powerful ways.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="_get_caption" qualifiers="virtual">
  13. <return type="String" />
  14. <description>
  15. Return the node's title.
  16. </description>
  17. </method>
  18. <method name="_get_category" qualifiers="virtual">
  19. <return type="String" />
  20. <description>
  21. Return the node's category.
  22. </description>
  23. </method>
  24. <method name="_get_input_value_port_count" qualifiers="virtual">
  25. <return type="int" />
  26. <description>
  27. Return the count of input value ports.
  28. </description>
  29. </method>
  30. <method name="_get_input_value_port_name" qualifiers="virtual">
  31. <return type="String" />
  32. <argument index="0" name="idx" type="int" />
  33. <description>
  34. Return the specified input port's name.
  35. </description>
  36. </method>
  37. <method name="_get_input_value_port_type" qualifiers="virtual">
  38. <return type="int" />
  39. <argument index="0" name="idx" type="int" />
  40. <description>
  41. Return the specified input port's type. See the [enum Variant.Type] values.
  42. </description>
  43. </method>
  44. <method name="_get_output_sequence_port_count" qualifiers="virtual">
  45. <return type="int" />
  46. <description>
  47. Return the amount of output [b]sequence[/b] ports.
  48. </description>
  49. </method>
  50. <method name="_get_output_sequence_port_text" qualifiers="virtual">
  51. <return type="String" />
  52. <argument index="0" name="idx" type="int" />
  53. <description>
  54. Return the specified [b]sequence[/b] output's name.
  55. </description>
  56. </method>
  57. <method name="_get_output_value_port_count" qualifiers="virtual">
  58. <return type="int" />
  59. <description>
  60. Return the amount of output value ports.
  61. </description>
  62. </method>
  63. <method name="_get_output_value_port_name" qualifiers="virtual">
  64. <return type="String" />
  65. <argument index="0" name="idx" type="int" />
  66. <description>
  67. Return the specified output's name.
  68. </description>
  69. </method>
  70. <method name="_get_output_value_port_type" qualifiers="virtual">
  71. <return type="int" />
  72. <argument index="0" name="idx" type="int" />
  73. <description>
  74. Return the specified output's type. See the [enum Variant.Type] values.
  75. </description>
  76. </method>
  77. <method name="_get_text" qualifiers="virtual">
  78. <return type="String" />
  79. <description>
  80. 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).
  81. </description>
  82. </method>
  83. <method name="_get_working_memory_size" qualifiers="virtual">
  84. <return type="int" />
  85. <description>
  86. Return the size of the custom node's working memory. See [method _step] for more details.
  87. </description>
  88. </method>
  89. <method name="_has_input_sequence_port" qualifiers="virtual">
  90. <return type="bool" />
  91. <description>
  92. Return whether the custom node has an input [b]sequence[/b] port.
  93. </description>
  94. </method>
  95. <method name="_step" qualifiers="virtual">
  96. <return type="Variant" />
  97. <argument index="0" name="inputs" type="Array" />
  98. <argument index="1" name="outputs" type="Array" />
  99. <argument index="2" name="start_mode" type="int" />
  100. <argument index="3" name="working_mem" type="Array" />
  101. <description>
  102. Execute the custom node's logic, returning the index of the output sequence port to use or a [String] when there is an error.
  103. The [code]inputs[/code] array contains the values of the input ports.
  104. [code]outputs[/code] is an array whose indices should be set to the respective outputs.
  105. The [code]start_mode[/code] is usually [constant START_MODE_BEGIN_SEQUENCE], unless you have used the [code]STEP_*[/code] constants.
  106. [code]working_mem[/code] is an array which can be used to persist information between runs of the custom node. The size needs to be predefined using [method _get_working_memory_size].
  107. When returning, you can mask the returned value with one of the [code]STEP_*[/code] constants.
  108. </description>
  109. </method>
  110. </methods>
  111. <constants>
  112. <constant name="START_MODE_BEGIN_SEQUENCE" value="0" enum="StartMode">
  113. The start mode used the first time when [method _step] is called.
  114. </constant>
  115. <constant name="START_MODE_CONTINUE_SEQUENCE" value="1" enum="StartMode">
  116. The start mode used when [method _step] is called after coming back from a [constant STEP_PUSH_STACK_BIT].
  117. </constant>
  118. <constant name="START_MODE_RESUME_YIELD" value="2" enum="StartMode">
  119. The start mode used when [method _step] is called after resuming from [constant STEP_YIELD_BIT].
  120. </constant>
  121. <constant name="STEP_PUSH_STACK_BIT" value="16777216">
  122. Hint used by [method _step] to tell that control should return to it when there is no other node left to execute.
  123. 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.
  124. </constant>
  125. <constant name="STEP_GO_BACK_BIT" value="33554432">
  126. 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.
  127. </constant>
  128. <constant name="STEP_NO_ADVANCE_BIT" value="67108864">
  129. </constant>
  130. <constant name="STEP_EXIT_FUNCTION_BIT" value="134217728">
  131. Hint used by [method _step] to tell that control should stop and exit the function.
  132. </constant>
  133. <constant name="STEP_YIELD_BIT" value="268435456">
  134. Hint used by [method _step] to tell that the function should be yielded.
  135. Using this requires you to have at least one working memory slot, which is used for the [VisualScriptFunctionState].
  136. </constant>
  137. </constants>
  138. </class>