From 58d880101d92240e207a0ecd81c6fc123d4b2c25 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Tue, 22 Jun 2021 23:06:20 +0200 Subject: [PATCH] Optimized Docs (#7) Authored-by: Dennis Ploeger --- CREDITS | 68 --- README.md | 60 ++- .../esc/commands/camera_set_limits.gd | 2 + .../esc/commands/enable_terrain.gd | 2 + .../core-scripts/esc/types/esc_condition.gd | 24 +- .../game/core-scripts/esc/types/esc_dialog.gd | 1 + docs/api/AcceptInputCommand.md | 47 ++ docs/api/AnimCommand.md | 43 ++ docs/api/CameraPushCommand.md | 42 ++ docs/api/CameraSetLimitsCommand.md | 42 ++ docs/api/CameraSetPosCommand.md | 33 ++ docs/api/CameraSetTargetCommand.md | 41 ++ docs/api/CameraSetZoomCommand.md | 34 ++ docs/api/CameraSetZoomHeightCommand.md | 41 ++ docs/api/CameraShiftCommand.md | 33 ++ docs/api/ChangeSceneCommand.md | 51 ++ docs/api/CustomCommand.md | 40 ++ docs/api/CutSceneCommand.md | 43 ++ docs/api/DebugCommand.md | 31 ++ docs/api/DecGlobalCommand.md | 40 ++ docs/api/ESCActionManager.md | 65 +++ docs/api/ESCBackground.md | 72 +++ docs/api/ESCBackgroundMusic.md | 51 ++ docs/api/ESCBackgroundSound.md | 51 ++ docs/api/ESCBaseCommand.md | 36 ++ docs/api/ESCCamera.md | 108 ++++ docs/api/ESCCameraLimits.md | 52 ++ docs/api/ESCCommand.md | 72 +++ docs/api/ESCCommandArgumentDescriptor.md | 63 +++ docs/api/ESCCommandRegistry.md | 47 ++ docs/api/ESCCompiler.md | 54 ++ docs/api/ESCCondition.md | 115 +++++ docs/api/ESCDialog.md | 96 ++++ docs/api/ESCDialogOption.md | 55 +++ docs/api/ESCDialogsPlayer.md | 80 +++ docs/api/ESCEvent.md | 98 ++++ docs/api/ESCEventManager.md | 49 ++ docs/api/ESCExecution.md | 59 +++ docs/api/ESCGame.md | 247 ++++++++++ docs/api/ESCGlobalsManager.md | 97 ++++ docs/api/ESCGroup.md | 40 ++ docs/api/ESCInventory.md | 47 ++ docs/api/ESCInventoryItem.md | 44 ++ docs/api/ESCInventoryManager.md | 57 +++ docs/api/ESCItem.md | 386 +++++++++++++++ docs/api/ESCLogger.md | 135 +++++ docs/api/{Movable.md => ESCMovable.md} | 33 +- docs/api/ESCObject.md | 81 +++ docs/api/ESCObjectManager.md | 75 +++ docs/api/ESCPlayer.md | 34 ++ docs/api/ESCResourceCache.md | 123 +++++ docs/api/ESCRoom.md | 109 +++++ docs/api/ESCScheduledEvent.md | 37 ++ docs/api/ESCScript.md | 19 + docs/api/ESCStatement.md | 41 ++ docs/api/ESCTerrain.md | 143 ++++++ docs/api/ESCTooltip.md | 186 +++++++ docs/api/ESCUtils.md | 65 +++ docs/api/ESCWalkContext.md | 45 ++ docs/api/EnableTerrainCommand.md | 32 ++ docs/api/GameOverCommand.md | 35 ++ docs/api/IncGlobalCommand.md | 40 ++ docs/api/InventoryAddCommand.md | 31 ++ docs/api/InventoryRemoveCommand.md | 31 ++ docs/api/PlaySndCommand.md | 34 ++ docs/api/QueueAnimationCommand.md | 42 ++ docs/api/QueueResourceCommand.md | 44 ++ docs/api/RepeatCommand.md | 32 ++ docs/api/SayCommand.md | 36 ++ docs/api/SchedEventCommand.md | 41 ++ docs/api/SetActiveCommand.md | 40 ++ docs/api/SetAngleCommand.md | 44 ++ docs/api/SetGlobalCommand.md | 32 ++ docs/api/SetGlobalsCommand.md | 33 ++ docs/api/SetHudVisibleCommand.md | 34 ++ docs/api/SetInteractiveCommand.md | 39 ++ docs/api/SetSoundStateCommand.md | 44 ++ docs/api/SetSpeedCommand.md | 39 ++ docs/api/SetStateCommand.md | 42 ++ docs/api/SlideBlockCommand.md | 43 ++ docs/api/SlideCommand.md | 43 ++ docs/api/SpawnCommand.md | 40 ++ docs/api/StopCommand.md | 31 ++ docs/api/TeleportCommand.md | 40 ++ docs/api/TurnToCommand.md | 45 ++ docs/api/WaitCommand.md | 31 ++ docs/api/WalkBlockCommand.md | 41 ++ docs/api/WalkCommand.md | 41 ++ docs/api/WalkToPosBlockCommand.md | 39 ++ docs/api/WalkToPosCommand.md | 39 ++ docs/api/dialog_box_inset.gd.md | 84 ++++ docs/api/dialog_label.gd.md | 66 +++ docs/api/esc_compiler.gd.md | 275 ----------- docs/api/esc_prompt_popup.gd.md | 27 + docs/api/escoria.gd.md | 197 +++++--- docs/api/escoria_types.gd.md | 144 ------ docs/api/inputs_manager.gd.md | 28 ++ docs/api/main.gd.md | 103 ++++ docs/api/main_scene.gd.md | 10 + docs/api/player_angles_finder.gd.md | 94 ++++ docs/api/plugin.gd.md | 70 +++ docs/api/rtl_screen_offset_testing.gd.md | 123 +++++ docs/api/save_data.gd.md | 112 +++++ docs/api/test_esc_compiler.gd.md | 8 + docs/api/text_dialog_choice.gd.md | 42 ++ docs/api/transition.gd.md | 40 ++ docs/api/verbs_menu_scumm9.gd.md | 8 + docs/architecture.md | 70 ++- docs/esc.md | 461 ++++++++++-------- docs/getting_started.md | 3 + extractesc.py | 35 ++ 111 files changed, 6362 insertions(+), 801 deletions(-) delete mode 100644 CREDITS create mode 100644 docs/api/AcceptInputCommand.md create mode 100644 docs/api/AnimCommand.md create mode 100644 docs/api/CameraPushCommand.md create mode 100644 docs/api/CameraSetLimitsCommand.md create mode 100644 docs/api/CameraSetPosCommand.md create mode 100644 docs/api/CameraSetTargetCommand.md create mode 100644 docs/api/CameraSetZoomCommand.md create mode 100644 docs/api/CameraSetZoomHeightCommand.md create mode 100644 docs/api/CameraShiftCommand.md create mode 100644 docs/api/ChangeSceneCommand.md create mode 100644 docs/api/CustomCommand.md create mode 100644 docs/api/CutSceneCommand.md create mode 100644 docs/api/DebugCommand.md create mode 100644 docs/api/DecGlobalCommand.md create mode 100644 docs/api/ESCActionManager.md create mode 100644 docs/api/ESCBackground.md create mode 100644 docs/api/ESCBackgroundMusic.md create mode 100644 docs/api/ESCBackgroundSound.md create mode 100644 docs/api/ESCBaseCommand.md create mode 100644 docs/api/ESCCamera.md create mode 100644 docs/api/ESCCameraLimits.md create mode 100644 docs/api/ESCCommand.md create mode 100644 docs/api/ESCCommandArgumentDescriptor.md create mode 100644 docs/api/ESCCommandRegistry.md create mode 100644 docs/api/ESCCompiler.md create mode 100644 docs/api/ESCCondition.md create mode 100644 docs/api/ESCDialog.md create mode 100644 docs/api/ESCDialogOption.md create mode 100644 docs/api/ESCDialogsPlayer.md create mode 100644 docs/api/ESCEvent.md create mode 100644 docs/api/ESCEventManager.md create mode 100644 docs/api/ESCExecution.md create mode 100644 docs/api/ESCGame.md create mode 100644 docs/api/ESCGlobalsManager.md create mode 100644 docs/api/ESCGroup.md create mode 100644 docs/api/ESCInventory.md create mode 100644 docs/api/ESCInventoryItem.md create mode 100644 docs/api/ESCInventoryManager.md create mode 100644 docs/api/ESCItem.md create mode 100644 docs/api/ESCLogger.md rename docs/api/{Movable.md => ESCMovable.md} (86%) create mode 100644 docs/api/ESCObject.md create mode 100644 docs/api/ESCObjectManager.md create mode 100644 docs/api/ESCPlayer.md create mode 100644 docs/api/ESCResourceCache.md create mode 100644 docs/api/ESCRoom.md create mode 100644 docs/api/ESCScheduledEvent.md create mode 100644 docs/api/ESCScript.md create mode 100644 docs/api/ESCStatement.md create mode 100644 docs/api/ESCTerrain.md create mode 100644 docs/api/ESCTooltip.md create mode 100644 docs/api/ESCUtils.md create mode 100644 docs/api/ESCWalkContext.md create mode 100644 docs/api/EnableTerrainCommand.md create mode 100644 docs/api/GameOverCommand.md create mode 100644 docs/api/IncGlobalCommand.md create mode 100644 docs/api/InventoryAddCommand.md create mode 100644 docs/api/InventoryRemoveCommand.md create mode 100644 docs/api/PlaySndCommand.md create mode 100644 docs/api/QueueAnimationCommand.md create mode 100644 docs/api/QueueResourceCommand.md create mode 100644 docs/api/RepeatCommand.md create mode 100644 docs/api/SayCommand.md create mode 100644 docs/api/SchedEventCommand.md create mode 100644 docs/api/SetActiveCommand.md create mode 100644 docs/api/SetAngleCommand.md create mode 100644 docs/api/SetGlobalCommand.md create mode 100644 docs/api/SetGlobalsCommand.md create mode 100644 docs/api/SetHudVisibleCommand.md create mode 100644 docs/api/SetInteractiveCommand.md create mode 100644 docs/api/SetSoundStateCommand.md create mode 100644 docs/api/SetSpeedCommand.md create mode 100644 docs/api/SetStateCommand.md create mode 100644 docs/api/SlideBlockCommand.md create mode 100644 docs/api/SlideCommand.md create mode 100644 docs/api/SpawnCommand.md create mode 100644 docs/api/StopCommand.md create mode 100644 docs/api/TeleportCommand.md create mode 100644 docs/api/TurnToCommand.md create mode 100644 docs/api/WaitCommand.md create mode 100644 docs/api/WalkBlockCommand.md create mode 100644 docs/api/WalkCommand.md create mode 100644 docs/api/WalkToPosBlockCommand.md create mode 100644 docs/api/WalkToPosCommand.md create mode 100644 docs/api/dialog_box_inset.gd.md create mode 100644 docs/api/dialog_label.gd.md delete mode 100644 docs/api/esc_compiler.gd.md create mode 100644 docs/api/esc_prompt_popup.gd.md delete mode 100644 docs/api/escoria_types.gd.md create mode 100644 docs/api/inputs_manager.gd.md create mode 100644 docs/api/main.gd.md create mode 100644 docs/api/main_scene.gd.md create mode 100644 docs/api/player_angles_finder.gd.md create mode 100644 docs/api/plugin.gd.md create mode 100644 docs/api/rtl_screen_offset_testing.gd.md create mode 100644 docs/api/save_data.gd.md create mode 100644 docs/api/test_esc_compiler.gd.md create mode 100644 docs/api/text_dialog_choice.gd.md create mode 100644 docs/api/transition.gd.md create mode 100644 docs/api/verbs_menu_scumm9.gd.md create mode 100644 docs/getting_started.md create mode 100644 extractesc.py diff --git a/CREDITS b/CREDITS deleted file mode 100644 index 03cf9d2b..00000000 --- a/CREDITS +++ /dev/null @@ -1,68 +0,0 @@ -Escoria is a framework developed by Ariel Manzur (punto) - - -Logo -==== - -Escoria Logo created by Livio Fania (https://liviofania.com/) -Licence: CC-BY - - - -Assets -====== - -Fonts ------ - -These fonts are provided as an example. Please mind checking the licence before redistributing with your game. - -- Caslon Antique -https://www.1001fonts.com/caslon-antique-font.html#license -Licence: Free for personal use - Free for commercial use -This is the font used in LucasArt's game Curse of Monkey Island. - -- Onesize -https://www.whatfontis.com/Onesize.font -Licence: Free for personal use -This is the font used in LucasArt's games The Secret of Monkey Island and Monkey Island 2: Lechuck's Revenge. - - -Characters ----------- - -- Mark spritesheet by Marco Giorgini - marcogiorgini.com -Licence : CC0 Licence -https://opengameart.org/content/mark-2d-adventure-game-sprite -with some additions (talk animations) by Julian Murgia - -- Worker spritesheet based on Mark spritesheet by Marco Giorgini - marcogiorgini.com -Licence: CC0 Licence -edited by Julian Murgia - - -Items ------ - -- Generic items by Kenney -Licence: CC0 Licence -https://www.kenney.nl/assets/generic-items - - - -Music -===== - -- “Game Menu Looping” (Licence CC-BY 4.0) -- “Mystical Ocean Puzzle Game” (Licence CC-BY 4.0) -by Eric Matyas -www.soundimage.org - - - -Sound -===== - -- Concrete footstep -Licence: CC0 Licence -https://www.kenney.nl/ diff --git a/README.md b/README.md index 6de69146..9bcd195d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # Escoria Rewrite -Libre framework for the creation of point-and-click adventure games with -the MIT-licensed multi-platform game engine [Godot Engine](https://godotengine.org). +Libre framework for the creation of point-and-click adventure games with the MIT-licensed multi-platform game engine [Godot Engine](https://godotengine.org). -It is designed so that you can claim it for yourself and modify it to match -the needs of your specific game and team. +It is designed so that you can claim it for yourself and modify it to match the needs of your specific game and team. This repository is big rewrite of the original [Escoria framework](https://github.com/godotengine/escoria/tree/master). Its purpose is to make Escoria work as a plugin for the Godot Engine editor, instead of being a collection of scripts and scenes. It is intended to be easier to use and easier to maintain. @@ -14,8 +12,9 @@ If you're encountering issues or incompatibilities, please raise an issue on [Es This framework was initially developed for the adventure game [The Interactive Adventures of Dog Mendonça and Pizzaboy®](http://store.steampowered.com/app/330420) -and later streamlined for broader usages and open sourced as promised -to the backers of the Dog Mendonça Kickstarter campaign. +and later streamlined for broader usages and open sourced as promised to the backers of the Dog Mendonça Kickstarter campaign. + +Because of maintainability issues and to make the framework easier for new developers and bring it closer to Godot's standards, the framework was completely rewritten and optimized. ## Authors @@ -31,10 +30,11 @@ In alphabetical order: ## Documentation -* Getting started +* [Getting started](docs/getting_started.md) * [Architecture](docs/architecture.md) * [Configuration](docs/configuration.md) * [ESC language documentation](api/esc.md) +* [API reference](docs/api) ## Roadmap @@ -72,12 +72,51 @@ This framework (scripts, scenes) is distributed under the [MIT license](LICENCE) ### Art credits +#### Logo + +Escoria Logo created by Livio Fania (https://liviofania.com/) +Licence: CC-BY + +#### Characters + +- Mark spritesheet by Marco Giorgini - marcogiorgini.com + Licence : CC0 Licence + https://opengameart.org/content/mark-2d-adventure-game-sprite + with some additions (talk animations) by Julian Murgia +- Worker spritesheet based on Mark spritesheet by Marco Giorgini - marcogiorgini.com + Licence: CC0 Licence + edited by Julian Murgia + +#### Items + +* Generic items by Kenney + Licence: CC0 Licence + https://www.kenney.nl/assets/generic-items ### Sound credits +* Concrete footstep + Licence: CC0 Licence + https://www.kenney.nl/ +* “Game Menu Looping” (Licence CC-BY 4.0) +* “Mystical Ocean Puzzle Game” (Licence CC-BY 4.0) + by Eric Matyas + www.soundimage.org ### Font +These fonts are provided as an example. Please mind checking the licence before redistributing with your game. + +- Caslon Antique + https://www.1001fonts.com/caslon-antique-font.html#license + Licence: Free for personal use - Free for commercial use + This is the font used in LucasArt's game Curse of Monkey Island. + +- Onesize + https://www.whatfontis.com/Onesize.font + Licence: Free for personal use + This is the font used in LucasArt's games The Secret of Monkey Island and Monkey Island 2: Lechuck's Revenge. + ## Development Requirements: @@ -85,6 +124,7 @@ Requirements: * git * Current Godot version * Current master of [GDScript docs maker](https://github.com/GDQuest/gdscript-docs-maker) +* Python (>=3) if you changed the ESC commands During development, run the following to update the class list: @@ -95,3 +135,9 @@ rm -rf export &>/dev/null cp export/* /docs/api ``` +If you changed ESC commands, update the command reference by running + +``` +python3 extractesc.py +``` + diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd index eb816fc1..b6ceb6fe 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd @@ -1,8 +1,10 @@ # `camera_set_limits camlimits_id` +# # Sets the camera limits to the one defined under `camlimits_id` in ESCRoom's # camera_limits array. # - camlimits_id : int : id of the camera limits to apply (defined in ESCRoom's # camera_limits array) +# # @ESC extends ESCBaseCommand class_name CameraSetLimitsCommand diff --git a/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd b/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd index aa9d71c1..b87b4f7f 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd @@ -1,6 +1,8 @@ # `enable_terrain node_name` +# # Enable the ESCTerrain's NavigationPolygonInstance defined by given node name. # Disables previously activated NavigationPolygonInstance. +# # @ESC extends ESCBaseCommand class_name EnableTerrainCommand diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_condition.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_condition.gd index bda2401b..bf1a0f68 100644 --- a/addons/escoria-core/game/core-scripts/esc/types/esc_condition.gd +++ b/addons/escoria-core/game/core-scripts/esc/types/esc_condition.gd @@ -4,20 +4,27 @@ class_name ESCCondition # Valid comparison types -enum {COMPARISON_NONE, COMPARISON_EQ, COMPARISON_GT, COMPARISON_LT} +enum { + COMPARISON_NONE, + COMPARISON_EQ, + COMPARISON_GT, + COMPARISON_LT, + COMPARISON_ACTIVITY +} # Regex that matches condition lines const REGEX = \ - '^(?!)?(?eq|gt|lt)? ?' +\ - '(?i\/)?(?[^ ]+)( (?.+))?$' + '^(?!)?(?eq|gt|lt)? ?(?i\/)?' + \ + '(?a\/)?(?[^ ]+)( (?.+))?$' const COMPARISON_DESCRIPTION = [ "Checking if %s %s %s true%s", "Checking if %s %s %s equals %s", "Checking if %s %s %s greater than %s", - "Checking if %s %s %s less than %s" + "Checking if %s %s %s less than %s", + "Checking if %s is %s active%s" ] @@ -73,6 +80,8 @@ func _init(comparison_string: String): ) if "is_inventory" in result.names: self.inventory = true + if "is_activity" in result.names: + self.comparison = COMPARISON_ACTIVITY if "flag" in result.names: self.flag = escoria.utils.get_re_group(result, "flag") else: @@ -93,7 +102,8 @@ func run() -> bool: "inventory item" if self.inventory else "global value", self.flag, "is not" if self.negated else "is", - "" if self.comparison == COMPARISON_NONE else self.comparison_value + "" if self.comparison in [COMPARISON_NONE, COMPARISON_ACTIVITY] \ + else self.comparison_value ] ) @@ -119,6 +129,10 @@ func run() -> bool: escoria.globals_manager.get_global(global_name) < \ self.comparison_value: return_value = true + elif self.comparison == COMPARISON_ACTIVITY and \ + escoria.object_manager.has_object(global_name) and \ + escoria.object_manager.get_object(global_name).active: + return_value = true if self.negated: return_value = not return_value diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_dialog.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_dialog.gd index 66a45902..d853bf8f 100644 --- a/addons/escoria-core/game/core-scripts/esc/types/esc_dialog.gd +++ b/addons/escoria-core/game/core-scripts/esc/types/esc_dialog.gd @@ -15,6 +15,7 @@ const END_REGEX = \ # Dialog type +# FIXME, currently unused, but needs reimplementation var type: String = "" # Avatar used in the dialog diff --git a/docs/api/AcceptInputCommand.md b/docs/api/AcceptInputCommand.md new file mode 100644 index 00000000..5984f7f2 --- /dev/null +++ b/docs/api/AcceptInputCommand.md @@ -0,0 +1,47 @@ + + +# AcceptInputCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`accept_input [ALL|NONE|SKIP]` + +What type of input does the game accept. ALL is the default, SKIP allows +skipping of dialog but nothing else, NONE denies all input. Including opening +the menu etc. SKIP and NONE also disable autosaves. + +*Note* that SKIP gets reset to ALL when the event is done, but NONE persists. +This allows you to create cut scenes with SKIP where the dialog can be +skipped, but also initiate locked#### down cutscenes with accept_input +NONE in :setup and accept_input ALL later in :ready. + +@STUB +@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/AnimCommand.md b/docs/api/AnimCommand.md new file mode 100644 index 00000000..7ab48297 --- /dev/null +++ b/docs/api/AnimCommand.md @@ -0,0 +1,43 @@ + + +# AnimCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`anim object name [reverse]` + +Executes the animation specificed with the "name" parameter on the object, +without blocking. The next command in the event will be executed immediately +after. Optional parameters: + +* reverse: plays the animation in reverse when true + +@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/CameraPushCommand.md b/docs/api/CameraPushCommand.md new file mode 100644 index 00000000..efd4d451 --- /dev/null +++ b/docs/api/CameraPushCommand.md @@ -0,0 +1,42 @@ + + +# CameraPushCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`camera_push target [time] [type]` + +Push camera to `target`. Target must have camera_pos set. If it's of type +Camera2D, its zoom will be used as well as position. `type` is any of the +Tween.TransitionType values without the prefix, eg. LINEAR, QUART or CIRC; +defaults to QUART. A `time` value of 0 will set the camera immediately. + +@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/CameraSetLimitsCommand.md b/docs/api/CameraSetLimitsCommand.md new file mode 100644 index 00000000..ca4692c2 --- /dev/null +++ b/docs/api/CameraSetLimitsCommand.md @@ -0,0 +1,42 @@ + + +# CameraSetLimitsCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`camera_set_limits camlimits_id` + +Sets the camera limits to the one defined under `camlimits_id` in ESCRoom's +camera_limits array. +- camlimits_id : int : id of the camera limits to apply (defined in ESCRoom's + camera_limits array) + +@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/CameraSetPosCommand.md b/docs/api/CameraSetPosCommand.md new file mode 100644 index 00000000..b555578e --- /dev/null +++ b/docs/api/CameraSetPosCommand.md @@ -0,0 +1,33 @@ + + +# CameraSetPosCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`camera_set_pos speed x y` + +Moves the camera to a position defined by "x" and "y", at the speed defined +by "speed" in pixels per second. If speed is 0, camera is teleported to the +position. + +@ESC + +## Method Descriptions + +### configure + +```gdscript +func configure() -> ESCCommandArgumentDescriptor +``` + +Return the descriptor of the arguments of this command + +### run + +```gdscript +func run(command_params: Array) -> int +``` + +Run the command \ No newline at end of file diff --git a/docs/api/CameraSetTargetCommand.md b/docs/api/CameraSetTargetCommand.md new file mode 100644 index 00000000..c0092e41 --- /dev/null +++ b/docs/api/CameraSetTargetCommand.md @@ -0,0 +1,41 @@ + + +# CameraSetTargetCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`camera_set_target speed object` + +Configures the camera to set the target to the given `object`using `speed` +as speed limit. +This is the default behavior (default follow object is "player"). + +@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/CameraSetZoomCommand.md b/docs/api/CameraSetZoomCommand.md new file mode 100644 index 00000000..fde3ea7c --- /dev/null +++ b/docs/api/CameraSetZoomCommand.md @@ -0,0 +1,34 @@ + + +# CameraSetZoomCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`camera_set_zoom magnitude [time]` + +Zooms the camera in/out to the desired `magnitude`. Values larger than 1 zooms +the camera out, and smaller values zooms in, relative to the default value +of 1. An optional `time` in seconds controls how long it takes for the camera +to zoom into position. + +@ESC + +## Method Descriptions + +### configure + +```gdscript +func configure() -> ESCCommandArgumentDescriptor +``` + +Return the descriptor of the arguments of this command + +### run + +```gdscript +func run(command_params: Array) -> int +``` + +Run the command \ No newline at end of file diff --git a/docs/api/CameraSetZoomHeightCommand.md b/docs/api/CameraSetZoomHeightCommand.md new file mode 100644 index 00000000..d74439b0 --- /dev/null +++ b/docs/api/CameraSetZoomHeightCommand.md @@ -0,0 +1,41 @@ + + +# CameraSetZoomHeightCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`camera_set_zoom_height pixels [time] + +Zooms the camera in/out to the desired `pixels` height. +An optional `time` in seconds controls how long it takes for the camera +to zoom into position. + +@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/CameraShiftCommand.md b/docs/api/CameraShiftCommand.md new file mode 100644 index 00000000..3c905586 --- /dev/null +++ b/docs/api/CameraShiftCommand.md @@ -0,0 +1,33 @@ + + +# CameraShiftCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`camera_shift x y [time] [type]` + +Shift camera by `x` and `y` pixels over `time` seconds. `type` is any of the +Tween.TransitionType values without the prefix, eg. LINEAR, QUART or CIRC; +defaults to QUART. + +@ESC + +## Method Descriptions + +### configure + +```gdscript +func configure() -> ESCCommandArgumentDescriptor +``` + +Return the descriptor of the arguments of this command + +### run + +```gdscript +func run(command_params: Array) -> int +``` + +Run the command \ No newline at end of file diff --git a/docs/api/ChangeSceneCommand.md b/docs/api/ChangeSceneCommand.md new file mode 100644 index 00000000..f1e1eddb --- /dev/null +++ b/docs/api/ChangeSceneCommand.md @@ -0,0 +1,51 @@ + + +# ChangeSceneCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`change_scene path run_events` + +Loads a new scene, specified by "path". The `run_events` variable is a +boolean (default true) which you never want to set manually! It's there only +to benefit save games, so they don't conflict with the scene's events. + +@ESC + +## Property Descriptions + +### readied\_scenes + +```gdscript +var readied_scenes: Array +``` + +An array of scenes that have already been loaded + +## Method Descriptions + +### configure + +```gdscript +func configure() -> ESCCommandArgumentDescriptor +``` + +Return the descriptor of the arguments of this command + +### validate + +```gdscript +func validate(arguments: Array) -> bool +``` + +Validate wether the given arguments match the command descriptor + +### run + +```gdscript +func run(command_params: Array) -> var +``` + +Run the command \ No newline at end of file diff --git a/docs/api/CustomCommand.md b/docs/api/CustomCommand.md new file mode 100644 index 00000000..86f50dc2 --- /dev/null +++ b/docs/api/CustomCommand.md @@ -0,0 +1,40 @@ + + +# CustomCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`custom object node func_name [params]` + +Calls the function `func_name` of the node `node` of object `object` with +the optional `params`. This is a blocking function + +@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/CutSceneCommand.md b/docs/api/CutSceneCommand.md new file mode 100644 index 00000000..fa928295 --- /dev/null +++ b/docs/api/CutSceneCommand.md @@ -0,0 +1,43 @@ + + +# CutSceneCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`cut_scene object name [reverse]` + +Executes the animation specificed with the "name" parameter on the object, +blocking. The next command in the event will be executed when the animation +is finished playing. Optional parameters: + +* reverse plays the animation in reverse when true + +@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) -> var +``` + +Run the command \ No newline at end of file diff --git a/docs/api/DebugCommand.md b/docs/api/DebugCommand.md new file mode 100644 index 00000000..9121ab80 --- /dev/null +++ b/docs/api/DebugCommand.md @@ -0,0 +1,31 @@ + + +# DebugCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`debug string [string2 ...]` + +Takes 1 or more strings, prints them to the console. + +@ESC + +## Method Descriptions + +### configure + +```gdscript +func configure() -> ESCCommandArgumentDescriptor +``` + +Return the descriptor of the arguments of this command + +### run + +```gdscript +func run(command_params: Array) -> int +``` + +Run the command \ No newline at end of file diff --git a/docs/api/DecGlobalCommand.md b/docs/api/DecGlobalCommand.md new file mode 100644 index 00000000..8452d842 --- /dev/null +++ b/docs/api/DecGlobalCommand.md @@ -0,0 +1,40 @@ + + +# DecGlobalCommand + +**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node) + +## Description + +`dec_global name value` + +Subtracts the value from global with given "name". Value and global must +both be integers. + +@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/ESCActionManager.md b/docs/api/ESCActionManager.md new file mode 100644 index 00000000..da129659 --- /dev/null +++ b/docs/api/ESCActionManager.md @@ -0,0 +1,65 @@ + + +# ESCActionManager + +**Extends:** [Object](../Object) + +## Description + +Manages currently carried out actions + +## Property Descriptions + +### current\_action + +```gdscript +var current_action: String = "" +``` + +- **Setter**: `set_current_action` + +Current verb used + +### current\_tool + +```gdscript +var current_tool: ESCObject +``` + +Current tool (ESCItem/ESCInventoryItem) used + +## Method Descriptions + +### set\_current\_action + +```gdscript +func set_current_action(action: String) +``` + +Set the current action + +### clear\_current\_action + +```gdscript +func clear_current_action() +``` + +Clear the current action + +### clear\_current\_tool + +```gdscript +func clear_current_tool() +``` + +Clear the current tool + +### activate + +```gdscript +func activate(action: String, target: ESCObject, combine_with: ESCObject = null) -> var +``` + +## Signals + +- signal action_changed(): The current action was changed diff --git a/docs/api/ESCBackground.md b/docs/api/ESCBackground.md new file mode 100644 index 00000000..de8a4e39 --- /dev/null +++ b/docs/api/ESCBackground.md @@ -0,0 +1,72 @@ + + +# ESCBackground + +**Extends:** [TextureRect](../TextureRect) + +## Description + +ESCBackground's purpose is to display a background image and receive input +events on the background. More precisely, the TextureRect under ESCBackground +does not receive events itself - if it did, it would also eat all events like +hotspot focusing and such. Instead, we set the TextureRect mouse filter to +MOUSE_FILTER_IGNORE, and we use an Area2D node to receive the input events. + +If ESCBackground doesn't contain a texture, it is important that its rect_size +is set over the whole scene, because its rect_size is then used to create the +Area2D node under it. If the rect_size is wrongly set, the background may +receive no input. + +## Property Descriptions + +### esc\_script + +```gdscript +export var esc_script = "" +``` + +The ESC script connected to this background + +## Method Descriptions + +### manage\_input + +```gdscript +func manage_input(_viewport, event, _shape_idx) -> void +``` + +Manage inputs reaching the Area2D and emit the events to the input manager +TODO: Don't change private variables here, use an event for BUTTON_WHEEL + +#### Parameters +- _viewport: (not used) +- event: Event received +- _shape_idx: (not used) + +### get\_full\_area\_rect2 + +```gdscript +func get_full_area_rect2() -> Rect2 +``` + +Calculate the actual area taken by this background depending on its +Texture or set size +**Returns** The correct area size + +## Signals + +- signal double_left_click_on_bg(position): The background was double clicked + +#### Parameters + +- position: The position where the player clicked +- signal left_click_on_bg(position): The background was left clicked + +#### Parameters + +- position: The position where the player clicked +- signal right_click_on_bg(position): The background was right clicked + +#### Parameters + +- position: The position where the player clicked diff --git a/docs/api/ESCBackgroundMusic.md b/docs/api/ESCBackgroundMusic.md new file mode 100644 index 00000000..4259c986 --- /dev/null +++ b/docs/api/ESCBackgroundMusic.md @@ -0,0 +1,51 @@ + + +# ESCBackgroundMusic + +**Extends:** [Control](../Control) + +## Description + +Background music player + +## Property Descriptions + +### global\_id + +```gdscript +export var global_id: String = "bg_music" +``` + +Global id of the background music player + +### state + +```gdscript +var state: String = "default" +``` + +The state of the music player. "default" or "off" disable music +Any other state refers to a music stream that should be played + +### stream + +```gdscript +var stream: AudioStreamPlayer +``` + +Reference to the audio player + +## Method Descriptions + +### set\_state + +```gdscript +func set_state(p_state: String, p_force: bool = false) -> void +``` + +Set the state of this player + +#### Parameters + +- p_state: New state to use +- p_force: Override the existing state even if the stream is still playing \ No newline at end of file diff --git a/docs/api/ESCBackgroundSound.md b/docs/api/ESCBackgroundSound.md new file mode 100644 index 00000000..ce678862 --- /dev/null +++ b/docs/api/ESCBackgroundSound.md @@ -0,0 +1,51 @@ + + +# ESCBackgroundSound + +**Extends:** [Control](../Control) + +## Description + +Background sound player + +## Property Descriptions + +### global\_id + +```gdscript +export var global_id: String = "bg_sound" +``` + +Global id of the background sound player + +### state + +```gdscript +var state: String = "default" +``` + +The state of the sound player. "default" or "off" disable sound +Any other state refers to a sound stream that should be played + +### stream + +```gdscript +var stream: AudioStreamPlayer +``` + +Reference to the audio player + +## Method Descriptions + +### set\_state + +```gdscript +func set_state(p_state: String, p_force: bool = false) +``` + +Set the state of this player + +#### Parameters + +- p_state: New state to use +- p_force: Override the existing state even if the stream is still playing \ No newline at end of file diff --git a/docs/api/ESCBaseCommand.md b/docs/api/ESCBaseCommand.md new file mode 100644 index 00000000..f31eb2e5 --- /dev/null +++ b/docs/api/ESCBaseCommand.md @@ -0,0 +1,36 @@ + + +# ESCBaseCommand + +**Extends:** [Node](../Node) + +## Description + +A base class for every ESC command. +Extending classes have to override the configure and run function + +## Method Descriptions + +### configure + +```gdscript +func configure() -> ESCCommandArgumentDescriptor +``` + +Return the descriptor of the arguments of this command + +### validate + +```gdscript +func validate(arguments: Array) -> bool +``` + +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/ESCCamera.md b/docs/api/ESCCamera.md new file mode 100644 index 00000000..641e8439 --- /dev/null +++ b/docs/api/ESCCamera.md @@ -0,0 +1,108 @@ + + +# ESCCamera + +**Extends:** [Camera2D](../Camera2D) + +## Description + +Camera handling + +## Property Descriptions + +### tween + +```gdscript +var tween +``` + +Reference to the tween node for animating camera movements + +### target + +```gdscript +var target: Vector2 = "(0, 0)" +``` + +Target position of the camera + +### follow\_target + +```gdscript +var follow_target: Node +``` + +The object to follow + +### zoom\_target + +```gdscript +var zoom_target: Vector2 +``` + +Target zoom of the camera + +### zoom\_time + +```gdscript +var zoom_time +``` + +### zoom\_transform + +```gdscript +var zoom_transform +``` + +This is needed to adjust dialog positions and such, see dialog_instance.gd + +## Method Descriptions + +### set\_limits + +```gdscript +func set_limits(limits: ESCCameraLimits) +``` + +Sets camera limits so it doesn't go out of the scene + +#### Parameters + +- limits: The limits to set + +### set\_drag\_margin\_enabled + +```gdscript +func set_drag_margin_enabled(p_dm_h_enabled, p_dm_v_enabled) +``` + +### set\_target + +```gdscript +func set_target(p_target, p_speed: float = 0) +``` + +### set\_camera\_zoom + +```gdscript +func set_camera_zoom(p_zoom_level, p_time) +``` + +### push + +```gdscript +func push(p_target, p_time, p_type) +``` + +### shift + +```gdscript +func shift(p_x, p_y, p_time, p_type) +``` + +### target\_reached + +```gdscript +func target_reached() +``` + diff --git a/docs/api/ESCCameraLimits.md b/docs/api/ESCCameraLimits.md new file mode 100644 index 00000000..f51cba57 --- /dev/null +++ b/docs/api/ESCCameraLimits.md @@ -0,0 +1,52 @@ + + +# ESCCameraLimits + +**Extends:** [Object](../Object) + +## Description + +Describes a bounding box that limits the camera movement in the scene + +## Property Descriptions + +### limit\_left + +```gdscript +var limit_left: int = -10000 +``` + +The left side of the bounding box + +### limit\_right + +```gdscript +var limit_right: int = 10000 +``` + +The right side of the bounding box + +### limit\_top + +```gdscript +var limit_top: int = -10000 +``` + +The top side of the bounding box + +### limit\_bottom + +```gdscript +var limit_bottom: int = 10000 +``` + +The bottom side of the bounding box + +## Method Descriptions + +### \_init + +```gdscript +func _init(left: int, right: int, top: int, bottom: int) +``` + diff --git a/docs/api/ESCCommand.md b/docs/api/ESCCommand.md new file mode 100644 index 00000000..8efd6457 --- /dev/null +++ b/docs/api/ESCCommand.md @@ -0,0 +1,72 @@ + + +# ESCCommand + +**Extends:** [ESCStatement](../ESCStatement) < [Object](../Object) + +## Description + +An ESC command + +## Constants Descriptions + +### REGEX + +```gdscript +const REGEX: String = "^(\\s*)(?[^\\s]+)(\\s(?([^\\[]|$)+))?(\\[(?[^\\]]+)\\])?" +``` + +Regex matching command lines + +## Property Descriptions + +### name + +```gdscript +var name: String +``` + +The name of this command + +### parameters + +```gdscript +var parameters: Array +``` + +Parameters of this command + +### conditions + +```gdscript +var conditions: Array +``` + +A list of ESCConditions to run this command. +Conditions are combined using logical AND + +## Method Descriptions + +### \_init + +```gdscript +func _init(command_string) +``` + +Create a command from a command string + +### is\_valid + +```gdscript +func is_valid() -> bool +``` + +Check, if conditions match + +### run + +```gdscript +func run() -> var +``` + +Run this command \ No newline at end of file diff --git a/docs/api/ESCCommandArgumentDescriptor.md b/docs/api/ESCCommandArgumentDescriptor.md new file mode 100644 index 00000000..e1238ff0 --- /dev/null +++ b/docs/api/ESCCommandArgumentDescriptor.md @@ -0,0 +1,63 @@ + + +# ESCCommandArgumentDescriptor + +**Extends:** [Object](../Object) + +## Description + +The descriptor of the arguments of an ESC command + +## Property Descriptions + +### min\_args + +```gdscript +var min_args: int = 0 +``` + +Number of arguments the command expects + +### types + +```gdscript +var types: Array +``` + +The types the arguments as TYPE_ constants. If the command is called with +more arguments than there are entries in the types array, the additional +arguments will be checked against the last entry of the types array. + +### defaults + +```gdscript +var defaults: Array +``` + +The default values for the arguments + +## Method Descriptions + +### \_init + +```gdscript +func _init(p_min_args: int = 0, p_types: Array, p_defaults: Array) +``` + +Initialize the descriptor + +### prepare\_arguments + +```gdscript +func prepare_arguments(arguments: Array) -> Array +``` + +Combine the default argument values with the given arguments + +### validate + +```gdscript +func validate(command: String, arguments: Array) -> bool +``` + +Validate wether the given arguments match the command descriptor \ No newline at end of file diff --git a/docs/api/ESCCommandRegistry.md b/docs/api/ESCCommandRegistry.md new file mode 100644 index 00000000..29100228 --- /dev/null +++ b/docs/api/ESCCommandRegistry.md @@ -0,0 +1,47 @@ + + +# ESCCommandRegistry + +**Extends:** [Object](../Object) + +## Description + +A registry of ESC command objects + +## Property Descriptions + +### registry + +```gdscript +var registry: Dictionary +``` + +The registry of registered commands + +## Method Descriptions + +### load\_command + +```gdscript +func load_command(command_name: String) -> ESCBaseCommand +``` + +Load a command by its name + +#### Parameters + +- command_name: Name of command to load +**Returns** The command object + +### get\_command + +```gdscript +func get_command(command_name: String) -> ESCBaseCommand +``` + +Retrieve a command from the command registry + +#### Parameters + +- command_name: The name of the command +**Returns** The command object \ No newline at end of file diff --git a/docs/api/ESCCompiler.md b/docs/api/ESCCompiler.md new file mode 100644 index 00000000..a0d496ed --- /dev/null +++ b/docs/api/ESCCompiler.md @@ -0,0 +1,54 @@ + + +# ESCCompiler + +**Extends:** [Object](../Object) + +## Description + +Compiler of the ESC language + +## Constants Descriptions + +### COMMENT\_REGEX + +```gdscript +const COMMENT_REGEX: String = "^\\s*#.*$" +``` + +A RegEx for comment lines +.*$' + +### EMPTY\_REGEX + +```gdscript +const EMPTY_REGEX: String = "^\\s*$" +``` + +A RegEx for empty lines + +### INDENT\_REGEX + +```gdscript +const INDENT_REGEX: String = "^(?\\s*)" +``` + +A RegEx for finding out the indent of a line + +## Method Descriptions + +### load\_esc\_file + +```gdscript +func load_esc_file(path: String) -> ESCScript +``` + +Load an ESC file from a file resource + +### compile + +```gdscript +func compile(lines: Array) -> ESCScript +``` + +Compiles an array of ESC script strings to an ESCScript \ No newline at end of file diff --git a/docs/api/ESCCondition.md b/docs/api/ESCCondition.md new file mode 100644 index 00000000..e4509dd5 --- /dev/null +++ b/docs/api/ESCCondition.md @@ -0,0 +1,115 @@ + + +# ESCCondition + +**Extends:** [Object](../Object) + +## Description + +A condition to run a command + +## Constants Descriptions + +### COMPARISON\_ACTIVITY + +```gdscript +const COMPARISON_ACTIVITY: int = 4 +``` + +### COMPARISON\_DESCRIPTION + +```gdscript +const COMPARISON_DESCRIPTION: Array = ["Checking if %s %s %s true%s","Checking if %s %s %s equals %s","Checking if %s %s %s greater than %s","Checking if %s %s %s less than %s","Checking if %s is %s active%s"] +``` + +### COMPARISON\_EQ + +```gdscript +const COMPARISON_EQ: int = 1 +``` + +### COMPARISON\_GT + +```gdscript +const COMPARISON_GT: int = 2 +``` + +### COMPARISON\_LT + +```gdscript +const COMPARISON_LT: int = 3 +``` + +### COMPARISON\_NONE + +```gdscript +const COMPARISON_NONE: int = 0 +``` + +### REGEX + +```gdscript +const REGEX: String = "^(?!)?(?eq|gt|lt)? ?(?i/)?(?a/)?(?[^ ]+)( (?.+))?$" +``` + +Regex that matches condition lines + +## Property Descriptions + +### flag + +```gdscript +var flag: String +``` + +Name of the flag compared + +### negated + +```gdscript +var negated: bool = false +``` + +Wether this condition is negated + +### inventory + +```gdscript +var inventory: bool = false +``` + +Wether this condition is regarding an inventory item ("i/...") + +### comparison + +```gdscript +var comparison: int +``` + +An optional comparison type. Use the COMPARISON-Enum + +### comparison\_value + +```gdscript +var comparison_value +``` + +The value used together with the comparison type + +## Method Descriptions + +### \_init + +```gdscript +func _init(comparison_string: String) +``` + +Create a new condition from an ESC condition string + +### run + +```gdscript +func run() -> bool +``` + +Run this comparison against the globals \ No newline at end of file diff --git a/docs/api/ESCDialog.md b/docs/api/ESCDialog.md new file mode 100644 index 00000000..8a8d3023 --- /dev/null +++ b/docs/api/ESCDialog.md @@ -0,0 +1,96 @@ + + +# ESCDialog + +**Extends:** [ESCStatement](../ESCStatement) < [Object](../Object) + +## Description + +An ESC dialog + +## Constants Descriptions + +### END\_REGEX + +```gdscript +const END_REGEX: String = "^(?\\s*)!.*$" +``` + +A Regex that matches the end of a dialog + +### REGEX + +```gdscript +const REGEX: String = "^(\\s*)\\?( (?[^ ]+))?( (?[^ ]+))?( (?[^ ]+))?( (?.+))?$" +``` + +Regex that matches dialog lines + +## Property Descriptions + +### type + +```gdscript +var type: String = "" +``` + +Dialog type +FIXME, currently unused, but needs reimplementation + +### avatar + +```gdscript +var avatar: String = "" +``` + +Avatar used in the dialog + +### timeout + +```gdscript +var timeout: int = 0 +``` + +Timeout until the timeout_option option is selected. Use 0 for no timeout + +### timeout\_option + +```gdscript +var timeout_option: int = 0 +``` + +The dialog option to select when timeout is reached + +### options + +```gdscript +var options: Array +``` + +A list of ESCDialogOptions + +## Method Descriptions + +### \_init + +```gdscript +func _init(dialog_string: String) +``` + +Construct a dialog from a dialog string + +### is\_valid + +```gdscript +func is_valid() -> bool +``` + +Dialogs have no conditions, just return true + +### run + +```gdscript +func run() +``` + +Run this dialog \ No newline at end of file diff --git a/docs/api/ESCDialogOption.md b/docs/api/ESCDialogOption.md new file mode 100644 index 00000000..c60fae5b --- /dev/null +++ b/docs/api/ESCDialogOption.md @@ -0,0 +1,55 @@ + + +# ESCDialogOption + +**Extends:** [ESCStatement](../ESCStatement) < [Object](../Object) + +## Description + +An option of an ESC dialog + +## Constants Descriptions + +### REGEX + +```gdscript +const REGEX: String = "^[^-]*- \"(?