diff --git a/docs/configuration.md b/docs/configuration.md index f090b4d9..6d2b9bce 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -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 @@ -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). @@ -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