This repository was archived by the owner on Feb 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 216
Examples/items #13
Open
RedSquirrelLabs
wants to merge
17
commits into
alexa-samples:master
Choose a base branch
from
UXVirtual:examples/items
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Examples/items #13
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
@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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
updates