Map Properties and Layers Guide
iAppsBeats uses Tiled to create maps for the game, in order to get some basic features such as collision, and water-animation, we use some custom properties in Tiled.
There are some features in Tiled we yet do not support, such as rotating tiles or flipping tiles around.
Properties
Custom Layer Properties
Each layer can have their own custom properties, we use these for basic features:
- drawover: boolean, if true the tile-layer or object will be rendered above the player
- water: boolean, if true, the player will use swim animation when touching tiles in the layer
- collision: boolean, if true, the player will be blocked from walking on the tiles; if you don't specify collision, then it will check the tileset name and make it non-blocking if it contains "ground", "shadow", "snow" or "water"
- tiletypes: boolean, if true, the layer defines tiletypes by tile index:
- GRASS: 0
- TALLGRASS: 1
- BLOCK: 2
- SAND: 3
- BED: 4
- DEEPWATER: 5
- SHALLOWWATER: 6
- TURFPATH: 7
- WOODPATH: 8
- CHAIR: 9
- STONEPATH: 10
- SNOW: 11
- ICE: 12
Custom Map Properties
If you put these properties on the map itself, you can control the overall effect on the map, such as music, or drawover color:
- music: string, filename in music/ folder (include extension but without path) for background music played on the map
- musicareas: string, json array containing music areas, example [{"x":10, "y":10, "w":40, "h":20, "music":"battle.mp3"}]
- cutouthole: boolean, displays a dark map with only a circle around the player visible
- cutoutholenodaynight: boolean, like cutouthole, but only if daynight is disabled in the settings
- cutoutholeradius: integer, in pixels, the radius of the "light" around the player, by default 128
- ambient: string, of format #RRGGBB for red, green, blue ambient color (day-night-effect)
- darkeffect: number, deprecated, makes the map darker, better use the ambient property
- enabledaynight: boolean, enables the default ambient color (daynight) for maps other than the default main map
- nodefaultdoor: boolean, disables the default door at 13,14 in inside maps on Avalonia
- syncall: bool, sends all objects and updates to all players, good for larger spar maps where you want to prevent things disappearing
- nokillscore: boolean, doesn't increase player.kills when killing another player on this map
- disablebombs: boolean, doesn't let player put bombs on this map
- copyrightimage: string, image from /Files/gui folder which is shown at the screen, can be used for pre-release maps or to let players know to not share screenshots of the map
- centerview: boolean, by default only true in maps with "inside" in the name, set to true to make the player always appear in the middle (center)
- nomounts: boolean, set to true to not allow riding mounts or driving cars in this map
Custom Object Properties
These are some custom properties used for NPCs, In order for the game to understand these, you need to set the Property Type
to NPC
. These can only be placed on a Object-Layer, as any other type of layer in Tiled is not supported by the game.
- image: string, filename from npcs/ folder, without path.
- drawunder: boolean, should be rendered underneath the player, defaults false
- nonblocking: boolean, should not block the player, defaults true
- npcclass: string, non-sandboxed class npcs, for more advance functionality. Mostly used for things like Chairs, castleflag, etc. A list of classes can be obtained by asking server admin.
- scriptclasses: string, an comma separated list of scripted npcs in
scriptclasses/
folder of the Script repository. - tileHeight: int, sets the interactive height of the npc, multiplied by the
main.json
tilesize (32 pixels). - tileWidth: int, sets the interactive width of the npc, multiplied by the
main.json
tilesize (32 pixels).
You can also provide other properties which can be used by npc-classes or script-classes, as this.
variable. e.g.
npcclass: destructable
image: barrel.png
buildingname: BlackOut
tileHeight: 1
tileWidth: 1
where buildingname is this.buildingname inside the npcclass destructable.
Collection of images (Embed in map) layer
With the use of a tileset layer with the type Collection of images
, you can place images on the map inside an Object Layer
that can be used as NPCs in-game. You also need to set the type to NPC
.
However putting custom properties on this tileset for objects (npcs) is not supported by the game, but can be used to easier manage the object properties, but needs to be copied over to the npc when placed on the map.