Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: action condition configuration #73

Merged
merged 1 commit into from
Jun 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
4. [Location configuration](#location-configuration)
5. [`GameObject` configuration](#gameobject-configuration)
6. [Action configuration](#action-configuration)
7. [Example of full configuration structure](#example-of-full-configuration-structure)
8. [Example configurations](#example-configurations)
7. [Condition configuration](#condition-configuration)
8. [Example of full configuration structure](#example-of-full-configuration-structure)
9. [Example configurations](#example-configurations)

## Root directory

Expand Down Expand Up @@ -177,7 +178,9 @@ common part first. Each action consists of following properties

* `tag` - Action tag; this is required however it is not used for now. Action tag does not have to be unique for now.
* `type` - One of action types mentioned above.
* *(optional)* `before` - Configuration of action to be triggered before the proper action is executed,
* *(optional)* `condition` - Condition configuration. The action won't be executed until the condition is satisfied.
Aliases: `requires`. See [condition configuration](#condition-configuration)
* *(optional)* `before` - Configuration of action to be triggered before the proper action is executed.
e.g. you may want to change location before starting the dialogue. (TODO: Logic is not implemented as for now).
* *(optional)* `after` - Configuration of action to be triggered after the proper action is executed, e.g. you may want
give player some output or item. (TODO: Logic is not implemented as for now).
Expand Down Expand Up @@ -212,6 +215,15 @@ Let's look at specific action types:
* `assetPath` - Path to the image with background for the dialogue window. As any path, it must be eiter absolute or relative to the engine's source root.
Aliases: `asset-path`, `asset`.

## Condition configuration

Describes condition that must be satisfied before the action can be executed.

Condition consists of following properties:

* `type` - One of types:
* `item-required` - Requires following props:
* `item-tag` - Tag of the item that must be in the player inventory for the action to be executed.

## Example of full configuration structure

Expand Down