From f12239435f60fb1fc2facd4acc8a3a8b259d172d Mon Sep 17 00:00:00 2001 From: Balloonpopper Date: Fri, 18 Mar 2022 14:36:47 +1100 Subject: [PATCH 1/5] feat: Updated exit documentation --- addons/escoria-core/game/core-scripts/esc_exit.gd | 11 ++++++++++- addons/escoria-core/game/core-scripts/esc_item.gd | 9 +++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/addons/escoria-core/game/core-scripts/esc_exit.gd b/addons/escoria-core/game/core-scripts/esc_exit.gd index df5ada24d..605ad49e0 100644 --- a/addons/escoria-core/game/core-scripts/esc_exit.gd +++ b/addons/escoria-core/game/core-scripts/esc_exit.gd @@ -1,4 +1,13 @@ -# An item that streamlines exiting scenes +# An item that streamlines exiting scenes. +# +# Use this when you want this object to only change scenes (with an optional +# sound effect.) +# +# If you want to attach the exit to a script to perform additional actions - +# a cutscene for example, use an ESCItem with "Is Exit" selected instead. +# +# The game character will automatically walk to an ESCLocation created as a +# child of an ESCExit node. extends ESCItem class_name ESCExit, "res://addons/escoria-core/design/esc_exit.svg" diff --git a/addons/escoria-core/game/core-scripts/esc_item.gd b/addons/escoria-core/game/core-scripts/esc_item.gd index 24874af6a..26d88f55e 100644 --- a/addons/escoria-core/game/core-scripts/esc_item.gd +++ b/addons/escoria-core/game/core-scripts/esc_item.gd @@ -1,4 +1,7 @@ -# ESCItem is a Sprite that defines an item, potentially interactive +# ESCItem is a Sprite that defines an item, potentially interactive. +# +# The game character will automatically walk to an ESCLocation that +# is created as a child of an ESCItem. tool extends Area2D class_name ESCItem, "res://addons/escoria-core/design/esc_item.svg" @@ -53,7 +56,9 @@ export(String) var global_id # The ESC script for this item export(String, FILE, "*.esc") var esc_script -# If true, the ESC script may have an ":exit_scene" event to manage scene changes +# If true, the ESC script may have an ":exit_scene" event to manage scene changes. +# For simple exits that do not require scripted actions, the ESCExit node may be +# preferred. export(bool) var is_exit # If true, object is considered as trigger. Allows using :trigger_in and From b4c1677b064ca1ef650cb474120dbb1fa7dbad67 Mon Sep 17 00:00:00 2001 From: balloonpopper <5151242+balloonpopper@users.noreply.github.com> Date: Fri, 18 Mar 2022 20:38:50 +1100 Subject: [PATCH 2/5] Update addons/escoria-core/game/core-scripts/esc_exit.gd Co-authored-by: Dennis Ploeger --- addons/escoria-core/game/core-scripts/esc_exit.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/escoria-core/game/core-scripts/esc_exit.gd b/addons/escoria-core/game/core-scripts/esc_exit.gd index 605ad49e0..4419d3af2 100644 --- a/addons/escoria-core/game/core-scripts/esc_exit.gd +++ b/addons/escoria-core/game/core-scripts/esc_exit.gd @@ -1,7 +1,7 @@ # An item that streamlines exiting scenes. # # Use this when you want this object to only change scenes (with an optional -# sound effect.) +# sound effect). # # If you want to attach the exit to a script to perform additional actions - # a cutscene for example, use an ESCItem with "Is Exit" selected instead. From f65aef65e7c733fc9c012e8ae953c58cca15730f Mon Sep 17 00:00:00 2001 From: balloonpopper <5151242+balloonpopper@users.noreply.github.com> Date: Fri, 18 Mar 2022 20:48:33 +1100 Subject: [PATCH 3/5] Update addons/escoria-core/game/core-scripts/esc_item.gd --- addons/escoria-core/game/core-scripts/esc_item.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/escoria-core/game/core-scripts/esc_item.gd b/addons/escoria-core/game/core-scripts/esc_item.gd index 26d88f55e..9d40aa42e 100644 --- a/addons/escoria-core/game/core-scripts/esc_item.gd +++ b/addons/escoria-core/game/core-scripts/esc_item.gd @@ -1,4 +1,4 @@ -# ESCItem is a Sprite that defines an item, potentially interactive. +An ESCItem defines a potentially interactive item in the game. # # The game character will automatically walk to an ESCLocation that # is created as a child of an ESCItem. From 3db051ef3130486dd2a20ca488bc216ff4f30844 Mon Sep 17 00:00:00 2001 From: balloonpopper <5151242+balloonpopper@users.noreply.github.com> Date: Fri, 18 Mar 2022 20:50:25 +1100 Subject: [PATCH 4/5] Update addons/escoria-core/game/core-scripts/esc_exit.gd --- addons/escoria-core/game/core-scripts/esc_exit.gd | 8 +++++--- addons/escoria-core/game/core-scripts/esc_item.gd | 13 ++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/addons/escoria-core/game/core-scripts/esc_exit.gd b/addons/escoria-core/game/core-scripts/esc_exit.gd index 4419d3af2..8ec94fa68 100644 --- a/addons/escoria-core/game/core-scripts/esc_exit.gd +++ b/addons/escoria-core/game/core-scripts/esc_exit.gd @@ -1,7 +1,9 @@ -# An item that streamlines exiting scenes. +# An ESCExit is a minimal feature node that provides an exit to a room. # -# Use this when you want this object to only change scenes (with an optional -# sound effect). +# For exits that don't require scripts, the ``ESCExit`` node is provided. +# The only things you will need to configure on the node are the +# "target_scene" to change to, and optionally, a "switch +# sound" (the sound to play when changing rooms). # # If you want to attach the exit to a script to perform additional actions - # a cutscene for example, use an ESCItem with "Is Exit" selected instead. diff --git a/addons/escoria-core/game/core-scripts/esc_item.gd b/addons/escoria-core/game/core-scripts/esc_item.gd index 9d40aa42e..9ce439ecb 100644 --- a/addons/escoria-core/game/core-scripts/esc_item.gd +++ b/addons/escoria-core/game/core-scripts/esc_item.gd @@ -1,7 +1,14 @@ -An ESCItem defines a potentially interactive item in the game. +# An ESCItem defines a (usually interactive) item in the game. # -# The game character will automatically walk to an ESCLocation that -# is created as a child of an ESCItem. +# When interacting with an ESCItem, the game character will automatically +# walk to an ESCLocation that is created as a child of an ESCItem. +# +# By selecting the "Is Exit" checkbox when you create an ``ESCItem`` +# node, Escoria will look for a ":exit_scene" event in the attached script file. +# Any commands you place in the ":exit_scene" event will be run when the player +# chooses to "use" the exit - for example, saying a goodbye, or running a +# cutscene. Place a "change_scene" command as part of this event to move the +# character to the next room. tool extends Area2D class_name ESCItem, "res://addons/escoria-core/design/esc_item.svg" From 35dfabee0f6cf5fad493d4bfee5876238654fbbe Mon Sep 17 00:00:00 2001 From: balloonpopper <5151242+balloonpopper@users.noreply.github.com> Date: Sat, 19 Mar 2022 09:55:28 +1100 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: Duncan Brown --- .../escoria-core/game/core-scripts/esc_exit.gd | 6 +++--- .../escoria-core/game/core-scripts/esc_item.gd | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/escoria-core/game/core-scripts/esc_exit.gd b/addons/escoria-core/game/core-scripts/esc_exit.gd index 8ec94fa68..cf5888794 100644 --- a/addons/escoria-core/game/core-scripts/esc_exit.gd +++ b/addons/escoria-core/game/core-scripts/esc_exit.gd @@ -6,10 +6,10 @@ # sound" (the sound to play when changing rooms). # # If you want to attach the exit to a script to perform additional actions - -# a cutscene for example, use an ESCItem with "Is Exit" selected instead. +# a cutscene for example - use an ``ESCItem`` with "Is Exit" selected instead. # -# The game character will automatically walk to an ESCLocation created as a -# child of an ESCExit node. +# The game character will automatically walk to an ``ESCLocation`` created as a +# child of an ``ESCExit`` node. extends ESCItem class_name ESCExit, "res://addons/escoria-core/design/esc_exit.svg" diff --git a/addons/escoria-core/game/core-scripts/esc_item.gd b/addons/escoria-core/game/core-scripts/esc_item.gd index 9ce439ecb..aeb5578bb 100644 --- a/addons/escoria-core/game/core-scripts/esc_item.gd +++ b/addons/escoria-core/game/core-scripts/esc_item.gd @@ -1,13 +1,13 @@ -# An ESCItem defines a (usually interactive) item in the game. +# An ``ESCItem`` defines a (usually interactive) item in the game. # -# When interacting with an ESCItem, the game character will automatically -# walk to an ESCLocation that is created as a child of an ESCItem. +# When interacting with an ``ESCItem``, the game character will automatically +# walk to an ``ESCLocation`` that is created as a child of an ``ESCItem``. # # By selecting the "Is Exit" checkbox when you create an ``ESCItem`` -# node, Escoria will look for a ":exit_scene" event in the attached script file. -# Any commands you place in the ":exit_scene" event will be run when the player +# node, Escoria will look for an ``:exit_scene`` event in the attached script file. +# Any commands you place in the ``:exit_scene`` event will be run when the player # chooses to "use" the exit - for example, saying a goodbye, or running a -# cutscene. Place a "change_scene" command as part of this event to move the +# cutscene. Place a ``change_scene`` command inside this event to move the # character to the next room. tool extends Area2D @@ -63,8 +63,8 @@ export(String) var global_id # The ESC script for this item export(String, FILE, "*.esc") var esc_script -# If true, the ESC script may have an ":exit_scene" event to manage scene changes. -# For simple exits that do not require scripted actions, the ESCExit node may be +# If true, the ESC script may have an ``:exit_scene`` event to manage scene changes. +# For simple exits that do not require scripted actions, the ``ESCExit`` node may be # preferred. export(bool) var is_exit