diff --git a/addons/escoria-core/game/core-scripts/behaviors/esc_movable.gd b/addons/escoria-core/game/core-scripts/behaviors/esc_movable.gd
index 42b66552..3ba07abc 100644
--- a/addons/escoria-core/game/core-scripts/behaviors/esc_movable.gd
+++ b/addons/escoria-core/game/core-scripts/behaviors/esc_movable.gd
@@ -285,7 +285,6 @@ func walk_stop(pos: Vector2) -> void:
update_terrain()
- yield(parent.get_animation_player(), "animation_finished")
if walk_context.target_object:
escoria.logger.debug(
"%s arrived at %s" % [
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd
new file mode 100644
index 00000000..648b6464
--- /dev/null
+++ b/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd
@@ -0,0 +1,45 @@
+# `set_animations object animations`
+#
+# Set the animation resource for the given ESCPlayer
+#
+# @ESC
+extends ESCBaseCommand
+class_name SetAnimationsCommand
+
+
+# Return the descriptor of the arguments of this command
+func configure() -> ESCCommandArgumentDescriptor:
+ return ESCCommandArgumentDescriptor.new(
+ 2,
+ [TYPE_STRING, TYPE_STRING],
+ [null, null]
+ )
+
+
+# Validate wether the given arguments match the command descriptor
+func validate(arguments: Array):
+ if not escoria.object_manager.objects.has(arguments[0]):
+ escoria.logger.report_errors(
+ "set_animations: invalid object",
+ [
+ "Object with global id %s not found" % arguments[0]
+ ]
+ )
+ return false
+ if not ResourceLoader.exists(arguments[1]):
+ escoria.logger.report_errors(
+ "set_animations: invalid animations",
+ [
+ "The animation resource %s was not found" % arguments[1]
+ ]
+ )
+ return false
+ return .validate(arguments)
+
+
+# Run the command
+func run(command_params: Array) -> int:
+ (escoria.object_manager.get_object(command_params[0]).node as ESCPlayer)\
+ .animations = load(command_params[1])
+ return ESCExecution.RC_OK
+
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/slide.gd b/addons/escoria-core/game/core-scripts/esc/commands/slide.gd
index 8c6ff3a3..71889656 100644
--- a/addons/escoria-core/game/core-scripts/esc/commands/slide.gd
+++ b/addons/escoria-core/game/core-scripts/esc/commands/slide.gd
@@ -5,7 +5,6 @@
# It does not respect the room's navigation polygons, so you can move items
# where the player can't walk.
#
-# @STUB
# @ESC
extends ESCBaseCommand
class_name SlideCommand
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd
index cc3abadb..d07d8789 100644
--- a/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd
+++ b/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd
@@ -5,7 +5,6 @@
# It does not respect the room's navigation polygons, so you can move items
# where the player can't walk.
#
-# @STUB
# @ESC
extends SlideCommand
class_name SlideBlockCommand
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd b/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd
index 60a360f2..327a18cb 100644
--- a/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd
+++ b/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd
@@ -10,7 +10,6 @@
# Set immediate to true to show directly switch to the direction and not
# show intermediate angles
#
-# @STUB
# @ESC
extends ESCBaseCommand
class_name TurnToCommand
diff --git a/docs/api/ESCMovable.md b/docs/api/ESCMovable.md
index c4919db3..772d254c 100644
--- a/docs/api/ESCMovable.md
+++ b/docs/api/ESCMovable.md
@@ -146,7 +146,7 @@ Walk to a given position
### walk\_stop
```gdscript
-func walk_stop(pos: Vector2) -> var
+func walk_stop(pos: Vector2) -> void
```
We have finished walking. Set the idle pose and complete
diff --git a/docs/api/SetAnimationsCommand.md b/docs/api/SetAnimationsCommand.md
new file mode 100644
index 00000000..d816e78f
--- /dev/null
+++ b/docs/api/SetAnimationsCommand.md
@@ -0,0 +1,39 @@
+
+
+# SetAnimationsCommand
+
+**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node)
+
+## Description
+
+`set_animations object animations`
+
+Set the animation resource for the given ESCPlayer
+
+@ESC
+
+## Method Descriptions
+
+### configure
+
+```gdscript
+func configure() -> ESCCommandArgumentDescriptor
+```
+
+Return the descriptor of the arguments of this command
+
+### validate
+
+```gdscript
+func validate(arguments: Array)
+```
+
+Validate wether the given arguments match the command descriptor
+
+### run
+
+```gdscript
+func run(command_params: Array) -> int
+```
+
+Run the command
\ No newline at end of file
diff --git a/docs/api/SlideBlockCommand.md b/docs/api/SlideBlockCommand.md
index 6ef4db78..6341dd83 100644
--- a/docs/api/SlideBlockCommand.md
+++ b/docs/api/SlideBlockCommand.md
@@ -13,7 +13,6 @@ object1's "speed" property, unless overridden. This command is blocking.
It does not respect the room's navigation polygons, so you can move items
where the player can't walk.
-@STUB
@ESC
## Method Descriptions
diff --git a/docs/api/SlideCommand.md b/docs/api/SlideCommand.md
index c415e48c..139c3cd4 100644
--- a/docs/api/SlideCommand.md
+++ b/docs/api/SlideCommand.md
@@ -13,7 +13,6 @@ object1's "speed" property, unless overridden. This command is non-blocking.
It does not respect the room's navigation polygons, so you can move items
where the player can't walk.
-@STUB
@ESC
## Method Descriptions
diff --git a/docs/api/TurnToCommand.md b/docs/api/TurnToCommand.md
index ed976724..b163f060 100644
--- a/docs/api/TurnToCommand.md
+++ b/docs/api/TurnToCommand.md
@@ -18,7 +18,6 @@ be between [0, 360] or an error is reported.
Set immediate to true to show directly switch to the direction and not
show intermediate angles
-@STUB
@ESC
## Method Descriptions
diff --git a/docs/esc.md b/docs/esc.md
index eceee58e..e0f4e0df 100644
--- a/docs/esc.md
+++ b/docs/esc.md
@@ -281,6 +281,9 @@ destination angle, animations are played if they're defined in animations.
object must be player or interactive. degrees must be between [0, 360] or an
error is reported.
+#### `set_animations object animations` [API-Doc](api/SetAnimationsCommand.md)
+
+Set the animation resource for the given ESCPlayer
#### `set_global name value` [API-Doc](api/SetGlobalCommand.md)
Changes the value of the global "name" with the value. Value can be "true",
@@ -318,16 +321,12 @@ character.
If `immediate` is set to true, the animation is run directly
#### `slide_block object1 object2 [speed]` [API-Doc](api/SlideBlockCommand.md)
-**This command is currently not fully implemented.**
-
Moves object1 towards the position of object2, at the speed determined by
object1's "speed" property, unless overridden. This command is blocking.
It does not respect the room's navigation polygons, so you can move items
where the player can't walk.
#### `slide object1 object2 [speed]` [API-Doc](api/SlideCommand.md)
-**This command is currently not fully implemented.**
-
Moves object1 towards the position of object2, at the speed determined by
object1's "speed" property, unless overridden. This command is non-blocking.
It does not respect the room's navigation polygons, so you can move items
@@ -347,8 +346,6 @@ Sets the position of object1 to the position of object2.
Sets the position of object1 to the position (x,y).
#### `turn_to object degrees [immediate]` [API-Doc](api/TurnToCommand.md)
-**This command is currently not fully implemented.**
-
Turns object to a degrees angle with a directions animation.
0 sets object facing forward, 90 sets it 90 degrees clockwise ("east") etc.
diff --git a/project.godot b/project.godot
index 130d3a25..3398bafd 100644
--- a/project.godot
+++ b/project.godot
@@ -395,6 +395,11 @@ _global_script_classes=[ {
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/set_angle.gd"
}, {
"base": "ESCBaseCommand",
+"class": "SetAnimationsCommand",
+"language": "GDScript",
+"path": "res://addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd"
+}, {
+"base": "ESCBaseCommand",
"class": "SetGlobalCommand",
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/set_global.gd"
@@ -567,6 +572,7 @@ _global_script_class_icons={
"SchedEventCommand": "",
"SetActiveCommand": "",
"SetAngleCommand": "",
+"SetAnimationsCommand": "",
"SetGlobalCommand": "",
"SetGlobalsCommand": "",
"SetHudVisibleCommand": "",