Difference between revisions of "NML:Stations"

From GRFSpecs
Jump to navigationJump to search
(Add stub page)
 
(Add base station variables)
Line 3: Line 3:
   
 
==Station properties==
 
==Station properties==
  +
There are no properties defined yet
   
 
==Station variables==
 
==Station variables==
  +
  +
===Base station variables===
  +
The following variables are shared between stations and [[NML:Airports|airports]]:
  +
  +
{| class="t"
  +
! name
  +
! value range
  +
! comment
  +
|-
  +
| had_vehicle_of_type
  +
| bitmask(HAD_VEHICLE_OF_TYPE_XXX, ...)
  +
| Bitmask of vehicle types that have visited the station. XXX = <nowiki>[TRAIN | BUS | TRUCK | AIRCRAFT | SHIP]</nowiki>.
  +
|-
  +
| is_waypoint
  +
| [0 <nowiki>|</nowiki> 1]
  +
| Whether the station is a waypoint
  +
|-
  +
| facilities
  +
| bitmask(FACILITY_XXX, ...)
  +
| Bitmask of facilities associated with the station. XXX = <nowiki>[TRAIN | TRUCK_STOP | BUS_STOP | AIRPORT | DOCK]</nowiki>.
  +
|-
  +
| airport_type
  +
| AIRPORTTYPE_XXX
  +
| Type of airport, contains a bogus value if the station has no airport. XXX = <nowiki>[SMALL | LARGE | HELIPORT | OILRIG]</nowiki>.
  +
|-
  +
| build_date
  +
| <code style="color:green">date</code>(yyyy,mm,dd)
  +
| Date when the station was built. Is clamped to the 1920-2099 range.
  +
|}
  +
  +
  +
The following variables all require a single argument: a cargo type from your [[NML:Cargotable|cargo translation table]].
  +
  +
{| class="t"
  +
! name
  +
! value range
  +
! comment
  +
|-
  +
| cargo_amount_waiting
  +
| 0..32767
  +
| Units of cargo of waiting
  +
|-
  +
| cargo_rating
  +
| 0..100
  +
| Rating for this cargo type (in %)
  +
  +
|-
  +
| cargo_time_since_pickup
  +
| 0..255
  +
| Time since the cargo was last picked up. 1 unit equals 185 ticks, or about 2.5 game days.
  +
|-
  +
| cargo_time_en_route
  +
| 0..255
  +
| Time this cargo has spent en-route. 1 unit equals 185 ticks, or about 2.5 game days.
  +
|-
  +
| cargo_last_vehicle_speed
  +
| 0..255
  +
| Speed of the last vehicle picking up this cargo type. The unit depends on the type of vehicle. For trains and road vehicles, one unit is 1 km/h; for ships, it's 0.5 km/h; for aircraft, it's 8 mph. If the max. speed is above 255 speed units, 255 is used instead
  +
|-
  +
| cargo_last_vehicle_age
  +
| 0..255
  +
| Age of the last vehicle picking up this cargo type, in years.
  +
|-
  +
| cargo_accepted
  +
| [0 <nowiki>|</nowiki> 1]
  +
| 1 if this cargo type is currently being accepted at the station, 0 otherwise.
  +
|-
  +
| cargo_accepted_ever
  +
| [0 <nowiki>|</nowiki> 1]
  +
| 1 if this cargo type has ever been accepted at the station, 0 otherwise.
  +
|-
  +
| cargo_accepted_last_month
  +
| [0 <nowiki>|</nowiki> 1]
  +
| 1 if this cargo type was accepted last month at the station, 0 otherwise.
  +
|-
  +
| cargo_accepted_this_month
  +
| [0 <nowiki>|</nowiki> 1]
  +
| 1 if this cargo type was accepted this month at the station, 0 otherwise.
  +
|-
  +
| cargo_accepted_bigtick
  +
| [0 <nowiki>|</nowiki> 1]
  +
| 1 if this cargo type was accepted at the station since the last periodic processing, which happens every 250 ticks. 0 otherwise.
  +
|}
   
 
==Station callbacks==
 
==Station callbacks==
  +
There are no callbacks defined yet

Revision as of 20:38, 16 September 2012

Props, Vars and CBs

Stations in NML are currently a work-in-progress. Therefore, things may be added, changed or removed without notice. At the moment, it is not yet possible to write your own station NewGRF in NML.

Station properties

There are no properties defined yet

Station variables

Base station variables

The following variables are shared between stations and airports:

name value range comment
had_vehicle_of_type bitmask(HAD_VEHICLE_OF_TYPE_XXX, ...) Bitmask of vehicle types that have visited the station. XXX = [TRAIN | BUS | TRUCK | AIRCRAFT | SHIP].
is_waypoint [0 | 1] Whether the station is a waypoint
facilities bitmask(FACILITY_XXX, ...) Bitmask of facilities associated with the station. XXX = [TRAIN | TRUCK_STOP | BUS_STOP | AIRPORT | DOCK].
airport_type AIRPORTTYPE_XXX Type of airport, contains a bogus value if the station has no airport. XXX = [SMALL | LARGE | HELIPORT | OILRIG].
build_date date(yyyy,mm,dd) Date when the station was built. Is clamped to the 1920-2099 range.


The following variables all require a single argument: a cargo type from your cargo translation table.

name value range comment
cargo_amount_waiting 0..32767 Units of cargo of waiting
cargo_rating 0..100 Rating for this cargo type (in %)
cargo_time_since_pickup 0..255 Time since the cargo was last picked up. 1 unit equals 185 ticks, or about 2.5 game days.
cargo_time_en_route 0..255 Time this cargo has spent en-route. 1 unit equals 185 ticks, or about 2.5 game days.
cargo_last_vehicle_speed 0..255 Speed of the last vehicle picking up this cargo type. The unit depends on the type of vehicle. For trains and road vehicles, one unit is 1 km/h; for ships, it's 0.5 km/h; for aircraft, it's 8 mph. If the max. speed is above 255 speed units, 255 is used instead
cargo_last_vehicle_age 0..255 Age of the last vehicle picking up this cargo type, in years.
cargo_accepted [0 | 1] 1 if this cargo type is currently being accepted at the station, 0 otherwise.
cargo_accepted_ever [0 | 1] 1 if this cargo type has ever been accepted at the station, 0 otherwise.
cargo_accepted_last_month [0 | 1] 1 if this cargo type was accepted last month at the station, 0 otherwise.
cargo_accepted_this_month [0 | 1] 1 if this cargo type was accepted this month at the station, 0 otherwise.
cargo_accepted_bigtick [0 | 1] 1 if this cargo type was accepted at the station since the last periodic processing, which happens every 250 ticks. 0 otherwise.

Station callbacks

There are no callbacks defined yet