diff --git a/README.md b/README.md index 06b4cd3..502c2c2 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ please check out to [the documentation folder](./docs). Detailed guides are available for: - [admins](./docs/guides/admin.md) +- [players](./docs/guides/player.md) ## Contributing diff --git a/docs/guides/admin.md b/docs/guides/admin.md index ad8c52b..a69c8e0 100644 --- a/docs/guides/admin.md +++ b/docs/guides/admin.md @@ -481,7 +481,6 @@ python3 -m taleweave.main \ --optional-actions \ --actions taleweave.systems.sim:init_actions \ --systems taleweave.systems.sim:init_logic - # TODO: add others ``` This will generate a relatively small world with 3 rooms or areas, run for 30 steps, then save the game and shut down. diff --git a/docs/guides/player.md b/docs/guides/player.md index 34ac770..89a5c85 100644 --- a/docs/guides/player.md +++ b/docs/guides/player.md @@ -4,22 +4,62 @@ - [Player's Guide to TaleWeave AI](#players-guide-to-taleweave-ai) - [Contents](#contents) + - [Discord Command Syntax](#discord-command-syntax) - [Prompt Syntax](#prompt-syntax) - [Prompt Function Syntax](#prompt-function-syntax) +## Discord Command Syntax + +*Note 1:* Because TaleWeave AI offers a dynamic set of actions depending on the game world, it does not currently use +Discord's command feature. If you know a way to make this work with constantly-changing actions, please let me know. + +*Note 2:* When interacting with the Discord bot, you need to ping it with each message. Your server admin can allow the +bot to see all messages, with and without pings, but you must ping the bot by default. + +The Discord bot offers the following commands: + +- `!taleweave` or the bot name, if your admin changed it + - prints the name of the active world +- `!help` + - prints the available commands and their parameters +- `!join ` + - join the game as the specified character +- `!leave` + - leave the game, if you are playing +- `!characters` + - list the available characters in the game +- `!players` + - list the players currently in the game + +Other messages will be treated as in-character input and used as your character's action or reply, depending on the +current prompt. + ## Prompt Syntax +The web client displays a menu with all of the available actions on your turn, but you can also input your own actions. + ### Prompt Function Syntax In order to call functions or use actions from your prompt replies, you (or more likely your GUI) can send valid JSON, -or you can use this prompt function syntax. +or you can use this prompt function syntax. Discord and the web client both support this syntax. To use the prompt function syntax, start your prompt with `~` and use the syntax `~action:parameter=value,next=value` where `action` is the name of the action (the function being called) and the remainder are parameters to be passed into the function. +For example: + +```none +~action_move:direction=north +~action_tell:character=Alice,message=Hello +~action_use:item=potion +``` + There are some limits on this syntax: - the function name cannot contain `:` + - this is true in Python as well and should not be a problem - the parameter names cannot contain `=` + - this is also true in Python and should not be a problem - the values cannot contain `,` + - this is a problem and support for quotes is needed