Prompts

The next, and generally largest type of components in Fortune's API.

When inside a specific Fortune room, players have the ability to do actions via prompts.

Rooms can have multiple prompts to access them. Prompts can be typed or spoken and translated through speech recognition on the client, or interactive through other means, e.g. clickable buttons on the web.

All prompts except a few default ones (help action and back action) are contained and unique to a single room, and are linked to another room that a player will enter if a prompt is successful. If unsuccessful, the player stays in the same room with a failure message presented.

Thus, if a game creator wanted to implement a system where in every room a player has the ability to move north with the commands "move north", "go north", etc., these would have to be added for every room in the game, or a custom script would have to be ingested and loaded by the engine that the creator has written to comprise this logic. The engine actively supports loading custom scripts for use cases like this.

A prompt has the following properties:

  • keywords [Array[string]] - list of phrases that can activate the prompt in text; Fortune has basic NLP (natural language processing) and analytical features allowing synonym and similarity matching, so minimal phrases have to be written by the creator

  • itemRequirements [Array[string]] - list of item names that are needed in order for the prompt to successfully activate (optional)

  • results [Object] - results of a prompt; results have the keys: roomToEnter (string) which is the name of the room to enter upon a successful prompt action, successText (string) which is the message to display upon successful prompt action (optional), failText (string) which is the message to display upon failed prompt action (optional), and finally, a itemsGiven (Array[string]) property, which is a list of items to give to the player upon a successful prompt action.

A prompt has the following advanced, optional properties:

  • show [boolean] - shows the prompt as a UI clickable button or card element (optional); by default this is set to false

  • showIfLackingRequirements [boolean] - if true, shows the prompt as visible in the UI even if a player lacks the item requirements of that prompt. If false, then the player will not see the prompt in the UI even if show is set to true, if they do not have the items required in their inventory.

Good to know: Splitting your product into fundamental concepts, objects, or areas can be a great way to let readers deep dive into the concepts that matter most to them.

Last updated