VisualScriptCustomNode.xml 5.9 KB

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