Issue 315 (#341)

* feat: accept_input implemented

* feat: More fixes for accept_input and tests for it

* feat: play_snd implemented

* fix: Removed game_over and queue_animation commands

* docs: Automatic update of API docs

* fix: FIxes schedule_event command

* feat: Implemented slide and slide_block

* feat: Implemented turn_to

* docs: Automatic update of API docs

Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
Co-authored-by: dploeger <dploeger@users.noreply.github.com>
This commit is contained in:
Dennis Ploeger
2021-07-29 23:05:24 +02:00
committed by GitHub
parent df1ec0c814
commit 90f880d090
38 changed files with 622 additions and 480 deletions

View File

@@ -17,7 +17,6 @@ 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

View File

@@ -35,7 +35,7 @@ Preload the dialog UI resources
### say
```gdscript
func say(character: String, params: Dictionary) -> var
func say(character: String, ui: String, line: String) -> var
```
A short one line dialog
@@ -43,8 +43,8 @@ A short one line dialog
#### Parameters
- character: Character that is talking
- params: A dictionary of parameters. Currently only "line" is supported and
holds the line the character should say
- ui: UI to use for the dialog
- line: Line to say
### finish\_fast

View File

@@ -1,6 +1,6 @@
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
# inputs\_manager.gd
# ESCInputsManager
**Extends:** [Node](../Node)
@@ -9,8 +9,36 @@
Escoria inputs manager
Catches, handles and distributes input events for the game
## Constants Descriptions
### INPUT\_ALL
```gdscript
const INPUT_ALL: int = 0
```
### INPUT\_NONE
```gdscript
const INPUT_NONE: int = 1
```
### INPUT\_SKIP
```gdscript
const INPUT_SKIP: int = 2
```
## Property Descriptions
### input\_mode
```gdscript
var input_mode
```
The current input mode
### hover\_stack
```gdscript

View File

@@ -346,7 +346,9 @@ Set the angle
#### Parameters
Set the angle
- deg: The angle degree to set
- immediate: Set the angle immediately. If false will show intermediate
angles
### start\_talking

View File

@@ -34,4 +34,14 @@ The number of seconds until the event is run
func _init(p_event: ESCEvent, p_timeout: float)
```
Create a new scheduled event
Create a new scheduled event
### run
```gdscript
func run() -> int
```
Run the event
**Returns** The execution code

View File

@@ -1,35 +0,0 @@
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
# GameOverCommand
**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node)
## Description
`game_over continue_enabled show_credits`
Ends the game. Use the "continue_enabled" parameter to enable or disable the
continue button in the main menu afterwards. The "show_credits" parameter
loads the ui/end_credits scene if true. You can configure it to your regular
credits scene if you want.
@STUB
@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

View File

@@ -6,13 +6,11 @@
## Description
`play_snd object file [loop]`
`play_snd file [player]`
Plays the sound specificed with the "file" parameter on the object, without
blocking. You can play background sounds, eg. during scene changes, with
`play_snd bg_snd res://...`
Plays the sound specificed with the "file" parameter on the sound player
`player`, without blocking. (player defaults to bg_sound)
@STUB
@ESC
## Method Descriptions
@@ -25,6 +23,14 @@ 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

View File

@@ -1,42 +0,0 @@
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
# QueueAnimationCommand
**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node)
## Description
`queue_animation object animation`
Similar to queue_resource, queues the resources necessary to have an
animation loaded on an item. The resource paths are taken from the item
placeholders.
@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

View File

