Difference between revisions of "NML:Block syntax"
(add nav template) |
Planetmaker (talk | contribs) (Overview page for general language structure) |
||
Line 1: | Line 1: | ||
{{NMLNavBlocksyntax}} |
{{NMLNavBlocksyntax}} |
||
+ | |||
+ | == Syntax == |
||
In the next sections you'll often see a word enclosed by the less-than and greater-than symbols. These words should not be written literally, instead they reference to another block/item you should put there. The following words will be used: |
In the next sections you'll often see a word enclosed by the less-than and greater-than symbols. These words should not be written literally, instead they reference to another block/item you should put there. The following words will be used: |
||
Line 13: | Line 15: | ||
If something is enclosed by square brackets [] it's optional. |
If something is enclosed by square brackets [] it's optional. |
||
+ | |||
+ | {{NML:Blocks}} |
||
+ | {{NML:Features}} |
Revision as of 00:51, 9 September 2011
Vehicles, Stations, Canals, Bridges, Towns, Houses, Industries (Tiles), Cargos, Airports+Tiles, Objects, Railtypes, Roadtypes, Tramtypes, Terrain
Syntax
In the next sections you'll often see a word enclosed by the less-than and greater-than symbols. These words should not be written literally, instead they reference to another block/item you should put there. The following words will be used:
- <literal-string>
- A string enclosed by quotes, for example
"this is a literal string"
- <string>
- A string defined in the language file, for example
string(STR_GRF_NAME)
- <expression>
- An expression, this can be a computation or single value constructed using <number>, <float>, <parameter>, <variable>, <function-call>
- <ID>
- The name of an item or block. IDs should start with a letter or underscore. The rest of the ID may consist of letters, underscores and numbers.
If something is enclosed by square brackets [] it's optional.
Railtypetable / Roadtypetable / Tramtypetable
Overriding vehicles in other NewGRFs
Sorting vehicles in the purchase list
Features
NewGRFs can be used to modify various types of items. Examples include trains, stations and industries. Such a type of item is called a feature. The following table contains a list of features and their identifiers. These identifiers may be used to refer to the feature when needed.
Name | Description |
---|---|
FEAT_TRAINS | Trains |
FEAT_ROADVEHS | Road vehicles |
FEAT_SHIPS | Ships |
FEAT_AIRCRAFT | Aircraft |
FEAT_STATIONS | Train stations |
FEAT_CANALS | Canals |
FEAT_BRIDGES | Bridges |
FEAT_HOUSES | Town houses |
FEAT_GLOBALVARS | Various global variables |
FEAT_INDUSTRYTILES | Industry tiles (visible part of industries) |
FEAT_INDUSTRIES | Industries |
FEAT_CARGOS | Cargo types |
FEAT_SOUNDEFFECTS | Sound effects |
FEAT_AIRPORTS | Airports |
FEAT_SIGNALS | Train signals |
FEAT_OBJECTS | Non-interactive objects (example: lighthouse) |
FEAT_RAILTYPES | Rail types |
FEAT_ROADTYPES | Road types |
FEAT_TRAMTYPES | Tram types |
FEAT_AIRPORTTILES | Airport tiles (visible part of airports) |