Difference between revisions of "Callback: Object slope check"

From GRFSpecs
Jump to navigationJump to search
(created)
 
(copy&paste error)
Line 1: Line 1:
== Station slope check (149) ==
+
== Object slope check (157) ==
   
 
This callback is called for each tile where the new object will be built. For OpenTTD since r22658 allowed return values are like [[Callbacks#Industry_location_permissibility_.2828.29|callback 28]], but with the difference that the meaning of bit 10 is inverted for backwards compatibility. This means that success is 0 instead of 0x400 while custom GRF texts start at 0x400 instead of 0. Return value 1 stands for "Land sloped in wrong direction" instead of "Site unsuitable". Earlier version of OpenTTD and TTDPatch only support 0 for success and 1 for error.
 
This callback is called for each tile where the new object will be built. For OpenTTD since r22658 allowed return values are like [[Callbacks#Industry_location_permissibility_.2828.29|callback 28]], but with the difference that the meaning of bit 10 is inverted for backwards compatibility. This means that success is 0 instead of 0x400 while custom GRF texts start at 0x400 instead of 0. Return value 1 stands for "Land sloped in wrong direction" instead of "Site unsuitable". Earlier version of OpenTTD and TTDPatch only support 0 for success and 1 for error.

Revision as of 21:38, 27 August 2011

Object slope check (157)

This callback is called for each tile where the new object will be built. For OpenTTD since r22658 allowed return values are like callback 28, but with the difference that the meaning of bit 10 is inverted for backwards compatibility. This means that success is 0 instead of 0x400 while custom GRF texts start at 0x400 instead of 0. Return value 1 stands for "Land sloped in wrong direction" instead of "Site unsuitable". Earlier version of OpenTTD and TTDPatch only support 0 for success and 1 for error.

Since the object isn't built yet, only some variables are available. In OpenTTD these are: 41, 42, 44, 45, 46, 48, 60 - 62 and 64. Additionally you get the following information:

  • Variable 10:
Bits Meaning
0 - 3 Relative X position of the tile within the object
4 - 7 Relative Y position of the tile within the object
8 - 31 Reserved; must be masked
  • Variable 18:
Bits Meaning
0 - 4 Slope of the tile
5 - 31 Reserved; must be masked