Hi Gamepedia users and contributors! Please complete this survey to help us learn how to better meet your needs in the future. We have one for editors and readers. This should only take about 7 minutes!

Extension:Tilesheets

From Gamepedia Help Wiki
Jump to: navigation, search
Tilesheets
Version 4.2.1
Author(s) Jinbobo
Peter Atashian
Eli Foster
Telshin
Noahm
Cameron Chunn
Extension link GitHub
Requirements OreDict (optional integration)
Description
Adds a parser function that looks up a table for an item and returns the requested image.

The Tilesheets extension adds a parser function to select a set item in an image of tiles, or sprites. It uses the OreDict extension, so that should typically be installed as well. Tilesheets can be any size, but they are typically "16, 32". The size indicates the size of the individual tiles (as in 16x16 and 32x32 in this case).

Special pages[edit | edit source]

  • CreateTileSheet - Create a new tilesheet by supplying a mod abbreviation, the sizes of the tilesheets separated by commas, and a list of tile coordinates with their according tile names.
  • SheetList – Lists all tilesheets on the wiki.
  • SheetManager – Used to edit a single tilesheet's data.
  • TileList – Lists all tiles on the wiki.
  • TileManager – Used to edit a single tile's data.
  • TileTranslator – Used to edit the translation data (name and description, in any language code) of a given tile.
  • ViewTile – Used to show a specific tile at all of its sizes. The tiles are displayed in a table. It provides no forms, so the tile entry ID must be supplied using subpage syntax (for example, Special:ViewTile/1 to show the tile at entry ID 1).
  • WhatUsesThisTile – Lists all uses of a given tile ID, essentially a version of Special:WhatLinksHere for tiles. Uses subpage syntax.

Usage[edit | edit source]

The Tilesheets extension has an API, so it can be used both on the wiki directly, and through MediaWiki's web API.

For non-API usage information, please read the Tilesheet update guide on the FTB Gamepedia site.

Parser functions[edit | edit source]

#icon[edit | edit source]

Outputs the HTML to produce a single tile icon.

Parameters[edit | edit source]
  • item: The name of the item.
  • mod: The mod abbreviation of the item. Defaults to "undefined", which will produce an error.
  • size: The size of tile to retrieve. Defaults to "32".

#iconloc[edit | edit source]

Outputs the localized name or description for a single tile, in the specified language. If there is no localized name or description, it will fall back to the provided item's name.

Parameters[edit | edit source]
  • The name of the item (not localized).
  • The mod abbreviation.
  • The type of data to get. Must be either "name" or "description". Defaults to "name".
  • The language code to get the localized data for. Defaults to "en".

API[edit | edit source]

The Tilesheets extensions provides MediaWiki API action modules for interacting with the extension. The parameters are prefixed with ts.

action=addtiles[edit | edit source]

Adds a set of tiles to a given tilesheet.

Parameters[edit | edit source]

  • token (csrf)
  • summary (String): (Optional) An option edit summary.
  • mod (String): (Required) The tile name.
  • import (String, separate multiple values with "|"): (Required) A pipe separated list of entries formatted as X Y Item Name.

Returns[edit | edit source]

  • edit
    • addtiles
      • Tile name => The new entry ID for the tile

Possible errors[edit | edit source]

  • permissiondenied: User does not have the edittilesheets permission.
  • nosheetfound: There is no tilesheet for the provided mod abbreviation.

action=deletesheet[edit | edit source]

Deletes tilesheets by the mod abbreviations specified.

Parameters[edit | edit source]

  • mods (String): (Required, separate values with "|") The mod abbreviations to delete.
  • summary (String): (Optional) An optional edit summary.
  • token (csrf)

Returns[edit | edit source]

  • edit
    • deletesheet
      • Mod abbreviation => Whether the deletion of this sheet was successful (boolean)
      • ...

Possible errors[edit | edit source]

  • permissiondenied: User does not have the edittilesheets permission.

action=createsheet[edit | edit source]

Creates a new tilesheet with the given mod abbreviation and sizes.

Parameters[edit | edit source]

  • token (csrf)
  • summary (String): (Optional) An optional edit summary.
  • mod (String): (Required) The mod abbreviation.
  • sizes (String, separate multiple values with "|"): (Defaults to "16|32") Pipe separated list of tile sizes.

Returns[edit | edit source]

  • edit
    • createsheet
      • Provided mod abbreviation => Whether it was successfully created (boolean).

Possible errors[edit | edit source]

  • permissiondenied: User does not have the edittilesheets permission.

action=deletetiles[edit | edit source]

Deletes individual tile entries from the database.

Parameters[edit | edit source]

  • token (csrf)
  • summary (String): (Optional) An optional edit summary.
  • ids (Integer, separate values with "|", minimum value is "1"): (Required) A list of entry IDs to delete.

Returns[edit | edit source]

  • edit
    • deletetiles
      • Entry ID => Whether it was successfully deleted (boolean)
      • ...

Possible errors[edit | edit source]

  • permissiondenied: User does not have the edittilesheets permission.

action=editsheet[edit | edit source]

Edits a sheet's data.

Parameters[edit | edit source]

  • token (csrf)
  • summary (String): (Optional) An optional edit summary.
  • mod (String): (Required) The current mod abbreviation.
  • tomod (String): (Optional) The new mod abbreviation.
  • tosizes (Integer, separate multiple values with "|"): (Optional) A pipe separated list of new sizes.

Returns[edit | edit source]

  • edit
    • editsheet
      • Old mod abbreviation => New mod abbreviation (identical if no change)
      • Old sheet sizes => New sheet sizes (identical if no change)

Possible errors[edit | edit source]

  • permissiondenied: User does not have the edittilesheets permission.
  • nochangeparams: None of tomod or tosizes are set.
  • noentry: The mod abbreviation does not exist.
  • nochange: Both tomod and tosizes are set to the existing mod abbreviation and sizes.
  • updateerror: Some database error has occurred in updating the table; this does not necessarily mean that the change was not made.

action=edittile[edit | edit source]

Edits a tile entry's data.

Parameters[edit | edit source]

  • token (csrf)
  • summary (String): (Optional) An optional edit summary.
  • id (Integer): (Required) The entry ID for the tile.
  • toname (String): The new item name.
  • tomod (String): The new mod abbreviation.
  • tox (Integer): The new X coordinate.
  • toy (Integer): The new Y coordinate.

Returns[edit | edit source]

  • edit
    • edittile
      • The entry's ID => true

Possible errors[edit | edit source]

  • permissiondenied: User does not have the edittilesheets permission.
  • nochangeparams: None of toname, tomod, tox, toy are set.
  • noentry: The entry for the provided ID does not already exist.
  • update: Either the entry does not exist, or the entry's values were not changed in any way.

action=deletetranslation[edit | edit source]

Deletes a translation for an entry ID.

Parameters[edit | edit source]

  • token (csrf)
  • id (Integer, minimum value is "1"): (Required) The entry ID to delete.
  • lang (String): (Required) The language of the entry to delete.

Returns[edit | edit source]

  • edit
    • deletetranslation
      • id => The entry's ID
      • language => The language for which translation was deleted

Possible errors[edit | edit source]

  • entrynotexists: The entry for the provided ID and language does not exist.
  • permissiondenied: User does not have the edittilesheets permission.

action=translatetile[edit | edit source]

Translates the given tile data, either updating or creating a new entry.

Parameters[edit | edit source]

  • token (csrf)
  • id (Integer, minimum value is "1"): (Required) The tile entry ID.
  • lang (String): (Required) The language code to translate to.
  • name (String): (Optional) The localized name.
  • description (String): (Optional) The localized description.

Returns[edit | edit source]

  • edit
    • One of...
    • newtranslation (if the translation is new)
      • entry_id => The entry ID
      • language => The language code being translated to
      • display_name => The display name for the entry and language
      • description => The description for the entry and language
    • translatetile (if the translation already existed, but is now being updated)
      • entry_id => The entry ID
      • language => The language code being translated to
      • display_name => The display name for the entry and language
      • description => The description for the entry and language

Possible errors[edit | edit source]

  • permissiondenied: User does not have the translatetiles permission.
  • nochangeparam: Neither the lang and description parameters were not specified.

action=query&list=tilesheets[edit | edit source]

Get all of the sheets.

This module uses the continuation API. The from parameter is used as the continuation parameter.

Parameters[edit | edit source]

  • limit (Limit, minimum value is "1", maximum value for users is "500", maximum value for bots is "500"): (Defaults to "10") The maximum number of sheets to list.
  • from (String): (Defaults to "") The abbreviation to start listing at.

Returns[edit | edit source]

  • query
    • tilesheets
      • mod => The mod abbreviation.
      • sizes => The sizes for the tilesheet.

Possible errors[edit | edit source]

This module does not make any errors.

action=query&list=tiles[edit | edit source]

Get all of the tiles filtered by mod.

This module uses the continuation API. The from parameter is used as the continuation parameter.

Parameters[edit | edit source]

  • limit (Limit, minimum value is "1", maximum value for users is "500", maximum value for bots is "5000"): (Defaults to "10") The maximum number of tiles to list.
  • from (Integer): (Defaults to "0") The tile ID to start listing at.
  • mod (String): (Defaults to "") The mod to filter by.

Returns[edit | edit source]

  • query
    • tiles
      • 0
        • id => The entry's ID
        • mod => The entry's mod abbreviation
        • name => The item name for the entry
        • x => The entry's X coordinate
        • y => The entry's Y coordinate
      • ...

Possible errors[edit | edit source]

This module does not make any errors.

action=query&list=tiletranslations[edit | edit source]

Get all of the translations for the given entry ID and/or language.

Parameters[edit | edit source]

  • id (Integer, minimum value is "1"): (Required) The entry ID to get translations for.
  • lang (String): (Defaults to "") The language to get translations for.

Returns[edit | edit source]

  • query
    • tiles
      • 0
        • entry_id => The entry's ID
        • description => The description for the entry in this language
        • display_name => The display name for the entry in this language
        • language => The language code for the language of the description and display_name

Possible errors[edit | edit source]

This module does not make any errors.

action=query&list=tileusages[edit | edit source]

Gets all of the pages that are used by a particular tile entry ID.

This module uses the continuation API. The from parameter is used as the continuation parameter.

Parameters[edit | edit source]

  • limit (Limit, minimum value is "1", maximum value for users is "500", maximum value for bots is "5000"): (Defaults to "10") The maximum number of pages to list.
  • from (Integer): (Defaults to "0"): The page ID (not entry ID) to start listing at.
  • tile (Integer): (Defaults to "0", cannot be less than "0"): The tile entry ID to get usages for.
  • namespace (Namespace, separate multiple values with "|"): The namespace to enumerate.

Returns[edit | edit source]

  • query
    • tileusages
      • 0
        • entryid => The entry's ID.
        • pageid => The page ID
        • ns => The namespace
        • title => The name of the page, including its namespace (unless it is main).
      • ...

Possible errors[edit | edit source]

This module does not make any errors.