VisualScriptCustomNode.xml 7.1 KB

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