Quests

From Open Surge Engine Wiki
Revision as of 07:34, 25 December 2012 by Alexandre (Talk | contribs) (Loading an arbitrary quest)

Jump to: navigation, search

Quests

Quests are lists of levels. More precisely, quests are human-readable .qst files, located at the quests/ folder, which contain a list of levels which will be played in the specified order by the game engine. They are used when you want to provide your end-user with a customized experience without forcing them to go to the level selector, making the whole affair a more continuous one.

Facts:

  • whenever you select START GAME at the main menu, the Default Quest, located at quests/default.qst, is executed;
  • before the main menu, the Introduction Quest, located at quest/intro.qst, is started. You may use it to make cutscenes.

Loading an arbitrary quest

What if, as a player, you want to load an arbitrary quest? Older versions of the engine featured an "EXTRAS" option at the main menu. That is no longer the case. You may still access the list of available quests by going at the options screen, highlighting the "Stage select" option and then pressing LEFT three times. You will hear a sound effect. Then you press ENTER.

If you're script-savvy, you can load a quest through scripting. See: API Reference.

Case Study: Examining a quest file

In this example, we will be examining a quest file to determine what the game engine reads from it. Note: This is not a true quest file, it is one which was written as an example. If you wish to examine quest files which are currently in use in the game, please look in the quests folder of your opensurge directory.

// -----------------------------------------------------
// example.qst
// Originally designed for: Open Surge Lunar Mod
// Version 1.0
// Author: lunarrush
// -----------------------------------------------------

// quest properties
name            "Example Quest"
author          "lunarrush"
version         "1.0"
description     "An example of a quest"
image           "images/null.png" // because we don't have any specific image

// level list (in order of appearance)
level           "levels/level1.lev"
level           "levels/cutscene1.lev"
level           "levels/level2.lev"
// ... these can go on to the n-th level

Some things you may note:

  • comments: All lines which begin with // are ignored by the engine.
  • name: This is the name of the quest.
  • author: This is the place where the authors of the levels should receive recognition. (Note that in the above example there are two author lines, one which is commented and one which isn't. As a convention, the one which isn't should display the name of the level designer and the commented one should display the name of the person who wrote the quest file.)
  • version: The version of the quest.
  • description: When people scroll over your quest within the game this will be the flavour text they see.
  • image: This will be the image which is displayed when people scroll over your quest. Its size must be 100x75 pixels.
  • level: These are the defined levels. They are placed in the order in which they will appear.

In the above example, we have defined the list of levels as "level1", "cutscene1", and "level2"; that means that the engine will load those levels in that order. Remember, one mistake in the quest will change the order in which the user will see your levels, so ensure that you have them in the order in which you wish them to be displayed.