Page 1 of 1

[NoGo] TileLabels library

Posted: 18 Feb 2012 14:53
by Zuu
TileLabels is a library that let you put signs in a scenario and then access the location of those tiles by their name. This library removes all the signs and keep them in memory for you so that players won't see them.

The library supports (and encourages) a prefix for these special signs. Signs that doesn't contain this prefix will be untouched.

For more information see the README.txt or download the library. Version 7 of the Beginner Tutorial will use this library, but there is also a simple example in the readme.

Download
Use in-game download or the bananas website

Re: [NoGo] TileLabels library

Posted: 28 Jun 2014 12:40
by Wahazar
Hello,
I need advice, as game script beginner, how to change example from readme.txt, to iterate among many labels.
I want to read all labels and create list or array of tile id and parameters derived from label string.

Re: [NoGo] TileLabels library

Posted: 29 Jun 2014 08:53
by Zuu
There is no such public function in this library. All it got is really the GetTile method that get the tile from a label string.

If you are adventures, you could neglect that you shouldn't deal with internal parts of an library and read the tile_table member yourself. However, it would be better to take a step back and ask yourself what questions do you like to ask to the list of all tiles and add a public method to this library for those questions. You cannot upload changes to the library, only I can, but you can submit me a patch or tell me what the questions are and hope that I have time to add that.

Re: [NoGo] TileLabels library

Posted: 30 Jun 2014 12:20
by Ma-ma

Code: Select all

foreach( sign_name, tile_index in this.tile_labels.tile_table )
{
  //  sign_name type is string
  // tile_index type is TileIndex

  print( "name " + sign_name + "   tile " + tile_index )

}
Sign names must be unique,
function TileLabels::ReadFromMap line
local pre_part = sign_content.slice(0, this.prefix.len());

produces "Your script made an error: slice out of range"
if prefix is longer than shortest sign on map