VisualScriptCustomNode.xml 6.0 KB

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