class_visualscriptfunctioncall.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the VisualScriptFunctionCall.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_VisualScriptFunctionCall:
  6. VisualScriptFunctionCall
  7. ========================
  8. **Inherits:** :ref:`VisualScriptNode<class_VisualScriptNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. A Visual Script node for calling a function.
  10. Description
  11. -----------
  12. ``VisualScriptFunctionCall`` is created when you add or drag and drop a function onto the Visual Script graph. It allows to tweak parameters of the call, e.g. what object the function is called on.
  13. Properties
  14. ----------
  15. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  16. | :ref:`String<class_String>` | :ref:`base_script<class_VisualScriptFunctionCall_property_base_script>` | |
  17. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  18. | :ref:`String<class_String>` | :ref:`base_type<class_VisualScriptFunctionCall_property_base_type>` | ``"Object"`` |
  19. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  20. | :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` | :ref:`basic_type<class_VisualScriptFunctionCall_property_basic_type>` | |
  21. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  22. | :ref:`CallMode<enum_VisualScriptFunctionCall_CallMode>` | :ref:`call_mode<class_VisualScriptFunctionCall_property_call_mode>` | ``0`` |
  23. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  24. | :ref:`String<class_String>` | :ref:`function<class_VisualScriptFunctionCall_property_function>` | ``""`` |
  25. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  26. | :ref:`NodePath<class_NodePath>` | :ref:`node_path<class_VisualScriptFunctionCall_property_node_path>` | |
  27. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  28. | :ref:`RPCCallMode<enum_VisualScriptFunctionCall_RPCCallMode>` | :ref:`rpc_call_mode<class_VisualScriptFunctionCall_property_rpc_call_mode>` | ``0`` |
  29. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  30. | :ref:`String<class_String>` | :ref:`singleton<class_VisualScriptFunctionCall_property_singleton>` | |
  31. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  32. | :ref:`int<class_int>` | :ref:`use_default_args<class_VisualScriptFunctionCall_property_use_default_args>` | |
  33. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  34. | :ref:`bool<class_bool>` | :ref:`validate<class_VisualScriptFunctionCall_property_validate>` | ``true`` |
  35. +---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+
  36. Enumerations
  37. ------------
  38. .. _enum_VisualScriptFunctionCall_CallMode:
  39. .. _class_VisualScriptFunctionCall_constant_CALL_MODE_SELF:
  40. .. _class_VisualScriptFunctionCall_constant_CALL_MODE_NODE_PATH:
  41. .. _class_VisualScriptFunctionCall_constant_CALL_MODE_INSTANCE:
  42. .. _class_VisualScriptFunctionCall_constant_CALL_MODE_BASIC_TYPE:
  43. .. _class_VisualScriptFunctionCall_constant_CALL_MODE_SINGLETON:
  44. enum **CallMode**:
  45. - **CALL_MODE_SELF** = **0** --- The method will be called on this :ref:`Object<class_Object>`.
  46. - **CALL_MODE_NODE_PATH** = **1** --- The method will be called on the given :ref:`Node<class_Node>` in the scene tree.
  47. - **CALL_MODE_INSTANCE** = **2** --- The method will be called on an instanced node with the given type and script.
  48. - **CALL_MODE_BASIC_TYPE** = **3** --- The method will be called on a GDScript basic type (e.g. :ref:`Vector2<class_Vector2>`).
  49. - **CALL_MODE_SINGLETON** = **4** --- The method will be called on a singleton.
  50. ----
  51. .. _enum_VisualScriptFunctionCall_RPCCallMode:
  52. .. _class_VisualScriptFunctionCall_constant_RPC_DISABLED:
  53. .. _class_VisualScriptFunctionCall_constant_RPC_RELIABLE:
  54. .. _class_VisualScriptFunctionCall_constant_RPC_UNRELIABLE:
  55. .. _class_VisualScriptFunctionCall_constant_RPC_RELIABLE_TO_ID:
  56. .. _class_VisualScriptFunctionCall_constant_RPC_UNRELIABLE_TO_ID:
  57. enum **RPCCallMode**:
  58. - **RPC_DISABLED** = **0** --- The method will be called locally.
  59. - **RPC_RELIABLE** = **1** --- The method will be called remotely.
  60. - **RPC_UNRELIABLE** = **2** --- The method will be called remotely using an unreliable protocol.
  61. - **RPC_RELIABLE_TO_ID** = **3** --- The method will be called remotely for the given peer.
  62. - **RPC_UNRELIABLE_TO_ID** = **4** --- The method will be called remotely for the given peer, using an unreliable protocol.
  63. Property Descriptions
  64. ---------------------
  65. .. _class_VisualScriptFunctionCall_property_base_script:
  66. - :ref:`String<class_String>` **base_script**
  67. +----------+------------------------+
  68. | *Setter* | set_base_script(value) |
  69. +----------+------------------------+
  70. | *Getter* | get_base_script() |
  71. +----------+------------------------+
  72. The script to be used when :ref:`call_mode<class_VisualScriptFunctionCall_property_call_mode>` is set to :ref:`CALL_MODE_INSTANCE<class_VisualScriptFunctionCall_constant_CALL_MODE_INSTANCE>`.
  73. ----
  74. .. _class_VisualScriptFunctionCall_property_base_type:
  75. - :ref:`String<class_String>` **base_type**
  76. +-----------+----------------------+
  77. | *Default* | ``"Object"`` |
  78. +-----------+----------------------+
  79. | *Setter* | set_base_type(value) |
  80. +-----------+----------------------+
  81. | *Getter* | get_base_type() |
  82. +-----------+----------------------+
  83. The base type to be used when :ref:`call_mode<class_VisualScriptFunctionCall_property_call_mode>` is set to :ref:`CALL_MODE_INSTANCE<class_VisualScriptFunctionCall_constant_CALL_MODE_INSTANCE>`.
  84. ----
  85. .. _class_VisualScriptFunctionCall_property_basic_type:
  86. - :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **basic_type**
  87. +----------+-----------------------+
  88. | *Setter* | set_basic_type(value) |
  89. +----------+-----------------------+
  90. | *Getter* | get_basic_type() |
  91. +----------+-----------------------+
  92. The type to be used when :ref:`call_mode<class_VisualScriptFunctionCall_property_call_mode>` is set to :ref:`CALL_MODE_BASIC_TYPE<class_VisualScriptFunctionCall_constant_CALL_MODE_BASIC_TYPE>`.
  93. ----
  94. .. _class_VisualScriptFunctionCall_property_call_mode:
  95. - :ref:`CallMode<enum_VisualScriptFunctionCall_CallMode>` **call_mode**
  96. +-----------+----------------------+
  97. | *Default* | ``0`` |
  98. +-----------+----------------------+
  99. | *Setter* | set_call_mode(value) |
  100. +-----------+----------------------+
  101. | *Getter* | get_call_mode() |
  102. +-----------+----------------------+
  103. ``call_mode`` determines the target object on which the method will be called. See :ref:`CallMode<enum_VisualScriptFunctionCall_CallMode>` for options.
  104. ----
  105. .. _class_VisualScriptFunctionCall_property_function:
  106. - :ref:`String<class_String>` **function**
  107. +-----------+---------------------+
  108. | *Default* | ``""`` |
  109. +-----------+---------------------+
  110. | *Setter* | set_function(value) |
  111. +-----------+---------------------+
  112. | *Getter* | get_function() |
  113. +-----------+---------------------+
  114. The name of the function to be called.
  115. ----
  116. .. _class_VisualScriptFunctionCall_property_node_path:
  117. - :ref:`NodePath<class_NodePath>` **node_path**
  118. +----------+----------------------+
  119. | *Setter* | set_base_path(value) |
  120. +----------+----------------------+
  121. | *Getter* | get_base_path() |
  122. +----------+----------------------+
  123. The node path to use when :ref:`call_mode<class_VisualScriptFunctionCall_property_call_mode>` is set to :ref:`CALL_MODE_NODE_PATH<class_VisualScriptFunctionCall_constant_CALL_MODE_NODE_PATH>`.
  124. ----
  125. .. _class_VisualScriptFunctionCall_property_rpc_call_mode:
  126. - :ref:`RPCCallMode<enum_VisualScriptFunctionCall_RPCCallMode>` **rpc_call_mode**
  127. +-----------+--------------------------+
  128. | *Default* | ``0`` |
  129. +-----------+--------------------------+
  130. | *Setter* | set_rpc_call_mode(value) |
  131. +-----------+--------------------------+
  132. | *Getter* | get_rpc_call_mode() |
  133. +-----------+--------------------------+
  134. The mode for RPC calls. See :ref:`Node.rpc<class_Node_method_rpc>` for more details and :ref:`RPCCallMode<enum_VisualScriptFunctionCall_RPCCallMode>` for available options.
  135. ----
  136. .. _class_VisualScriptFunctionCall_property_singleton:
  137. - :ref:`String<class_String>` **singleton**
  138. +----------+----------------------+
  139. | *Setter* | set_singleton(value) |
  140. +----------+----------------------+
  141. | *Getter* | get_singleton() |
  142. +----------+----------------------+
  143. The singleton to call the method on. Used when :ref:`call_mode<class_VisualScriptFunctionCall_property_call_mode>` is set to :ref:`CALL_MODE_SINGLETON<class_VisualScriptFunctionCall_constant_CALL_MODE_SINGLETON>`.
  144. ----
  145. .. _class_VisualScriptFunctionCall_property_use_default_args:
  146. - :ref:`int<class_int>` **use_default_args**
  147. +----------+-----------------------------+
  148. | *Setter* | set_use_default_args(value) |
  149. +----------+-----------------------------+
  150. | *Getter* | get_use_default_args() |
  151. +----------+-----------------------------+
  152. Number of default arguments that will be used when calling the function. Can't be higher than the number of available default arguments in the method's declaration.
  153. ----
  154. .. _class_VisualScriptFunctionCall_property_validate:
  155. - :ref:`bool<class_bool>` **validate**
  156. +-----------+---------------------+
  157. | *Default* | ``true`` |
  158. +-----------+---------------------+
  159. | *Setter* | set_validate(value) |
  160. +-----------+---------------------+
  161. | *Getter* | get_validate() |
  162. +-----------+---------------------+
  163. If ``false``, call errors (e.g. wrong number of arguments) will be ignored.
  164. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  165. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  166. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`