Difference between revisions of "NML:Changes 0.3"

From GRFSpecs
Jump to navigationJump to search
Line 4: Line 4:
 
== Callbacks ==
 
== Callbacks ==
 
NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the [http://dev.openttdcoop.org/projects/nml/repository/revisions/28c88515e5e7/diff/nml/global_constants.py related commit]
 
NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the [http://dev.openttdcoop.org/projects/nml/repository/revisions/28c88515e5e7/diff/nml/global_constants.py related commit]
  +
  +
== New named constants ==
  +
A few constants have recently been introduced in both NML 0.2 and 0.3 that make the transition easier. Make sure to use them. For callback "articulated_part" use CB_RESULT_NO_MORE_ARTICULATED_PARTS and/or CB_RESULT_REVERSED_VEHICLE instead of hard-coded 0xFF / 0x80.
  +
For callbacks "cargo_subtype_text", "cargo_subtype_display" and "start_stop" use CB_RESULT_NO_TEXT instead of hard-coded 0xFF.
   
 
== Industry availability ==
 
== Industry availability ==

Revision as of 23:22, 13 December 2011

Introduction

Between NML 0.2.x and NML 0.3.x (and their corresponding nightlies) the generated NewGRF version by NML changed from v7 to v8. This brings lot of advantages, but requires a few changes to existing NML files. NewGRFs thus will require a minimum OpenTTD version of 1.2.0 (r23166).

Callbacks

NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the related commit

New named constants

A few constants have recently been introduced in both NML 0.2 and 0.3 that make the transition easier. Make sure to use them. For callback "articulated_part" use CB_RESULT_NO_MORE_ARTICULATED_PARTS and/or CB_RESULT_REVERSED_VEHICLE instead of hard-coded 0xFF / 0x80. For callbacks "cargo_subtype_text", "cargo_subtype_display" and "start_stop" use CB_RESULT_NO_TEXT instead of hard-coded 0xFF.

Industry availability

The callback "availability" is no longer available. Use the callback "construction_probability" instead.