Skip to content
tcsullivan edited this page Oct 22, 2017 · 7 revisions

world xml

In-game 'worlds' are defined in XML files in the XML folder that you give the path for in config/settings.xml. These files contain the world definition, as well as things like dialogs for NPCs and entity declarations.

XML files can take include statements, in the form <include file="path/to/file.xml"/>. This is critically helpful when defining entities (see the Entities page), so that code does not need to be copied for every XML file. At the moment only one XML file can be included per file.


world tags

<World></World>

Defines the world that the game will load. Tags inside this define the world's charactaristics, and are required for the game to run.

<IndoorWorld></IndoorWorld>

Defines and indoor world. In an indoor world, a tag should be defined (see below).


The following tags go inside the above ones:

<style bgm="assets/music/..." folder="assets/style/..." ></style>

Defines the theme/music for the world.
bgm: The path to the BGM for the world.
folder: The folder containing sprites for the world's environment.
Background layers must then be defined inside the style. These are in the form of <layer path=""/>, where path is the filename of the image for the background layer (the style block's folder attribute is prefixed to this).

<generation> [Lua Code] </generation>

Generates the world's terrain. Necessary for the world to function. To generate the terrain two Lua functions must be written, see the Lua page for what exactly is needed.

<weather>...</weather>

Defines the current weather in the world. Options available are:

  • Sunny

  • Rainy

  • Snowy

Links other worlds to this world, so the player can (for example) walk off the left edge of this world to enter another. left: The XML file for the world to link to the left of this one. right: The XML file for the world to link to the right of this one.

<spawnx>...</spawnx>

Contains the X value that the player should be placed at inside the world on load (saves may override this...)

<time>...</time>

Defines the time that should be set when loading the world. The game's clock goes over a 20000 tick day cycle: 0 is midnight, 10000 is noon.

Entity tags (see the Entities page) are to be used within the World tag to define entities.


dialog tags

Entities can be given dialog. For each entity that has dialog, a Dialog block should be defined:

<Dialog name="..."></Dialog>  

name: The name of the entity this dialog belongs to.

Dialog blocks contain smaller text blocks, labeled with id numbers. These text blocks can contain multiple smaller pieces to affect things like quests, items, etc.

<text id="..." nextid="..."></text>  

id: The id of this text block. Used to give dialog order.
nextid: The id of the next text block linked to this one.


text tags

<set id="..." value="..."/>  

Sets a brice entry to the given value.
id: The id of the brice entry (creating it if it does not exist).
value: The value to give the brice entry.

<give name="..." count="..."/>  

Gives items to the player.
name: The name of the item to take.
count: How much of that item to take.

<quest assign="..." desc="...">...</quest>  
<quest check="..."/>  

Assigns or checks/finishes quests for the player.
assign: The title of the quest being assigned to the player.
desc: The description of the new quest.

  • The body of a quest assign block should contain a comma-separated list of items, quantities, and awards:

    Test item, 4
    Reward,
    Rewarded item, 1

If this was placed in the body of the quest assign tag, the quest would require 4 Test items, with an award of 1 Rewarded item.
check: Checks if the player has met the requirements of the quest with the given title, completing the quest if so.

<option name="..." value="..."/>  

Adds a clickable-option to the dialog box.
name: The text for the option.
value: ...not sure what this does.

<content>...</content>  

The body of this block is trimmed and displayed as dialog.

Clone this wiki locally