Using lockable exits

From QuestWiki
Jump to: navigation, search

Creating the exit

You can create an exit which is impassable until something else happens in your game. This could be a locked door, or perhaps something like a guard blocking the way.

Let's create a locked door in the kitchen, leading to a back garden. Create the following three elements:

Tick the "Locked" box on the Exit editor. You should see a warning message that we need to give the exit a name. This is because, to unlock the exit during the game, we will need to use a script command. The script command will need some way of referring to this particular exit, which is why we need to give it a name here. Call it something like "garden exit".

Lockedexit.png

Unlocking the exit with a script

Go to the door object, and on the Verbs tab add a verb "unlock". Set it to "Run a script", and then add a command to print a message (such as "You unlock you door"). Add an "unlock exit" command, and choose "garden exit" from the list.

Unlockexit.png

Run the game and verify that the exit now works correctly:

> south
That way is locked.

> unlock door
You unlock the door.

> south
You are in a garden.
You can go north.

Tutorial

Beginners

  1. Introduction
  2. Creating a simple game
  3. Interacting with objects

Intermediate

  1. Using scripts
  2. Custom attributes
  3. Custom commands
  4. More things to do with objects
  5. Using containers
  6. Moving objects during the game

Advanced

  1. Using timers and turn scripts
  2. Changing templates
  3. Text formatting
  4. Using lockable exits
  5. Using lockable containers
  6. Using walkthroughs
  7. Multiple choices - using a "switch" script
  8. Debugging your game
  9. Releasing your game

Elite

  1. Creating functions which return a value
  2. Using inherited types
  3. Using libraries
  4. Using Javascript
Personal tools
Namespaces
Variants
Actions
Navigation
Quest Documentation
Toolbox