-
Notifications
You must be signed in to change notification settings - Fork 188
Map Files
Maps files are used to produce a meaningful map out of the tileset [Tile Set Definitions].
It's best to use map editor Tiled for this task. The map editor can directly export flare maps via an export plugin. So it is easy to generate the maps visually and then export it to flares own ini style format to save maps.
Flare is interpreting these sections for displaying maps:
-
header
Basic information, such as tileset, tile sizes, name -
layer
Information about tile layers, which you can imagine as a 2 dimensional array of tiles to form the landscape. npc
event
enemy
enemygroup
All other sections are ignored.
The header section may contain these key/value pairs:
width=int
height=int
tilewidth=int
tileheight=int
music=filename
tileset=filename
title=string
The layer section may contain only 2 attributes
-
type
This must be one of these values: -
"background"
-
"fringe"
-
"object"
-
"foreground"
-
"collision"
The first 4 layers are just displayed on screen, whereas background and fringe layer will always be lower than the hero, npcs and enemies. The object layer is a layer which is rendered interleaved with the hero, npc and enemies. This will make sure that the hero can be rendered in front of a tree or behind it and hence be covered by the tree. The foreground layer will always be rendered above the hero, npc and enemies. The collision layer is special. It is not visible, so it will not be rendered and displayed. It will be only used to extract information, where the landscape is walk-able, non-walk-able or where flying can be done. Also the collision layer will be used for drawing the mini map.
-
data
This is followed by a comma separated list of the size as specified in the header section. There should be as many lines as theheight
specification in the header. Each of the lines should have as many entries as thewidth
specification in the header section. Each number in that comma separated list specifies a tile.
An event can be created in tiled using an object layer called event and then placing rectangular objects. events are executed and can alter the map, the hero or enemies (their position or spawn new or change status, i.e. kill the hero in a trap)
An event can have these key/value pairs:
-
type=string
any string. Special handling if the string is one of location=int,int,int,int
hotspot="location" or int,int,int,int
tooltip=string
power_path=int, int, string
-
power_damage=int, int
describing min and max of damage cooldown=int with suffix such as sec, ms, min
- further event component settings. These are: