Skip to content
This repository was archived by the owner on Feb 21, 2023. It is now read-only.

Examples/items #13

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

RedSquirrelLabs
Copy link

updates

Prompts the user if they want to add a scene or item, then asks them what item they want to connect to.
Describes method of setting and checking flags when scenes are entered, allowing many different options:
- Items that go into users inventory
- Utterances that check if one or more items exist before allowing user to proceed into the linked scene
- Puzzles involving multiple buttons that must be pushed before a door can be opened
Also includes UI for setting the reject card and voice message that is presented to the user if scene entry fails due to unsatisfied entry conditions. Entry conditions have basic logic supporting `AND`, `OR`, `NOT`, `GROUPSTART` and `GROUPEND` which can be used to replicate complicated logic.

e.g.

```
player.poisoned=0
AND
GROUPSTART
inventory.redKey=1
OR
inventory.skeletonKey=1
GROUPEND
```
equates to:

```
if(session.attributes.flags['player.poisoned'] === "0" && (session.attributes.flags.['inventory.redKey'] === "1" || session.attributes.flags.['inventory.skeletonKey'])
```
Also added `chai` and `mocha` tools as a requirement for unit testing and updated `package.json` with new `npm test` command to run unit tests.
If scene `entryConditions` are not met presents the reject card and voice to the user. Now also works when repeating the scene.

TODO: need to add support for alternate scene description text if the scene flags have been set. This will allow items to be picked up from the scene / levers flipped etc and the scene to show the correct description when it is revisited.
Each scene can now specify an alternate voice and card to present to the user if alternate conditions are met. These conditions follow the same format as the reject condition. E.g. the room description can change to show that the user has picked up a "Red Key" and present the user with an alternate list of options that does not include the "Take Red Key" utterance.
The Red Key is located in the Hidden Room. Picking it up and travelling back to the starting room with the four doors will allow Door Number 2 to be opened with the key, allowing them access to a room filled with gold. If the player tries to open Door Number 2 early they will recieve a message saying the door is locked and that they need a Red Key.
Allows secret scene options which appear automatically if user has specific flags set. E.g. a hidden bookcase doorway that has swung open elsewhere in the game.
This is useful for debugging game states without having to manually go through the game activating flags.
@samdobson
Copy link

@RedSquirrelLabs: This looks fantastic! Is there a demo skill where we could see this in use?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants