ProtoRPG:Tileset file
A tileset file is a text file that must be stored in the tilesets subdirectory. It gives a description of all tiles used in a [[ProtoRPG:Map file|map]. Each map must specify which tileset file to use, to allow for sharing tilesets or using customized ones.
Generic format
A tileset is a text file containing a JSON array of tiles :
[ { "id": 0, "title": "some grass", "file": "tiles0.png" }, { "id": 1, "title": 'a wooden door', "blocking": 2, "file": ['tiles0.png',2], "onUse": { "action": "replace", "newTile": 0 } }
Tile formats
Each tile must have at least :
- an id (which must be the number of appearance in the array, starting from 0)
- a title, which gives a short description of the tile (the text will be shown to the user when looking at the tile)
- a "file" attribute that tells which graphics to use
Optional attributes
The following attributes are optional :
- blocking : set to 2 if the tile is blocking (doesn't allow player to walk over it), 0 if not blocking (this is the default)
- opaque : tells if the tile is blocking the view. A value of 0 means the player can see through (i.e: grass), 2 means he can't (i.e: wall), and 1 means it's opaque except when the player is standing next to it (this is useful to give a "small window" effect: one can see what's beyond when standing next to it, but not in other situations). By default opaque takes value 0 for non blocking tiles, or 2 for blocking ones.
- onUse, onLook, onWalk, onPush, onGet : an action to perform when the following events occur.