NML:Parameter assignment

From GRFSpecs
Jump to navigationJump to search
NewGRF Meta Language
Preface
Getting started
Graphics files
Blocks
Units
Expressions
Elementary values
Builtin functions
Language files
Lists of props, vars and CBs
Warnings
Additional references
NewGRF compatibility
Deprecated syntax
Changes from NML 0.2 to 0.3
Changes from NML 0.3 to 0.4
Changes from NML 0.4 to 0.5

Vehicles, Stations, Canals, Bridges, Towns, Houses, Industries (Tiles), Cargos, Airports+Tiles, Objects, Railtypes, Roadtypes, Tramtypes, Terrain

NML Tutorial
Block Syntax

GRF

  • GRF parameters

Item

  • Property
  • Graphics
  • Livery override

Realsprites

Recolour sprites

Template

Spriteset

Spritegroup

Spritelayout

Tilelayout

Switch

Produce

Random switch

Cargotable

Railtypetable / Roadtypetable / Tramtypetable

If/else

While

Error

Disable items

Deactivate other NewGRFs

Testing for other NewGRFs

Overriding vehicles in other NewGRFs

Sprite replacement

  • Replace TTD sprites
  • Replace new sprites
  • Add font glyphs

Alternative (32bpp) sprites

Town names

  • Town names parts

Snow line

Parameter assignment

Setting base costs

Sorting vehicles in the purchase list

param[<expression>] = <expression>;

Set a parameter to the given expression. Neither of the two expressions has to be constant, the following is perfectly valid:

 param[param[2] + 1] = param[3] * param[4];
Retrieved from ‘https://newgrf-specs.tt-wiki.net/index.php?title=NML:Parameter_assignment&oldid=3425’

Navigation menu

Page actions

  • NML
  • Discussion
  • View source
  • History

Page actions

  • NML
  • Discussion
  • More
  • Tools
  • In other languages

Personal tools

  • Log in

Navigation

  • NewGRF Specs
  • NML Specs
  • Tools
  • Tutorials

links

  • TT-Forums Graphics
  • Development Zone
  • TT-Wiki
  • TTDPatch Manual
  • OpenTTD Wiki
  • Content Server
  • GRF Crawler

wiki

  • Style guide
  • ToDo list
  • Recent changes
  • Random page

 

Tools

  • What links here
  • Related changes
  • Special pages
  • Printable version
  • Permanent link
  • Page information

Advertisements

GNU General Public Licence 2.0
Powered by MediaWiki
  • This page was last modified on 26 August 2013, at 13:23.
  • Content is available under GNU General Public Licence 2.0 unless otherwise noted.
  • Privacy policy
  • About GRFSpecs
  • Disclaimers