-
Notifications
You must be signed in to change notification settings - Fork 17
Walk throughs
NOTE: The walk-though command is only available if settings.playMode is set to "dev" in setting.js. Remember to set it to "play" before releasing your game.
Walk-throughs can be very useful when creating your game as they can get you past the bit of your game you have already done very easily. They can also be used for testing, but can lead to you only ever trying one route, so are limited and should be used with care.
You can have several walk-throughs in your game. Create a dictionary called "walkthroughs". Each entry is a walkthrough, i.e., an array of commands to be performed.
Here is a very simple example:
const walkthroughs = {
a:[
"n", "w", "n",
]
}To use the walk-through, go into the game, and type WT . In the above example, that would be WT A (do not use numbers, either letters or words, the parser may get confused).
Use a dictionary rather than a string to handle menu options and questions. The "cmd" attribute should be the command. the "menu" attribute can be a string or number, or array of strings and numbers. Use numbers for menus and strings for questions.
const walkthroughs = {
a:[
"e",
"s",
{cmd:"talk to lara", menu:0},
{cmd:"talk to kyle", menu:[0, 2]},
],
}Note that menu options start at zero.
To record a set of commands, use the transcript system.
Start recording with SCRIPT ON, and stop with SCRIPT OFF. To see the transcript, do SCRIPT WALK; the code will appear in a new tab. Copy-and-paste into your code, and modify as required (it defaults to "recorded" as a name).
Note that unlike the normal transcript, the walk-though transcript is reset by SCRIPT ON, is not affected by TRANSCRIPT CLEAR and is not saved to localStorage, so will be lost when you reload the page or navigate elsewhere. Commands that start SCRIPT or TRANSCRIPT are not recorded (they can cause your walkthrough to act strangely); this is controlled through lang.noWalkthroughRegex, which you could modify to ignore other commands (or for other languages).
If you have disabled the command line, use these commands in the developer console:
saveLoad.transcriptStart()
saveLoad.transcriptEnd()
saveLoad.transcriptWalk()When testing your game, you may find you want to run a walk-through a lot. To make that faster, there are three short-cuts.
| Name | Short cut |
|---|---|
| a | alt-KeyPad0 |
| b | ctrl-alt-KeyPad0 |
| c | ctrl-KeyPad0 |
You need to have "num lock" on (and a keypad on your keyboard).
Once you have the first draft of your game, it can be useful to quickly get to one point in the game when you realise there is an error there that needs to be resolved. If you have a walk-through that gets you all the way to the end, you can very quickly do this by just commenting out the bits you do not want. The best way to do this is using a multi-line comment (/* and */), with an empty comment at the end. Thus, your walk-through might look like this:
const walkthroughs = {
a:[
"get hat",
"wear hat",
"x grass",
"smell",
"x box",
"read label",
"open box",
"get crowbar",
"remove hat",
"put it in box",
"close lid",
"crowbar shed",
"east",
"get torch",
"out",
"sw",
"turn on torch",
"down",
"turn on light",
/* */
]
}The comment at the end does nothing, but if we insert a break part way though, it becomes the end of the comment. Say I have an issue inside the shed, I can comment out everything after getting to that point by adding /*, when I am done, remove those two characters.
const walkthroughs = {
a:[
"get hat",
"wear hat",
"x grass",
"smell",
"x box",
"read label",
"open box",
"get crowbar",
"remove hat",
"put it in box",
"close lid",
"crowbar shed",
"east",/*
"get torch",
"out",
"sw",
"turn on torch",
"down",
"turn on light",
/* */
"script on",
]
}The "script on" after that means that we are automatically recording a transcript afterwards. When you complete a section, you can quickly do SCRIPT WALK to bring up the transcript, paste the new lines into your existing walk-through, and move on to the next bit of the game.
If your walk-thought is a few hundred lines long, it might not be so easy finding the error and parser messages. You can use the HIGHLIGHT command in game after running the walkthrough when in "dev" mode to highlight these messages - a yellow background is added. This only applies to messages already shown; not new messages.
If there is no command line, you can run the command from the developer console; just paste this in:
runCmd('highlight')
Tutorial
- First steps
- Rooms and Exits
- Items
- Templates
- Items and rooms again
- More items
- Locks
- Commands
- Complex mechanisms
- Uploading
QuestJS Basics
- General
- Settings
- Attributes for items
- Attributes for rooms
- Attributes for exits
- Naming Items and Rooms
- Restrictions, Messages and Reactions
- Creating objects on the fly
- String Functions
- Random Functions
- Array/List Functions
- The
respondfunction - Other Functions
The Text Processor
Commands
- Introduction
- Basic commands (from the tutorial)
- Complex commands
- Example of creating a command (implementing SHOOT GUN AT HENRY)
- More on commands
- Shortcut for commands
- Modifying existing commands
- Custom parser types
- Note on command results
- Meta-Commands
- Neutral language (including alternatives to "you")
- The parser
- Command matching
- Vari-verbs (for verbs that are almost synonyms)
Templates for Items
- Introduction
- Takeable
- Openable
- Container and surface
- Locks and keys
- Wearable
- Furniture
- Button and Switch
- Readable
- Edible
- Vessel (handling liquids)
- Components
- Countable
- Consultable
- Rope
- Construction
- Backscene (walls, etc.)
- Merchandise (including how to create a shop)
- Shiftable (can be pushed from one room to another)
See also:
- Custom templates (and alternatives)
Handing NPCs
- Introduction
- Attributes
- Allowing the player to give commands
- Conversations
- Simple TALK TO
- SAY
- ASK and TELL
- Dynamic conversations with TALK TO
- TALK and DISCUSS
- Following an agenda
- Reactions
- Giving
- Followers
- Visibility
- Changing the player point-of-view
The User Experience (UI)
The main screen
- Basics
- Printing Text Functions
- Special Text Effects
- Output effects (including pausing)
- Hyperlinks
- User Input
The Side Panes
Multi-media (sounds, images, maps, etc.)
- Images
- Sounds
- Youtube Video (Contribution by KV)
- Adding a map
- Node-based maps
- Image-based maps
- Hex maps
- Adding a playing board
- Roulette!... in a grid
Dialogue boxes
- Character Creation
- Other example dialogs [See also "User Input"]
Other Elements
- Toolbar (status bar across the top)
- Custom UI Elements
Role-playing Games
- Introduction
- Getting started
- Items
- Characters (and Monsters!)
- Spawning Monsters and Items)
- Systema Naturae
- Who, When and How NPCs Attack
- Attributes for characters
- Attacking and guarding
- Communicating monsters
- Skills and Spells
- Limiting Magic
- Effects
- The Attack Object
- [Extra utility functions](https://github.com/ThePix/QuestJS/wiki/RPG-Library-%E2%80%90-Extra Functions)
- Randomly Generated Dungeon
- Quests for Quest
- User Interface
Web Basics
- HTML (the basic elements of a web page)
- CSS (how to style web pages)
- SVG (scalable vector graphics)
- Colours
- JavaScript
- Regular Expressions
How-to
Time
- Events (and Turnscripts)
- Date and Time (including custom calendars)
- Timed Events (i.e., real time, not game time)
Items
- Phone a Friend
- Using the USE verb
- Display Verbs
- Change Listeners
- Ensembles (grouping items)
- How to spit
Locations
- Large, open areas
- Region,s with sky, walls, etc.
- Dynamic Room Descriptions
- Transit system (lifts/elevators, buses, trains, simple vehicles)
- Rooms split into multiple locations
- Create rooms on the fly
- Handling weather
Exits
- Alternative Directions (eg, port and starboard)
- Destinations, Not Directions
Meta
- Customise Help
- Provide hints
- Include Achievements
- Add comments to your code
-
End The Game (
io.finish)
Meta: About The Whole Game
- Translate from Quest 5
- Authoring Several Games at Once
- Chaining Several Games Together
- Competition Entry
- Walk-throughs
- Unit testing
- Debugging (trouble-shooting)
Releasing Your Game
Reference
- The Language File
- List of settings
- Scope
- The Output Queue
- Security
- Implementation notes (initialisation order, data structures)
- Files
- Code guidelines
- Save/load
- UNDO
- The editor
- The Cloak of Darkness
- Versions
- Quest 6 or QuestJS
- The other Folders
- Choose your own adventure