@@ -2,7 +2,7 @@
# SlideBlockCommand
**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node)
**Extends:** [SlideCommand](../SlideCommand) < [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node)
## Description
@@ -18,26 +18,10 @@ where the player can't walk.
## 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
func run(command_params: Array) -> var
```
Run the command

View File

@@ -1,40 +0,0 @@
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
# SpawnCommand
**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node)
## Description
`spawn path [object2]`
Instances a scene determined by "path", and places in the position of
object2 (object2 is optional)
@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

View File

@@ -6,7 +6,7 @@
## Description
`turn_to object degrees`
`turn_to object degrees [immediate]`
Turns object to a degrees angle with a directions animation.
@@ -15,6 +15,9 @@ When turning to the destination angle, animations are played if they're
defined in animations. object must be player or interactive. degrees must
be between [0, 360] or an error is reported.
Set immediate to true to show directly switch to the direction and not
show intermediate angles
@STUB
@ESC

View File

@@ -6,6 +6,8 @@
## Description
A dialog GUI showing a dialog box and character portraits
## Property Descriptions
### current\_character
@@ -16,29 +18,7 @@ export var current_character = ""
- **Setter**: `set_current_character`
### avatar\_node
```gdscript
var avatar_node
```
### name\_node
```gdscript
var name_node
```
### text\_node
```gdscript
var text_node
```
### tween
```gdscript
var tween
```
The currently speaking character
### text\_speed\_per\_character
@@ -46,18 +26,56 @@ var tween
export var text_speed_per_character = 0.1
```
The text speed per character for normal display
### fast\_text\_speed\_per\_character
```gdscript
export var fast_text_speed_per_character = 0.25
```
The text speed per character if the dialog line is skipped
### max\_time\_to\_text\_disappear
```gdscript
export var max_time_to_text_disappear = 1
```
The time to wait before the dialog is finished
### avatar\_node
```gdscript
var avatar_node
```
The node holding the avatar
### name\_node
```gdscript
var name_node
```
The node holding the player name
### text\_node
```gdscript
var text_node
```
The node showing the text
### tween
```gdscript
var tween
```
The tween node for text animations
## Method Descriptions
### set\_current\_character
@@ -66,19 +84,32 @@ export var max_time_to_text_disappear = 1
func set_current_character(name: String)
```
Switch the current character
#### Parameters
- name: The name of the current character
### say
```gdscript
func say(character: String, params: Dictionary)
func say(character: String, line: String)
```
Make a character say something
#### Parameters
- character: The global id of the character speaking
- line: Line to say
### finish\_fast
```gdscript
func finish_fast()
```
Called by the dialog player when the
## Signals
- signal dialog_line_started():
- signal dialog_line_finished():
- signal dialog_line_started(): Signal emitted when a dialog line has started
- signal dialog_line_finished(): Signal emitted when a dialog line has finished

View File

@@ -6,38 +6,34 @@
## Description
A dialog UI using a label above the head of the character
## Property Descriptions
### tween
```gdscript
var tween
```
### text\_node
```gdscript
var text_node
```
### text\_speed\_per\_character
```gdscript
export var text_speed_per_character = 0.1
```
The text speed per character for normal display
### fast\_text\_speed\_per\_character
```gdscript
export var fast_text_speed_per_character = 0.25
```
The text speed per character if the dialog line is skipped
### max\_time\_to\_text\_disappear
```gdscript
export var max_time_to_text_disappear = 2
```
The time to wait before the dialog is finished
### current\_character
```gdscript
@@ -46,21 +42,45 @@ var current_character
Current character speaking, to keep track of reference for animation purposes
### tween
```gdscript
var tween
```
Tween node for text animation
### text\_node
```gdscript
var text_node
```
The node showing the text
## Method Descriptions
### say
```gdscript
func say(character: String, params: Dictionary)
func say(character: String, line: String)
```
Make a character say something
#### Parameters
- character: The global id of the character speaking
- line: Line to say
### finish\_fast
```gdscript
func finish_fast()
```
Called by the dialog player when the
## Signals
- signal dialog_line_started():
- signal dialog_line_finished():
- signal dialog_line_started(): Signal emitted when a dialog line has started
- signal dialog_line_finished(): Signal emitted when a dialog line has finished

View File

@@ -132,7 +132,7 @@ Terrain of the current room
### dialog\_player
```gdscript
var dialog_player
var dialog_player: ESCDialogsPlayer
```
Dialog player instantiator. This instance is called directly for dialogs.
@@ -180,7 +180,7 @@ The main scene
### inputs\_manager
```gdscript
var inputs_manager
var inputs_manager: ESCInputsManager
```
The escoria inputs manager

View File

