Solarus quests  1.1
Quest maker's reference
Resource list

The project_db.dat file declares all resources (maps, musics, sprites, items, enemies, etc.) of your quest and their user-friendly names. Each resource usually corresponds to a data file.

The engine needs this file to preload or initialize some resources when the program starts.

The quest editor needs this file to provide graphical components that let the user choose a resource in a list of user-friendly names. For instance, when the user creates a teletransporter on the map, a graphical list lets him choose the destination map of the teletransporter. This list contains the user-friendly name of each map.

We give here the syntax of project_db.dat.

project_db.dat is a text file encoded in UTF-8. The sequence of characters -- (two dashes) marks the beginning of a comment. After them, the rest of the line is ignored. Empty lines are also ignored.

The definition of each resource starts with the name of a resource type (map, tileset, sound, music, sprite, item, enemy or language), followed by an opening brace, and ends with a closing brace. Inside the braces, the properties of the resource are specified. Properties are declared with the syntax key = value and separated with commas. It is allowed to have an extra comma after the last property. String values are enclosed within double quotes. Each resource must have the following two properties:

  • id (string): Id of the element. It should not contain spaces. The id determines the data file(s) of this element.
    • For a map: the id is the name of the map data file without its extension, relative to the maps directory. Note that the first map declared in this file will be the default map.
    • For a tileset: the id is the name of the tileset data file without its extension, relative to the tilesets directory.
    • For a sound: the id is the sound file name without its extension, relative to the sounds directory.
    • For a music: the id is the music file name without its extension, relative to the musics directory.
    • For a sprite: the id is the name of the sprite data file, relative to the sprites directory. The sprite data file may be in a hierarchy of subdirectories. Subdirectories must be separated by a slash "/" character in the sprite id.
    • For an equipment item: the id is the name of the item's Lua script without its extension, relative to the items directory.
    • For an enemy model: the id is the is name of the enemy's Lua script without its extension, relative to the enemies directory.
    • For a language: the id is the name of a subdirectory of the languages directory.
  • description (string): A human-readable name that describes this element. It may contain spaces. It is useful to show to userse something more user-friendly than the id.

Example of a quest resource list file:

map{      id = "outside",      description = "Outside World" }
map{      id = "hero_house",   description = "House of the hero" }
map{      id = "shop",         description = "Shop" }
map{      id = "dungeon_1_1f", description = "Dungeon 1 - First floor" }
map{      id = "dungeon_1_2f", description = "Dungeon 1 - Second floor" }

tileset{  id = "overworld",    description = "Overworld" }
tileset{  id = "house",        description = "House" }
tileset{  id = "dungeon",      description = "Dungeon" }

sound{    id = "door_closed",  description = "Door closing" }
sound{    id = "door_open",    description = "Door opening" }
sound{    id = "enemy_hurt",   description = "Enemy hurt" }
sound{    id = "jump",         description = "Jumping" }
sound{    id = "treasure",     description = "Treasure" }

item{     id = "sword",        description = "Sword" }
item{     id = "bow",          description = "Bow" }
item{     id = "arrow",        description = "Arrows (x1 / x5 / x10)" }

enemy{    id = "soldier",      description = "Soldier" }
enemy{    id = "dragon",       description = "Dragon" }

language{ id = "en",           description = "English" }

In the quest editor, you can add, remove and change the id and the description of resources from the quest tree. Therefore, you probably don't need to edit this file by hand.

Remarks
The syntax of this resource list file is actually valid Lua. The engine internally uses Lua to parse it.