documentation: Fixes to command descriptions (#506)

Co-authored-by: Duncan Brown <duncan@prometheussoftware.ca>
Co-authored-by: Balloonpopper <balloonpopper@git.com>
This commit is contained in:
balloonpopper
2022-03-11 09:05:27 +11:00
committed by GitHub
parent 28e95cc687
commit 0a45140fad
56 changed files with 177 additions and 120 deletions

View File

@@ -1,20 +1,21 @@
# `accept_input [type]` # `accept_input [type]`
# #
# Sets how much input the game is to accept, allowing for cut scenes # Sets how much input the game is to accept. This allows for cut scenes
# in which dialog can be skipped (if [type] is set to SKIP). # in which dialogue can be skipped (if [type] is set to SKIP), and ones where
# Also allows for cut scenes that can be completely locked down. # it can't (if [type] is set to NONE).
# #
# **Parameters** # **Parameters**
# #
# - *type*: Type of inputs to accept (ALL) # - *type*: Type of inputs to accept (ALL)
# `ALL`: Accept all types of input # `ALL`: Accept all types of user input
# `SKIP`: Accept skipping dialogs but nothing else # `SKIP`: Accept skipping dialogues but nothing else
# `NONE`: Deny all inputs (including opening menus) # `NONE`: Deny all inputs (including opening menus)
# #
# **Warning**: `SKIP` and `NONE` also disable autosaves. # **Warning**: `SKIP` and `NONE` also disable autosaves.
# #
# **Warning**: The type of input accepted will persist even after the current # **Warning**: The type of user input accepted will persist even after the
# event has ended. # current event has ended. Remember to reset the input type at the end of
# cut-scenes!
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand
@@ -30,7 +31,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not arguments[0] in ["ALL", "NONE", "SKIP"]: if not arguments[0] in ["ALL", "NONE", "SKIP"]:
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,8 +1,8 @@
# `anim object name [reverse]` # `anim object name [reverse]`
# #
# Executes the animation specified in "name" on "object", # Executes the animation specified in "name" on "object" without blocking.
# without blocking. The next command in the event will be executed immediately # The next command in the event will be executed immediately after the
# after. # animation is started.
# #
# **Parameters** # **Parameters**
# #
@@ -24,7 +24,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,8 +1,9 @@
# `anim_block object name [reverse]` # `anim_block object name [reverse]`
# #
# Executes the animation specified in "name" on "object", # Executes the animation specified in "name" on "object" while blocking other
# while blocking. The next command in the event will be executed when the animation # events from starting.
# is finished playing. # The next command in the event will be executed when the animation is
# finished playing.
# #
# **Parameters** # **Parameters**
# #
@@ -24,7 +25,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,6 +1,8 @@
# `camera_push target [time] [type]` # `camera_push target [time] [type]`
# #
# Pushes the camera to point at a specific `target`. # Pushes (moves) the camera so it points at a specific `target`. If the camera
# was following a target (like the player) previously, it will no longer follow
# this target.
# #
# **Parameters** # **Parameters**
# #
@@ -13,7 +15,7 @@
# Supported transitions include the names of the values used # Supported transitions include the names of the values used
# in the "TransitionType" enum of the "Tween" type (without the "TRANS_" prefix): # in the "TransitionType" enum of the "Tween" type (without the "TRANS_" prefix):
# #
# https://docs.godotengine.org/en/stable/classes/class_tween.html?highlight=tween#enumerations # See https://docs.godotengine.org/en/stable/classes/class_tween.html?highlight=tween#enumerations
# #
# For more details see: https://docs.escoria-framework.org/camera # For more details see: https://docs.escoria-framework.org/camera
# #
@@ -35,7 +37,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,10 +1,14 @@
# `camera_set_limits camlimits_id` # `camera_set_limits camlimits_id`
# #
# Activates the current camera's limits # Limits the current camera's movement to a limit defined in the `ESCRoom`'s
# definition. A limit is defined as an upper-left (x, y) coordinate, a width
# and a height that the camera must stay within. Multiple limits can be
# defined for a room, allowing for new areas to be seen once they have
# been 'unlocked'.
# #
# **Parameters** # **Parameters**
# #
# - *camlimits_id*: Index of the camera limit in the `camera limits` # - *camlimits_id*: Index of the camera limit defined in the `camera limits`
# list of the current `ESCRoom` # list of the current `ESCRoom`
# #
# For more details see: https://docs.escoria-framework.org/camera # For more details see: https://docs.escoria-framework.org/camera
@@ -23,7 +27,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if escoria.main.current_scene.camera_limits.size() < arguments[0]: if escoria.main.current_scene.camera_limits.size() < arguments[0]:
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,6 +1,6 @@
# `camera_set_pos time x y` # `camera_set_pos time x y`
# #
# Moves the camera to the given position. # Moves the camera to the given absolute position over a time period.
# #
# **Parameters** # **Parameters**
# #

View File

@@ -1,10 +1,13 @@
# `camera_set_target time object` # `camera_set_target time object`
# #
# Configures the camera to follow the specified target `object` # Configures the camera to follow the specified target `object` as it moves
# around the current room. The transition to focus on the `object` will happen
# over a time period.
# #
# **Parameters** # **Parameters**
# #
# - *time*: Number of seconds the transition should take # - *time*: Number of seconds the transition should take to move the camera
# to follow `object`
# - *object*: Global ID of the target object # - *object*: Global ID of the target object
# #
# For more details see: https://docs.escoria-framework.org/camera # For more details see: https://docs.escoria-framework.org/camera
@@ -23,7 +26,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[1]): if not escoria.object_manager.objects.has(arguments[1]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,8 +1,10 @@
# `camera_set_zoom magnitude [time]` # `camera_set_zoom magnitude [time]`
# #
# Zooms the camera in/out to the desired `magnitude`. Values larger than 1 zoom # Zooms the camera in/out to the desired `magnitude`. Values larger than '1' zoom
# the camera out while smaller values zoom in, relative to the default value # the camera out while smaller values zoom in. These values are relative to the
# of 1. # default zoom value of '1', not the current value. As such, while using a value
# of '0.5' would double the size of the graphics, running the same command again
# would result in no change. The zoom will happen over the given time period.
# #
# **Parameters** # **Parameters**
# #

View File

@@ -1,6 +1,6 @@
# `camera_set_zoom_height pixels [time]` # `camera_set_zoom_height pixels [time]`
# #
# Zooms the camera in/out so it occupies the given height in pixels # Zooms the camera in/out so it occupies the given height in pixels.
# #
# **Parameters** # **Parameters**
# #
@@ -24,7 +24,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if arguments[0] < 0: if arguments[0] < 0:
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,6 +1,7 @@
# `camera_shift x y [time] [type]` # `camera_shift x y [time] [type]`
# #
# Shifts the camera by the given horizontal and vertical amounts. # Shifts the camera by the given horizontal and vertical amounts relative to the
# current location.
# #
# **Parameters** # **Parameters**
# #

View File

@@ -1,6 +1,8 @@
# `change_scene path [enable_automatic_transition] [run_events]` # `change_scene path [enable_automatic_transition] [run_events]`
# #
# Switches the current scene to another scene # Switches the game from the current scene to another scene. Use this to move
# the player to a new room when they walk through an unlocked door, for
# example.
# #
# **Parameters** # **Parameters**
# #
@@ -23,7 +25,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array) -> bool: func validate(arguments: Array) -> bool:
if not ResourceLoader.exists(arguments[0]): if not ResourceLoader.exists(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,13 +1,15 @@
# `custom object node func_name [params]` # `custom object node func_name [params]`
# #
# Calls the given Godot function on a (child) node of a registered `ESCitem`. #
# Executes the specified Godot function. This function must be in a script
# attached to a child node of a registered `ESCitem`.
# #
# **Parameters** # **Parameters**
# #
# - *object*: Global ID of the target `ESCItem` # - *object*: Global ID of the target `ESCItem`
# - *node*: Name of the child node of the target `ESCItem` # - *node*: Name of the child node of the target `ESCItem`
# - *func_name*: Name of the function to be called # - *func_name*: Name of the function to be called
# - *params*: Any primitive, non-array arguments for the function. Multiple # - params: Any arguments to be passed to the function (array and object parameters are not supported). Multiple
# parameters can be passed by using comma-separated values inside a string # parameters can be passed by using comma-separated values inside a string
# #
# @ESC # @ESC
@@ -24,7 +26,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -21,7 +21,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.globals_manager.get_global(arguments[0]) is int: if not escoria.globals_manager.get_global(arguments[0]) is int:
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,7 +1,10 @@
# `enable_terrain node_name` # `enable_terrain node_name`
# #
# Enables the `ESCTerrain`'s `NavigationPolygonInstance` defined by the given node name. # Enables the `ESCTerrain`'s `NavigationPolygonInstance` specified by the given
# Disables previously-activated `NavigationPolygonInstance`. # node name. It will also disable the previously-activated
# `NavigationPolygonInstance`.
# Use this to change where the player can walk, allowing them to walk into the
# next room once a door has been opened, for example.
# #
# **Parameters** # **Parameters**
# #

View File

@@ -1,10 +1,17 @@
# `hide_menu menu_type [enable_automatic_transition]` # `hide_menu menu_type [enable_automatic_transition]`
# #
# Hides either the main menu or the pause menu. # Hides either the main menu or the pause menu. The enable_automatic_transition
# # parameter can be used to specify if Escoria manages the graphical transition
# for you or not.
# Setting `enable_automatic_transition` to false allows you to manage the
# transition effect for your room as it transitions in and out. Place a
# `transition` command in the room's `setup` event to manage the look of the
# transition in, and in the room's `exit_scene` event to manage the look of the
# transition out.
#
# **Parameters** # **Parameters**
# #
# - *menu_type*: Type of menu to hide. Can be either `main` or `pause` (default: `main`) # - *menu_type*: Which menu to hide. Can be either `main` or `pause` (default: `main`)
# - *enable_automatic_transition*: Whether to automatically transition from the menu (default: `false`) # - *enable_automatic_transition*: Whether to automatically transition from the menu (default: `false`)
# #
# @ESC # @ESC
@@ -21,7 +28,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not arguments[0] in ["main", "pause"]: if not arguments[0] in ["main", "pause"]:
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -21,7 +21,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.globals_manager.has(arguments[0]): if not escoria.globals_manager.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,6 +1,8 @@
# `inventory_add item` # `inventory_add item`
# #
# Adds an item to the inventory. # Adds an item to the inventory. If the player is picking up an object, you may
# want to use this command in conjunction with the `set_active` command so that
# the object 'disappears' from the scene as it's added to the inventory.
# #
# **Parameters** # **Parameters**
# #

View File

@@ -1,6 +1,8 @@
# `inventory_remove item` # `inventory_remove item`
# #
# Removes an item from the inventory # Removes an item from the inventory. You may wish to use this command in
# conjuction with the `set_active` command to show an item in the scene,
# simulating placing the item somewhere, for example.
# #
# **Parameters** # **Parameters**
# #

View File

@@ -1,6 +1,6 @@
# `play_snd file [player]` # `play_snd file [player]`
# #
# Plays the specified sound without blocking the event. # Plays the specified sound without blocking the currently running event.
# #
# **Parameters** # **Parameters**
# #
@@ -23,7 +23,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.has(arguments[1]): if not escoria.object_manager.has(arguments[1]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,6 +1,6 @@
# `queue_event object event [channel] [block]` # `queue_event object event [channel] [block]`
# #
# Queue another event to run # Queue an event to run.
# #
# **Parameters** # **Parameters**
# #
@@ -25,7 +25,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -22,7 +22,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array) -> bool: func validate(arguments: Array) -> bool:
if not ResourceLoader.exists(arguments[0]): if not ResourceLoader.exists(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -21,7 +21,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.globals_manager.has(arguments[0]): if not escoria.globals_manager.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,7 +1,8 @@
# `say player text [type]` # `say player text [type]`
# #
# Displays the specified string as dialog spoken by the player. Blocks execution # Displays the specified string as dialog spoken by the player. This command
# until the dialog has finished playing. # blocks further event execution until the dialog has finished being 'said'
# (either as displayed text or as audible speech from a file).
# #
# **Parameters** # **Parameters**
# #
@@ -38,7 +39,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,9 +1,9 @@
# `sched_event time object event` # `sched_event time object event`
# #
# Schedules the execution to run at a later time. # Schedules an event to run at a later time.
# #
# If another event is already running when the scheduled # If another event is already running when the scheduled
# event is to start, execution of the scheduled event # event is supposed to start, execution of the scheduled event
# begins when the already-running event ends. # begins when the already-running event ends.
# #
# **Parameters** # **Parameters**
@@ -26,7 +26,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.has(arguments[1]): if not escoria.object_manager.has(arguments[1]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,12 +1,12 @@
# `set_active object active` # `set_active object active`
# #
# Changes the "active" state of the object. `active` can be `true` or `false`. # Changes the "active" state of the object.
# Inactive objects are invisible in the room. # Inactive objects are invisible in the room.
# #
# **Parameters** # **Parameters**
# #
# - *object* Global ID of the object # - *object* Global ID of the object
# - *active* Whether `object` should be active. # - *active* Whether `object` should be active. `active` can be `true` or `false`.
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand
@@ -22,7 +22,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,6 +1,9 @@
# `set_angle object degrees [wait]` # `set_angle object degrees [wait]`
# #
# Turns a movable `ESCItem` or `ESCPlayer`. # Turns a movable `ESCItem` or `ESCPlayer` to face a given angle.
# Angles 0 and 360 are the same and correspond to UP/NORTH,
# 90 is RIGHT/EAST, 180 is DOWN/SOUTH, 270 is LEFT/WEST etc.
# #
# **Parameters** # **Parameters**
# #
@@ -24,7 +27,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -21,7 +21,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -5,7 +5,8 @@
# **Parameters** # **Parameters**
# #
# - *name*: Name of the global # - *name*: Name of the global
# - *value*: Value to set (can be of type string, boolean, integer or float) # - *value*: Value to set the global to (can be of type string, boolean, integer
# or float)
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand

View File

@@ -1,10 +1,10 @@
# `set_gui_visible visible` # `set_gui_visible visible`
# #
# Shows or hide the GUI. # Show or hide the GUI.
# #
# **Parameters** # **Parameters**
# #
# - *visible*: Whether the GUI should be visible # - *visible*: Whether the GUI should be visible (`true` or `false`)
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand

View File

@@ -1,6 +1,6 @@
# `set_interactive object interactive` # `set_interactive object interactive`
# #
# Sets whether an object should be interactive. # Sets whether an object is interactive.
# #
# **Parameters** # **Parameters**
# #
@@ -21,7 +21,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -5,7 +5,7 @@
# **Parameters** # **Parameters**
# #
# - *object*: Global ID of the `ESCPlayer` or movable `ESCItem` # - *object*: Global ID of the `ESCPlayer` or movable `ESCItem`
# - *speed*: Speed value for `object` # - *speed*: Speed value for `object` in pixels per second.
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand
@@ -20,7 +20,7 @@ func configure() -> ESCCommandArgumentDescriptor:
[null, null] [null, null]
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -28,7 +28,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,10 +1,14 @@
# `show_menu menu_type [enable_automatic_transition]` # `show_menu menu_type [enable_automatic_transition]`
# #
# Shows either the main menu or the pause menu. # Shows either the main menu or the pause menu. The enable_automatic_transition
# parameter can be used to specify if Escoria manages the graphical transition to
# the menu or not. If set to false, you can manage the transition yourself
# instead (if you want to change the transition type from the default for
# example) using the `transition` command.
# #
# **Parameters** # **Parameters**
# #
# - *menu_type*: Type of menu to hide. Can be either `main` or `pause` (default: `main`) # - *menu_type*: Which menu to show. Can be either `main` or `pause` (default: `main`)
# - *enable_automatic_transition*: Whether to automatically transition to the menu (default: `false`) # - *enable_automatic_transition*: Whether to automatically transition to the menu (default: `false`)
# #
# @ESC # @ESC
@@ -21,7 +25,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not arguments[0] in ["main", "pause"]: if not arguments[0] in ["main", "pause"]:
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -5,7 +5,8 @@
# #
# - *object*: Global ID of the object to move # - *object*: Global ID of the object to move
# - *target*: Global ID of the target object # - *target*: Global ID of the target object
# - *speed*: Movement speed (default: the default speed of `object`) # - *speed*: The speed at which to slide in pixels per second (will default to
# the speed configured on the `object`)
# #
# **Warning** This command does not respect the room's navigation polygons, so # **Warning** This command does not respect the room's navigation polygons, so
# `object` can be moved even when outside walkable areas. # `object` can be moved even when outside walkable areas.
@@ -28,7 +29,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(
@@ -53,9 +54,11 @@ func validate(arguments: Array):
# #
# #### Parameters # #### Parameters
# #
# - source: The item to slide # - *source*: The item to slide
# - destination: The destination item to slide to # - *destination*: The destination item to slide to
# - speed: The speed at which to slide (will default to the # - *speed*: The speed at which to slide in pixels per second (will default to
# the speed configured on the `object`)
#
# #
# **Returns** The generated (and started) tween # **Returns** The generated (and started) tween
func _slide_object( func _slide_object(

View File

@@ -5,7 +5,8 @@
# #
# - *object*: Global ID of the object to move # - *object*: Global ID of the object to move
# - *target*: Global ID of the target object # - *target*: Global ID of the target object
# - *speed*: Movement speed (default: the default speed of `object`) # - *speed*: The speed at which to slide in pixels per second (will default to
# the speed configured on the `object`)
# #
# **Warning** This command does not respect the room's navigation polygons, so # **Warning** This command does not respect the room's navigation polygons, so
# `object` can be moved even when outside walkable areas. # `object` can be moved even when outside walkable areas.

View File

@@ -8,7 +8,7 @@
# - *path*: Path to the scene file of the object # - *path*: Path to the scene file of the object
# - *is_active*: Whether the new object should be set to active (default: `true`) # - *is_active*: Whether the new object should be set to active (default: `true`)
# - *position_target*: Global ID of another object that will be used to # - *position_target*: Global ID of another object that will be used to
# position the new object (when omitted, the new objet's position is not specified) # position the new object (when omitted, the new object's position is not specified)
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand
@@ -24,7 +24,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if arguments[0].empty() \ if arguments[0].empty() \
or arguments[0] in escoria.object_manager.RESERVED_OBJECTS: or arguments[0] in escoria.object_manager.RESERVED_OBJECTS:

View File

@@ -22,7 +22,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.has(arguments[0]): if not escoria.object_manager.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,11 +1,12 @@
# `teleport object target` # `teleport object target`
# #
# Instantly moves an object to a new position # Instantly moves an object to a new position.
# #
# **Parameters** # **Parameters**
# #
# - *object*: Global ID of the object to move # - *object*: Global ID of the object to move
# - *target*: Global ID of the target object to use as the destination # - *target*: Global ID of the object to use as the destination coordinates
# for `object`
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand
@@ -21,7 +22,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,6 +1,6 @@
# `teleport_pos object x y` # `teleport_pos object x y`
# #
# Instantly moves an object to the specified position # Instantly moves an object to the specified (absolute) coordinates.
# #
# **Parameters** # **Parameters**
# #
@@ -22,7 +22,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -23,7 +23,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.main.scene_transition.has_transition(arguments[0]): if not escoria.main.scene_transition.has_transition(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -2,13 +2,19 @@
# #
# Turns `object` to face another object. # Turns `object` to face another object.
# #
# Unlike movement commands, `turn_to` will not automatically reference an
# `ESCLocation` that is a child of an `ESCItem.`
# To turn towards an `ESCLocation` that is a child of an `ESCItem`, give the
# `ESCLocation` a `Global ID` and use this value as the `object_to_face`
# parameter.
#
# **Parameters** # **Parameters**
# #
# - *object*: Global ID of the object to be turned # - *object*: Global ID of the object to be turned
# - *object_to_face*: Global ID of the object to turn towards # - *object_to_face*: Global ID of the object to turn towards
# - *wait*: Length of time to wait in seconds for each intermediate angle. # - *wait*: Length of time to wait in seconds for each intermediate angle.
# If set to 0, the turnaround is immediate (default: `0`) # If set to 0, the turnaround is immediate (default: `0`)
## #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand
class_name TurnToCommand class_name TurnToCommand
@@ -23,7 +29,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,13 +1,14 @@
# `walk object target [speed]` # `walk object target [speed]`
# #
# Moves the specified `ESCPlayer` or movable `ESCItem` to `target` w # Moves the specified `ESCPlayer` or movable `ESCItem` to `target`
# hile playing `object`'s walking animation. This command is non-blocking. # while playing the `object`'s walking animation. This command is non-blocking.
# #
# **Parameters** # **Parameters**
# #
# - *object*: Global ID of the object to move # - *object*: Global ID of the object to move
# - *target*: Global ID of the target object # - *target*: Global ID of the target object
# - *speed*: Walking speed to use (default: `object`'s default speed) # - *speed*: The speed the `object` will walk in pixels per second (will
# default to the speed configured on the `object`)
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand
@@ -23,7 +24,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -7,7 +7,8 @@
# #
# - *object*: Global ID of the object to move # - *object*: Global ID of the object to move
# - *target*: Global ID of the target object # - *target*: Global ID of the target object
# - *speed*: Walking speed to use (default: `object`'s default speed) # - *speed*: The speed the `object` will walk in pixels per second (will
# default to the speed configured on the `object`)
# #
# @ESC # @ESC
extends ESCBaseCommand extends ESCBaseCommand
@@ -23,7 +24,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,7 +1,7 @@
# `walk_to_pos object x y` # `walk_to_pos object x y`
# #
# Moves the specified `ESCPlayer` or movable `ESCItem` to the target # Moves the specified `ESCPlayer` or movable `ESCItem` to the absolute
# position while playing `object`'s walking animation. # coordinates provided while playing the `object`'s walking animation.
# This command is non-blocking. # This command is non-blocking.
# #
# **Parameters** # **Parameters**
@@ -24,7 +24,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -1,7 +1,7 @@
# `walk_to_pos_block object x y` # `walk_to_pos_block object x y`
# #
# Moves the specified `ESCPlayer` or movable `ESCItem` to the target # Moves the specified `ESCPlayer` or movable `ESCItem` to the absolute
# position while playing `object`'s walking animation. # coordinates provided while playing the `object`'s walking animation.
# This command is blocking. # This command is blocking.
# #
# **Parameters** # **Parameters**
@@ -24,7 +24,7 @@ func configure() -> ESCCommandArgumentDescriptor:
) )
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array): func validate(arguments: Array):
if not escoria.object_manager.objects.has(arguments[0]): if not escoria.object_manager.objects.has(arguments[0]):
escoria.logger.report_errors( escoria.logger.report_errors(

View File

@@ -215,7 +215,7 @@ func clear_event_queue():
events_queue[channel_name].clear() events_queue[channel_name].clear()
# Check wether a channel is free to run more events # Check whether a channel is free to run more events
# #
# #### Parameters # #### Parameters
# - name: Name of the channel to test # - name: Name of the channel to test

View File

@@ -80,7 +80,7 @@ func register_object(object: ESCObject, force: bool = false) -> void:
objects[object.global_id] = object objects[object.global_id] = object
# Check wether an object was registered # Check whether an object was registered
# #
# #### Parameters # #### Parameters
# #

View File

@@ -26,7 +26,7 @@ func configure() -> ESCCommandArgumentDescriptor:
return ESCCommandArgumentDescriptor.new() return ESCCommandArgumentDescriptor.new()
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(arguments: Array) -> bool: func validate(arguments: Array) -> bool:
return self.configure().validate(get_class(), arguments) return self.configure().validate(get_class(), arguments)

View File

@@ -62,7 +62,7 @@ func prepare_arguments(arguments: Array) -> Array:
return complete_arguments return complete_arguments
# Validate wether the given arguments match the command descriptor # Validate whether the given arguments match the command descriptor
func validate(command: String, arguments: Array) -> bool: func validate(command: String, arguments: Array) -> bool:
if arguments.size() < self.min_args: if arguments.size() < self.min_args:
escoria.logger.report_errors( escoria.logger.report_errors(
@@ -106,7 +106,7 @@ func validate(command: String, arguments: Array) -> bool:
return true return true
# Check wether the given argument is of the given type # Check whether the given argument is of the given type
# #
# #### Parameters # #### Parameters
# #

View File

@@ -19,7 +19,7 @@ var _is_interrupted: bool = false
var is_finished: bool = false var is_finished: bool = false
# Check wether the statement should be run based on its conditions # Check whether the statement should be run based on its conditions
func is_valid() -> bool: func is_valid() -> bool:
for condition in self.conditions: for condition in self.conditions:
if not (condition as ESCCondition).run(): if not (condition as ESCCondition).run():

View File

@@ -424,7 +424,7 @@ func set_speed(speed_value: int) -> void:
speed = speed_value speed = speed_value
# Check wether this item moved # Check whether this item moved
func has_moved() -> bool: func has_moved() -> bool:
return _movable.moved if is_movable else false return _movable.moved if is_movable else false

View File

@@ -1,5 +1,8 @@
# A simple node extending Position2D with a global ID so that it can be # A simple node extending Position2D with a global ID so that it can be
# referenced in ESC Scripts. # referenced in ESC Scripts. Movement-based commands like `walk_to_pos` will
# automatically use an `ESCLocation` that is a child of the destination node.
# Commands like `turn_to`--which are not movement-based--will ignore child
# `ESCLocation`s and refer to the parent node.
extends Position2D extends Position2D
class_name ESCLocation, "res://addons/escoria-core/design/esc_location.svg" class_name ESCLocation, "res://addons/escoria-core/design/esc_location.svg"

View File

@@ -8,8 +8,8 @@ class_name ESCAnimationResource
# Array containing the different angles available for animations. # Array containing the different angles available for animations.
# Each angle is defined by an array [start_angle, angle_size]. # Each angle is defined by an array [start_angle, angle_size].
# start_angle must be between 0 and 360. # start_angle must be between 0 and 360.
# Angle 0 and 360 are the same and correspond to UP/NORTH # Angles 0 and 360 are the same and correspond to UP/NORTH,
# 90 is RIGHT/EAST, 180 is DOWN/SOUTH, etc # 90 is RIGHT/EAST, 180 is DOWN/SOUTH, 270 is LEFT/WEST etc.
export(Array, Resource) var dir_angles: Array = [] export(Array, Resource) var dir_angles: Array = []
# Array of animations for each direction, from UP to RIGHT_UP clockwise # Array of animations for each direction, from UP to RIGHT_UP clockwise

View File

@@ -10,7 +10,7 @@ signal say_finished
signal option_chosen(option) signal option_chosen(option)
# Check wether a specific type is supported by the # Check whether a specific type is supported by the
# dialog plugin # dialog plugin
# #
# #### Parameters # #### Parameters
@@ -20,7 +20,7 @@ func has_type(type: String) -> bool:
return false return false
# Check wether a specific chooser type is supported by the # Check whether a specific chooser type is supported by the
# dialog plugin # dialog plugin
# #
# #### Parameters # #### Parameters

View File

@@ -3,7 +3,7 @@ extends Control
class_name ESCInventoryContainer class_name ESCInventoryContainer
# Get wether the inventory container currently is empty # Get whether the inventory container currently is empty
# **Returns** Wether the container is empty or not # **Returns** Wether the container is empty or not
func is_empty() -> bool: func is_empty() -> bool:
return get_child_count() > 0 return get_child_count() > 0

View File

@@ -10,7 +10,7 @@ var _type_player: Node = null
var _dialog_player: Node = null var _dialog_player: Node = null
# Check wether a specific type is supported by the # Check whether a specific type is supported by the
# dialog plugin # dialog plugin
# #
# #### Parameters # #### Parameters
@@ -20,7 +20,7 @@ func has_type(type: String) -> bool:
return true if type in ["floating", "avatar"] else false return true if type in ["floating", "avatar"] else false
# Check wether a specific chooser type is supported by the # Check whether a specific chooser type is supported by the
# dialog plugin # dialog plugin
# #
# #### Parameters # #### Parameters