@@ -140,8 +140,6 @@ Some commands will block execution of the event until they finish, others won't.
<!-- ESCCOMMANDS -->
#### <a name="AcceptInputCommand.md"></a>`accept_input [ALL|NONE|SKIP]` [API-Doc](api/AcceptInputCommand.md)
**This command is currently not fully implemented.**
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.
@@ -222,14 +220,6 @@ both be integers.
Enable the ESCTerrain's NavigationPolygonInstance defined by given node name.
Disables previously activated NavigationPolygonInstance.
#### <a name="GameOverCommand.md"></a>`game_over continue_enabled show_credits` [API-Doc](api/GameOverCommand.md)
**This command is currently not fully implemented.**
Ends the game. Use the "continue_enabled" parameter to enable or disable the
continue button in the main menu afterwards. The "show_credits" parameter
loads the ui/end_credits scene if true. You can configure it to your regular
credits scene if you want.
#### <a name="IncGlobalCommand.md"></a>`inc_global name value` [API-Doc](api/IncGlobalCommand.md)
Adds the value to global with given "name". Value and global must both be
@@ -240,20 +230,10 @@ Add an item to the inventory
#### <a name="InventoryRemoveCommand.md"></a>`inventory_remove item` [API-Doc](api/InventoryRemoveCommand.md)
Remove an item from the inventory.
#### <a name="PlaySndCommand.md"></a>`play_snd object file [loop]` [API-Doc](api/PlaySndCommand.md)
#### <a name="PlaySndCommand.md"></a>`play_snd file [player]` [API-Doc](api/PlaySndCommand.md)
**This command is currently not fully implemented.**
Plays the sound specificed with the "file" parameter on the object, without
blocking. You can play background sounds, eg. during scene changes, with
`play_snd bg_snd res://...`
#### <a name="QueueAnimationCommand.md"></a>`queue_animation object animation` [API-Doc](api/QueueAnimationCommand.md)
**This command is currently not fully implemented.**
Similar to queue_resource, queues the resources necessary to have an
animation loaded on an item. The resource paths are taken from the item
placeholders.
Plays the sound specificed with the "file" parameter on the sound player
`player`, without blocking. (player defaults to bg_sound)
#### <a name="QueueResourceCommand.md"></a>`queue_resource path [front_of_queue]` [API-Doc](api/QueueResourceCommand.md)
Queues the load of a resource in a background thread. The `path` must be a
@@ -345,10 +325,6 @@ Moves object1 towards the position of object2, at the speed determined by
object1's "speed" property, unless overridden. This command is non-blocking.
It does not respect the room's navigation polygons, so you can move items
where the player can't walk.
#### <a name="SpawnCommand.md"></a>`spawn path [object2]` [API-Doc](api/SpawnCommand.md)
Instances a scene determined by "path", and places in the position of
object2 (object2 is optional)
#### <a name="StopCommand.md"></a>`stop` [API-Doc](api/StopCommand.md)
Stops the event's execution.
@@ -360,7 +336,7 @@ FIXME re-add the angle parameter here
Sets the position of object1 to the position (x,y).
FIXME re-add the angle parameter here
#### <a name="TurnToCommand.md"></a>`turn_to object degrees` [API-Doc](api/TurnToCommand.md)
#### <a name="TurnToCommand.md"></a>`turn_to object degrees [immediate]` [API-Doc](api/TurnToCommand.md)
**This command is currently not fully implemented.**
@@ -370,6 +346,9 @@ Turns object to a degrees angle with a directions animation.
When turning to the destination angle, animations are played if they're
defined in animations. object must be player or interactive. degrees must
be between [0, 360] or an error is reported.
Set immediate to true to show directly switch to the direction and not
show intermediate angles
#### <a name="WaitCommand.md"></a>`wait seconds` [API-Doc](api/WaitCommand.md)
Blocks execution of the current script for a number of seconds specified by the "seconds" parameter.
@@ -407,7 +386,6 @@ Makes the `player` walk to the position `x`/`y`.
## Dialogs
Dialogs are specified by writing `?` with optional parameters, followed by a list of dialog options starting with `-`. Use `!` to end the dialog.