diff --git a/doc/source/getting-started/accessing-nodes.rst b/doc/source/getting-started/accessing-nodes.rst index 6774f93..11d8f00 100644 --- a/doc/source/getting-started/accessing-nodes.rst +++ b/doc/source/getting-started/accessing-nodes.rst @@ -40,7 +40,7 @@ and point it to the proper node in the :ref:`BTPlayer` blackboar extends BTCondition - @export var shape_var: String = "shape_cast" + @export var shape_var: StringName = &"shape_cast" func _tick(delta) -> Status: var shape_cast: ShapeCast3D = blackboard.get_var(shape_var) diff --git a/doc/source/getting-started/custom-tasks.rst b/doc/source/getting-started/custom-tasks.rst index 77b3fb1..ba3a9c6 100644 --- a/doc/source/getting-started/custom-tasks.rst +++ b/doc/source/getting-started/custom-tasks.rst @@ -110,7 +110,7 @@ Example 2: InRange condition @export var distance_min: float @export var distance_max: float - @export var target_var := "target" + @export var target_var: StringName = &"target" var _min_distance_squared: float var _max_distance_squared: float diff --git a/doc/source/getting-started/hsm.rst b/doc/source/getting-started/hsm.rst index 8edcec9..107e73e 100644 --- a/doc/source/getting-started/hsm.rst +++ b/doc/source/getting-started/hsm.rst @@ -76,7 +76,7 @@ To register a transition and associate it with a specific event, you can use the .. code:: gdscript - hsm.add_transition(idle_state, move_state, "movement_started") + hsm.add_transition(idle_state, move_state, &"movement_started") In this example, we're registering a transition from the ``idle_state`` to the ``move_state`` when the ``movement_started`` event is dispatched. @@ -85,7 +85,7 @@ A transition can be also associated with no particular starting state: .. code:: gdscript - hsm.add_transition(hsm.ANYSTATE, move_state, "movement_started") + hsm.add_transition(hsm.ANYSTATE, move_state, &"movement_started") **Events are dispatched** with the :ref:`LimboState.dispatch` method. It's important to note that this method can be called from anywhere in the state machine hierarchy and outside of it. @@ -187,8 +187,8 @@ Let's illustrate this with a practical code example: hsm.add_child(idle_state) hsm.add_child(move_state) - hsm.add_transition(idle_state, move_state, "movement_started") - hsm.add_transition(move_state, idle_state, "movement_ended") + hsm.add_transition(idle_state, move_state, &"movement_started") + hsm.add_transition(move_state, idle_state, &"movement_ended") hsm.initialize(self) hsm.set_active(true) @@ -198,7 +198,7 @@ Let's illustrate this with a practical code example: var dir: Vector2 = Input.get_vector( &"ui_left", &"ui_right", &"ui_up", &"ui_down") if dir.is_zero_approx(): - hsm.dispatch("movement_started") + hsm.dispatch(&"movement_started") func _move_update(delta: float) -> void: @@ -208,4 +208,4 @@ Let's illustrate this with a practical code example: velocity = desired_velocity move_and_slide() if desired_velocity.is_zero_approx(): - hsm.dispatch("movement_ended") + hsm.dispatch(&"movement_ended") diff --git a/doc/source/getting-started/using-blackboard.rst b/doc/source/getting-started/using-blackboard.rst index cb3665b..8ffa205 100644 --- a/doc/source/getting-started/using-blackboard.rst +++ b/doc/source/getting-started/using-blackboard.rst @@ -19,7 +19,7 @@ Here's an example of how you can interact with the :ref:`Blackboard Status: # Set the value of the "speed" variable: @@ -114,7 +114,7 @@ In the following example, we have a group of agents, and we want to share a comm extends BTAction - @export var group_target_var: String = "group_target" + @export var group_target_var: StringName = &"group_target" func _tick(delta: float) -> Status: if not blackboard.has_var(group_target_var):