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
[NoGo] TileLabels library
Moderator: OpenTTD Developers
[NoGo] TileLabels library
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [NoGo] TileLabels library
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.
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.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Re: [NoGo] TileLabels library
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.
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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [NoGo] TileLabels library
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 )
}
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
Who is online
Users browsing this forum: No registered users and 2 guests