Code Monkey home page Code Monkey logo

Comments (6)

UXVirtual avatar UXVirtual commented on July 19, 2024

Hey @oliverbhull which file are you trying to modify? It seems that certain files are regenerated by the system (mainly config.json, intentSchema.json, scenes.json and utterances.txt). I'm looking at adding similar functionality myself.

from skill-sample-nodejs-adventure-game.

oliverbhull avatar oliverbhull commented on July 19, 2024

In intentHandlers_default.js I was able to create a session.attributes.key and set it equal to 0. If GetKetIntent was called session.attributes key = 1 and added a line to the UseKeyIntent that if key = 1 the door opens else an error message is returned

from skill-sample-nodejs-adventure-game.

UXVirtual avatar UXVirtual commented on July 19, 2024

Interesting approach storing the items as game flags in the session attributes. I spent several hours try to retrofit items into the editor without much luck as it's tricky to see how riot passes around the data loaded from the scenes.json file.

Doesn't seem like intentHandlers_default.js gets regenerated so your approach should in theory work. Unless you're modifying GetKeyIntent and UseKeyIntent that was generated in intentHandlers_generated?

There are gulp tasks available to just zip and upload the files to AWS Lambda without regenerating them, so you might want to try adding the following lines to gulp-tasks/_default.js:

gulp.task('upload', function () {
  runSequence('upload');
});

Running gulp upload from the Terminal while in the root folder of the project should upload the files.

from skill-sample-nodejs-adventure-game.

UXVirtual avatar UXVirtual commented on July 19, 2024

If you're interested I've implemented extra functionality to allow scene flags to be set on entry or exit of a scene. This can allow the user to pick up items (e.g. keys) which can then be used to access other scenes (e.g. opening locked doors). You could use the same system to create combination lock door puzzles where the user must flip switches in the right combination in order to open a door.

It has the GUI to support this in the editor and generates the correct JSON and other files to upload. I still need to add support for an alternate scene description if the user has specific scene flags set (e.g. not showing that there is a key in the room if the user has already picked up the key).

You can see the progress here on my feature branch.

from skill-sample-nodejs-adventure-game.

rejamison avatar rejamison commented on July 19, 2024

Just jumping in to confirm @HAZARDU5's comments. We're generating the skill assets so you can't really modify them directly. Looking forward to see how your feature branch progresses, these sound like great additions!

from skill-sample-nodejs-adventure-game.

UXVirtual avatar UXVirtual commented on July 19, 2024

I've now implemented alternate scene descriptions and fixed a few bugs which caused it to show the original scene description when the "repeat scene" or "go back" utterance. The session flags also now reset when using the "reset skill" utterance. There is also in-line help provided for most of the new fields in the edit scene panel.

I have an example game on my examples/items branch which showcases these new features.

from skill-sample-nodejs-adventure-game.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.