Compare commits

..

11 Commits

Author SHA1 Message Date
Wilson E. Alvarez eb0dab6f1b
Fix unhandled PROPERTY_HINT_NO_NODEPATH warning
Due to upstream change:

	6f7525c396
2025-01-10 11:41:11 -05:00
Wilson E. Alvarez 3af5cba6d5
Override renamed EditorPlugin::get_name() method
Due to upstream change:

	0ab3dc273e
2025-01-10 11:41:11 -05:00
Wilson E. Alvarez 0a11595c02
Refactor EditorHelpBit usage
Due to upstream change:

	4e19ab8afe
2025-01-10 11:41:11 -05:00
Wilson E. Alvarez 0258d4ee0b
Fix unhandled PROPERTY_HINT_ONESHOT warning
Due to upstream change:

	761a20f7a7
2025-01-10 11:41:11 -05:00
Wilson E. Alvarez a08bc541c9
Fix forbidden comparisons between Ref and nullptr.
Necessary when compiling with strict_checks=yes.

Due to upstream change:

	df29cc696f
2025-01-10 11:41:11 -05:00
Wilson E. Alvarez 291c0d9a76
Fix internal Button set_icon calls to set_button_icon
Due to upstream change:

    562c666e3d
2025-01-10 11:41:11 -05:00
Wilson E. Alvarez d2d835bb86
Fix unhandled PROPERTY_HINT_TOOL_BUTTON warning
Due to upstream change:

	85dfd89653
2025-01-10 11:41:11 -05:00
Wilson E. Alvarez 90a2283798
Fix unhandled PROPERTY_HINT_DICTIONARY_TYPE warning
Due to upstream change:

	9853a69144
2025-01-10 11:41:11 -05:00
Wilson E. Alvarez 9a5e550504
Update EditorMainScreen calls after its extraction
Due to upstream change:

	5e1c9d68aa
2025-01-10 11:41:11 -05:00
Laurent Senta 3dcbee829c
doc: clarify scoping for BTState (#271) 2025-01-10 16:42:09 +01:00
Serhii Snitsaruk e3be34670e
Doc: Clarify how to access objects on the blackboard that may be freed 2025-01-05 20:53:53 +01:00
1 changed files with 22 additions and 4 deletions

View File

@ -34,6 +34,21 @@ Here's an example of how you can interact with the :ref:`Blackboard<class_Blackb
if blackboard.has_var(speed_var): if blackboard.has_var(speed_var):
# ... # ...
If you are accessing a variable that holds an object instance, and it is
expected that the instance may be null or freed, you can do it like this:
.. code:: gdscript
@export var object_var: StringName = &"object"
func _tick(delta: float) -> Status:
# Get object instance stored in the "object" variable.
# - Important: Avoid specifying a type for "obj" in GDScript
# to prevent errors when the instance is freed.
var obj = blackboard.get_var(object_var)
if is_instance_valid(obj):
# ...
It is recommended to suffix variable name properties with ``_var``, like in the example above, which enables the It is recommended to suffix variable name properties with ``_var``, like in the example above, which enables the
inspector to provide a more convenient property editor for the variable. This editor inspector to provide a more convenient property editor for the variable. This editor
allows you to select or add the variable to the blackboard plan, and provides a allows you to select or add the variable to the blackboard plan, and provides a
@ -107,10 +122,13 @@ This creates a "blackboard scope chain," where each :ref:`Blackboard<class_Black
and there is no limit to how many blackboards can be in this chain. and there is no limit to how many blackboards can be in this chain.
It's important to note that the :ref:`Blackboard<class_Blackboard>` doesn't modify values in the parent scopes. It's important to note that the :ref:`Blackboard<class_Blackboard>` doesn't modify values in the parent scopes.
Some scopes are created automatically. For instance, when using the :ref:`BTNewScope<class_BTNewScope>` Scopes are created automatically to prevent naming collisions between contextually separate environments:
and :ref:`BTSubtree<class_BTSubtree>` decorators, or when a :ref:`LimboState<class_LimboState>`
has non-empty blackboard plan defined, or when a root-level :ref:`LimboHSM<class_LimboHSM>` - Within :ref:`BTNewScope<class_BTNewScope>`.
node is used. Such scopes prevent naming collisions between contextually separate environments. - Under :ref:`BTSubtree<class_BTSubtree>` decorators.
- With :ref:`LimboState<class_LimboState>` that have a non-empty blackboard plan defined.
- Under :ref:`LimboHSM<class_LimboHSM>` nodes: A new scope is created at the root level,
and each :ref:`BTState<class_BTState>` child also receives its own separate scope.
Sharing data between several agents Sharing data between several agents
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~