class_visualscriptfunctioncall.rst 12 KB

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