Skip to content

Instantly share code, notes, and snippets.

@glx22

glx22/chips.nml Secret

Last active November 22, 2021 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glx22/301ac434df8bfd41e137bc219a5bf465 to your computer and use it in GitHub Desktop.
Save glx22/301ac434df8bfd41e137bc219a5bf465 to your computer and use it in GitHub Desktop.
grf {
grfid: "NML\99";
/* GRF name and description strings are defined in the lang files */
name: string(STR_GRF_NAME);
desc: string(STR_GRF_DESCRIPTION);
/* This is the first version, start numbering at 0. */
version: 0;
min_compatible_version: 0;
}
/* Using parametrized sprite layouts are only valid in OpenTTD r22723 or later.
* Earlier versions will choke on those and otherwise disable the NewGRF.
*/
if (version_openttd(1,2,0,22723) > openttd_version) {
error(FATAL, REQUIRES_OPENTTD, string(STR_VERSION_22723));
}
cargotable {
COAL
}
spriteset(buffer_spriteset, "graphics/buffer.png") {
NE:[ 80, 10, 64, 31, -31, 0 ]
SW:[ 80, 50, 64, 31, -31, 0 ]
NW:[ 80, 90, 64, 31, -31, 0 ]
SE:[ 80, 130, 64, 31, -31, 0 ]
}
template tmpl_building() {
[ 10, 90, 64, 65, -31, -34 ]
[ 80, 90, 64, 65, -31, -34 ]
[ 150, 90, 64, 65, -31, -34 ]
[ 220, 90, 64, 65, -31, -34 ]
}
spriteset(houses_spriteset, "graphics/structures.png") {
tmpl_building()
[ 10, 170, 64, 65, -54, -46 ]
[ 80, 170, 64, 65, -54, -46 ]
[ 150, 170, 64, 65, -8, -46 ]
[ 220, 170, 64, 65, -8, -46 ]
}
spritelayout simple_track_X {
ground {
sprite: GROUNDSPRITE_RAIL_X;
}
childsprite {
sprite: CUSTOM(0, 0);
}
childsprite {
sprite: CUSTOM(0, 1);
}
// NE Buffer
building {
sprite: buffer_spriteset(NE);
xextent: 1;
zextent: 4;
hide_sprite: LOAD_TEMP(0);
}
// SW Buffer
building {
sprite: buffer_spriteset(SW);
xoffset: 16;
xextent: 1;
zextent: 4;
hide_sprite: LOAD_TEMP(1);
}
// House on south end
building {
sprite: houses_spriteset(0 + LOAD_TEMP(6) / 3);
yoffset: LOAD_TEMP(6);
yextent: 4;
zextent: 8;
hide_sprite: LOAD_TEMP(2);
}
// House on north end
building {
sprite: houses_spriteset(1 + LOAD_TEMP(6) / 3);
yoffset: LOAD_TEMP(6);
yextent: 4;
zextent: 8;
hide_sprite: LOAD_TEMP(3);
}
// Crane, truck, building, forklift
building {
sprite: CUSTOM(1, 0 + LOAD_TEMP(7));
yextent: 4;
zextent: 20;
recolour_mode: RECOLOUR_REMAP;
palette: PALETTE_USE_DEFAULT;
hide_sprite: LOAD_TEMP(4);
}
// Cargo
building {
sprite: DEFAULT(0);
yextent: 4;
zextent: 5;
hide_sprite: LOAD_TEMP(5);
}
building {
sprite: DEFAULT(1);
yoffset: 12;
yextent: 4;
zextent: 5;
hide_sprite: LOAD_TEMP(5);
}
}
spritelayout simple_track_Y {
ground {
sprite: GROUNDSPRITE_RAIL_Y;
}
childsprite {
sprite: CUSTOM(0, 2);
}
childsprite {
sprite: CUSTOM(0, 3);
}
// NW Buffer
building {
sprite: buffer_spriteset(NW);
yextent: 1;
zextent: 4;
hide_sprite: LOAD_TEMP(0);
}
// SE Buffer
building {
sprite: buffer_spriteset(SE);
yoffset: 16;
yextent: 1;
zextent: 4;
hide_sprite: LOAD_TEMP(1);
}
// House on south end
building {
sprite: houses_spriteset(2 + LOAD_TEMP(6) / 3);
xoffset: LOAD_TEMP(6);
xextent: 4;
zextent: 8;
hide_sprite: LOAD_TEMP(2);
}
// House on north end
building {
sprite: houses_spriteset(3 + LOAD_TEMP(6) / 3);
xoffset: LOAD_TEMP(6);
xextent: 4;
zextent: 8;
hide_sprite: LOAD_TEMP(3);
}
// Crane, truck, building, forklift
building {
sprite: CUSTOM(1, 2 + LOAD_TEMP(7));
xextent: 4;
zextent: 20;
recolour_mode: RECOLOUR_REMAP;
palette: PALETTE_USE_DEFAULT;
hide_sprite: LOAD_TEMP(4);
}
// Cargo
building {
sprite: DEFAULT(2);
xextent: 4;
zextent: 5;
hide_sprite: LOAD_TEMP(5);
}
building {
sprite: DEFAULT(3);
xoffset: 12;
xextent: 4;
zextent: 5;
hide_sprite: LOAD_TEMP(5);
}
}
switch(FEAT_STATIONS, SELF, fill_temp_2, [
STORE_TEMP(platform_position_from_start(PLATFORM_SAME_DIRECTION) - platform_position_from_end(PLATFORM_SAME_DIRECTION), 8),
STORE_TEMP(platform_length(PLATFORM_SAME_DIRECTION) <= 4 | (LOAD_TEMP(8) != 0 & LOAD_TEMP(8) != 1), 4), // hide crane, truck, building, forklift
STORE_TEMP(!LOAD_TEMP(4), 5), // hide cargo
STORE_TEMP(hasbit((getbits(platform_number_from_start(PLATFORM_SAME_DIRECTION), 0, 2) * 4 + getbits(random_bits, 15, 2) + getbits(random_bits, 0, 4)) % 16, 1), 7), // offset for crane, truck, building, forklift
]) { return; }
switch(FEAT_STATIONS, SELF, fill_temp_1, [
STORE_TEMP(1, 5), // hide cargo
STORE_TEMP(platform_position_from_end(PLATFORM_SAME_DIRECTION) != 0, 2), // hide south-end house
STORE_TEMP(platform_position_from_start(PLATFORM_SAME_DIRECTION) != 0, 3), // hide north-end house
STORE_TEMP(platform_number_from_start(PLATFORM_SAME_DIRECTION) % 2 ? 0 : 12, 6), // offset for houses
LOAD_TEMP(2) + LOAD_TEMP(3),
]) {
2: fill_temp_2; // no houses, maybe something else ?
return;
}
switch(FEAT_STATIONS, SELF, fill_temp_0, [
STORE_TEMP(hasbit(rail_continuation, 1), 0), // hide north-end buffer
STORE_TEMP(hasbit(rail_continuation, 0), 1), // hide south-end buffer
STORE_TEMP(1, 2), // hide south-end house
STORE_TEMP(1, 3), // hide north-end house
STORE_TEMP(1, 4), // hide crane, truck, building, forklift
LOAD_TEMP(0) + LOAD_TEMP(1),
]) {
2: fill_temp_1; // no buffers, maybe a building ?
return;
}
switch(FEAT_STATIONS, SELF, purchase_fill_temp, [
STORE_TEMP(1, 0), // hide north-end buffer
STORE_TEMP(1, 1), // hide south-end buffer
STORE_TEMP(1, 2), // hide south-end house
STORE_TEMP(1, 3), // hide north-end house
STORE_TEMP(1, 4), // hide crane, truck, building, forklift
STORE_TEMP(1, 5), // hide cargo
]) { return; }
spriteset(cranes_spriteset, "graphics/cranes.png") {
tmpl_building()
}
spriteset(trucks_spriteset, "graphics/trucks_small.png") {
tmpl_building()
}
spriteset(forklifts_spriteset, "graphics/forklifts_small.png") {
tmpl_building()
}
switch(FEAT_STATIONS, SELF, custom_building, getbits((getbits(platform_number_from_start(PLATFORM_SAME_DIRECTION), 0, 2) * 4 + getbits(random_bits, 15, 2) + getbits(random_bits, 0, 4)) % 16, 2, 2)) {
0: return cranes_spriteset;
1: return trucks_spriteset;
2: return houses_spriteset;
3: return forklifts_spriteset;
}
template tmpl_cargo(x) {
[ 10 + x, 90, 64, 65, -31, -34 ]
[ 10 + x, 170, 64, 65, -54, -46 ]
[ 150 + x, 90, 64, 65, -31, -34 ]
[ 150 + x, 170, 64, 65, -8, -46 ]
}
spriteset(no_cargo, "graphics/null.png") {
tmpl_cargo(0)
}
spriteset(little_coal_cargo, "graphics/coal_cargo.png") {
tmpl_cargo(0)
}
spriteset(lots_coal_cargo, "graphics/coal_cargo.png") {
tmpl_cargo(70)
}
spritegroup coal_cargo {
little: little_coal_cargo;
lots: lots_coal_cargo;
}
template tmpl_ground(x) {
[ x, 50, 64, 31, -31, 0 ]
[ x, 90, 64, 31, -31, 0 ]
[ x, 130, 64, 31, -31, 0 ]
[ x, 170, 64, 31, -31, 0 ]
}
spriteset(asphalt_track_ground, "graphics/groundtiles.png") {
tmpl_ground(80)
}
item(FEAT_STATIONS, asphalt_track) {
property {
/* The class allows to sort stations into categories. */
class: "NML_";
/* If no other NewGRF provides this class before us, we have to name it */
classname: string(STR_NAME_STATCLASS);
/* Name of this particular station */
name: string(STR_NAME_STATION_ASPHALT);
cargo_threshold: 500;
}
graphics {
sprite_layouts: [simple_track_X, simple_track_Y];
custom_spritesets: [asphalt_track_ground, custom_building];
prepare_layout: fill_temp_0();
purchase_prepare_layout: purchase_fill_temp();
COAL: coal_cargo;
no_cargo;
}
}
spriteset(asphalt_dirty_track_ground, "graphics/groundtiles.png") {
tmpl_ground(150)
}
item(FEAT_STATIONS, asphalt_dirty_track) {
property {
/* The class allows to sort stations into categories. */
class: "NML_";
/* Name of this particular station */
name: string(STR_NAME_STATION_ASPHALT_DIRTY);
cargo_threshold: 500;
}
graphics {
sprite_layouts: asphalt_track;
custom_spritesets: [asphalt_dirty_track_ground, custom_building];
prepare_layout: fill_temp_0();
purchase_prepare_layout: purchase_fill_temp();
COAL: coal_cargo;
no_cargo;
}
}
spriteset(mud_track_ground, "graphics/groundtiles.png") {
tmpl_ground(10)
}
item(FEAT_STATIONS, mud_track) {
property {
/* The class allows to sort stations into categories. */
class: "NML_";
/* Name of this particular station */
name: string(STR_NAME_STATION_MUD);
cargo_threshold: 500;
}
graphics {
sprite_layouts: asphalt_track;
custom_spritesets: [mud_track_ground, custom_building];
prepare_layout: fill_temp_0();
purchase_prepare_layout: purchase_fill_temp();
COAL: coal_cargo;
no_cargo;
}
}
spriteset(cobble_track_ground, "graphics/groundtiles.png") {
tmpl_ground(220)
}
item(FEAT_STATIONS, cobble_track) {
property {
/* The class allows to sort stations into categories. */
class: "NML_";
/* Name of this particular station */
name: string(STR_NAME_STATION_COBBLE);
cargo_threshold: 500;
}
graphics {
sprite_layouts: asphalt_track;
custom_spritesets: [cobble_track_ground, custom_building];
prepare_layout: fill_temp_0();
purchase_prepare_layout: purchase_fill_temp();
COAL: coal_cargo;
no_cargo;
}
}
spriteset(slab_track_ground, "graphics/groundtiles.png") {
tmpl_ground(360)
}
item(FEAT_STATIONS, slab_track) {
property {
/* The class allows to sort stations into categories. */
class: "NML_";
/* Name of this particular station */
name: string(STR_NAME_STATION_SLAB);
}
graphics {
sprite_layouts: asphalt_track;
custom_spritesets: [slab_track_ground, custom_building];
prepare_layout: fill_temp_0();
purchase_prepare_layout: purchase_fill_temp();
COAL: coal_cargo;
no_cargo;
}
}
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 32)
// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>>
// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D%
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags
0 * 4 \d126
1 * 54 14 "C" "INFO"
"B" "VRSN" \w4 \dx00000000
"B" "MINV" \w4 \dx00000000
"B" "NPAR" \w1 00
"B" "PALS" \w1 "D"
"B" "BLTR" \w1 "8"
00
00
2 * 184 08 08 "NML\99" "NML CHIPS Stations" 00 "\8ENML Example NewGRF: Station\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DConversion of CHIPS Cow pens." 00
3 * 9 00 08 \b1 01 FF \wx0001
15 00
// param[126] = param[161]
4 * 5 0D 7E \D= A1 00
// param[127] = (param[126] - 302012611)
5 * 9 0D 7F \D- 7E FF \dx120058C3
// param[127] = (param[127] << -31)
6 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1
7 * 9 09 7F 04 \7= \dx00000000 01
8 * 19 0B 03 7F 06 "1.2.0 (r22723)" 00
9 * 12 00 08 \b1 01 FF \wx0000
09 "COAL"
// Name: fill_temp_2
10 * 307 02 04 FF 89
49 20 \dx0000000F
\2- 49 24 \dx0000000F
\2sto 1A 20 \dx00000008
\2r 7D 08 20 \dxFFFFFFFF
\2cmp 1A 20 \dx00000001
\2& 1A 20 \dx00000001
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000080
\2r 7D 08 20 \dxFFFFFFFF
\2cmp 1A 20 \dx00000000
\2& 1A 20 \dx00000001
\2^ 1A 20 \dx00000001
\2& 7D 80 20 \dxFFFFFFFF
\2sto 1A 20 \dx00000081
\2r 49 30 \dx0000000F
\2cmp 1A 20 \dx00000004
\2^ 1A 20 \dx00000002
\2< 1A 20 \dx00000001
\2| 7D 81 20 \dxFFFFFFFF
\2sto 1A 20 \dx00000004
\2r 7D 04 20 \dxFFFFFFFF
\2u< 1A 20 \dx00000001
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000005
\2r 5F 28 \dx000FFFFF
\2u>> 1A 20 \dx00000000
\2& 1A 20 \dx0000000F
\2sto 1A 20 \dx00000082
\2r 5F 28 \dx000FFFFF
\2u>> 1A 20 \dx0000000F
\2& 1A 20 \dx00000003
\2sto 1A 20 \dx00000083
\2r 49 28 \dx0000000F
\2u>> 1A 20 \dx00000000
\2& 1A 20 \dx00000003
\2* 1A 20 \dx00000004
\2+ 7D 83 20 \dxFFFFFFFF
\2+ 7D 82 20 \dxFFFFFFFF
\2% 1A 20 \dx00000010
\2u>> 1A 20 \dx00000001
\2& 1A 20 \dx00000001
\2sto 1A 00 \dx00000007
\b0
\wx8000 // Return computed value
// Name: fill_temp_1@return
11 * 13 02 04 FE 89
1C 00 \dxFFFFFFFF
\b0
\wx8000 // Return computed value
// Name: fill_temp_1
12 * 174 02 04 FE 89
1A 20 \dx00000001
\2sto 1A 20 \dx00000005
\2r 49 24 \dx0000000F
\2cmp 1A 20 \dx00000000
\2& 1A 20 \dx00000001
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000002
\2r 49 20 \dx0000000F
\2cmp 1A 20 \dx00000000
\2& 1A 20 \dx00000001
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000003
\2r 49 A8 \dx0000000F \dx00000000 \dx00000002
\2u< 1A 20 \dx00000001
\2* 1A 20 \dxFFFFFFF4 // expr1 - expr2
\2+ 1A 20 \dx0000000C
\2sto 1A 20 \dx00000006
\2r 7D 03 20 \dxFFFFFFFF
\2sto 1A 20 \dx00000080
\2r 7D 02 20 \dxFFFFFFFF
\2+ 7D 80 00 \dxFFFFFFFF
\b1
\wx00FF \dx00000002 \dx00000002 // 2 .. 2: fill_temp_2;
\wx00FE // Return computed value
// Name: fill_temp_0@return
13 * 13 02 04 FF 89
1C 00 \dxFFFFFFFF
\b0
\wx8000 // Return computed value
// Name: fill_temp_0
14 * 145 02 04 FF 89
45 20 \dx000000FF
\2u>> 1A 20 \dx00000001
\2& 1A 20 \dx00000001
\2sto 1A 20 \dx00000000
\2r 45 20 \dx000000FF
\2u>> 1A 20 \dx00000000
\2& 1A 20 \dx00000001
\2sto 1A 20 \dx00000001
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000002
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000003
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000004
\2r 7D 01 20 \dxFFFFFFFF
\2sto 1A 20 \dx00000080
\2r 7D 00 20 \dxFFFFFFFF
\2+ 7D 80 00 \dxFFFFFFFF
\b1
\wx00FE \dx00000002 \dx00000002 // 2 .. 2: fill_temp_1;
\wx00FF // Return computed value
// Name: purchase_fill_temp
15 * 90 02 04 FE 89
1A 20 \dx00000001
\2sto 1A 20 \dx00000000
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000001
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000002
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000003
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000004
\2r 1A 20 \dx00000001
\2sto 1A 00 \dx00000005
\b0
\wx8000 // Return computed value
16 * 6 01 04 \b2 FF \wx0004
17 graphics/cranes.png 8bpp 10 90 64 65 -31 -34 normal
18 graphics/cranes.png 8bpp 80 90 64 65 -31 -34 normal
19 graphics/cranes.png 8bpp 150 90 64 65 -31 -34 normal
20 graphics/cranes.png 8bpp 220 90 64 65 -31 -34 normal
21 graphics/trucks_small.png 8bpp 10 90 64 65 -31 -34 normal
22 graphics/trucks_small.png 8bpp 80 90 64 65 -31 -34 normal
23 graphics/trucks_small.png 8bpp 150 90 64 65 -31 -34 normal
24 graphics/trucks_small.png 8bpp 220 90 64 65 -31 -34 normal
// Name: cranes_spriteset - feature 04
25 * 7 02 04 FD \b0 \b1
\w0
// Name: trucks_spriteset - feature 04
26 * 7 02 04 FC \b0 \b1
\w1
27 * 6 01 04 \b1 FF \wx0008
28 graphics/structures.png 8bpp 10 90 64 65 -31 -34 normal
29 graphics/structures.png 8bpp 80 90 64 65 -31 -34 normal
30 graphics/structures.png 8bpp 150 90 64 65 -31 -34 normal
31 graphics/structures.png 8bpp 220 90 64 65 -31 -34 normal
32 graphics/structures.png 8bpp 10 170 64 65 -54 -46 normal
33 graphics/structures.png 8bpp 80 170 64 65 -54 -46 normal
34 graphics/structures.png 8bpp 150 170 64 65 -8 -46 normal
35 graphics/structures.png 8bpp 220 170 64 65 -8 -46 normal
// Name: houses_spriteset - feature 04
36 * 7 02 04 FB \b0 \b1
\w0
37 * 6 01 04 \b10 FF \wx0004
38 graphics/forklifts_small.png 8bpp 10 90 64 65 -31 -34 normal
39 graphics/forklifts_small.png 8bpp 80 90 64 65 -31 -34 normal
40 graphics/forklifts_small.png 8bpp 150 90 64 65 -31 -34 normal
41 graphics/forklifts_small.png 8bpp 220 90 64 65 -31 -34 normal
42 graphics/coal_cargo.png 8bpp 10 90 64 65 -31 -34 normal
43 graphics/coal_cargo.png 8bpp 10 170 64 65 -54 -46 normal
44 graphics/coal_cargo.png 8bpp 150 90 64 65 -31 -34 normal
45 graphics/coal_cargo.png 8bpp 150 170 64 65 -8 -46 normal
46 graphics/coal_cargo.png 8bpp 80 90 64 65 -31 -34 normal
47 graphics/coal_cargo.png 8bpp 80 170 64 65 -54 -46 normal
48 graphics/coal_cargo.png 8bpp 220 90 64 65 -31 -34 normal
49 graphics/coal_cargo.png 8bpp 220 170 64 65 -8 -46 normal
50 graphics/groundtiles.png 8bpp 80 50 64 31 -31 0 normal
51 graphics/groundtiles.png 8bpp 80 90 64 31 -31 0 normal
52 graphics/groundtiles.png 8bpp 80 130 64 31 -31 0 normal
53 graphics/groundtiles.png 8bpp 80 170 64 31 -31 0 normal
54 graphics/null.png 8bpp 10 90 64 65 -31 -34 normal
55 graphics/null.png 8bpp 10 170 64 65 -54 -46 normal
56 graphics/null.png 8bpp 150 90 64 65 -31 -34 normal
57 graphics/null.png 8bpp 150 170 64 65 -8 -46 normal
58 graphics/buffer.png 8bpp 80 10 64 31 -31 0 normal
59 graphics/buffer.png 8bpp 80 50 64 31 -31 0 normal
60 graphics/buffer.png 8bpp 80 90 64 31 -31 0 normal
61 graphics/buffer.png 8bpp 80 130 64 31 -31 0 normal
62 graphics/groundtiles.png 8bpp 150 50 64 31 -31 0 normal
63 graphics/groundtiles.png 8bpp 150 90 64 31 -31 0 normal
64 graphics/groundtiles.png 8bpp 150 130 64 31 -31 0 normal
65 graphics/groundtiles.png 8bpp 150 170 64 31 -31 0 normal
66 graphics/groundtiles.png 8bpp 10 50 64 31 -31 0 normal
67 graphics/groundtiles.png 8bpp 10 90 64 31 -31 0 normal
68 graphics/groundtiles.png 8bpp 10 130 64 31 -31 0 normal
69 graphics/groundtiles.png 8bpp 10 170 64 31 -31 0 normal
70 graphics/groundtiles.png 8bpp 220 50 64 31 -31 0 normal
71 graphics/groundtiles.png 8bpp 220 90 64 31 -31 0 normal
72 graphics/groundtiles.png 8bpp 220 130 64 31 -31 0 normal
73 graphics/groundtiles.png 8bpp 220 170 64 31 -31 0 normal
74 graphics/groundtiles.png 8bpp 360 50 64 31 -31 0 normal
75 graphics/groundtiles.png 8bpp 360 90 64 31 -31 0 normal
76 graphics/groundtiles.png 8bpp 360 130 64 31 -31 0 normal
77 graphics/groundtiles.png 8bpp 360 170 64 31 -31 0 normal
// Name: forklifts_spriteset - feature 04
78 * 7 02 04 FA \b0 \b1
\w0
// Name: @CB_FAILED_REAL04
79 * 7 02 04 F9 \b0 \b1
\w0
// Name: @CB_FAILED04
80 * 23 02 04 F9 89
0C 00 \dx0000FFFF
\b1
\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0
\wx00F9 // Non-graphics callback, return graphics result
// Name: custom_building
81 * 167 02 04 F9 89
5F 28 \dx000FFFFF
\2u>> 1A 20 \dx00000000
\2& 1A 20 \dx0000000F
\2sto 1A 20 \dx00000080
\2r 5F 28 \dx000FFFFF
\2u>> 1A 20 \dx0000000F
\2& 1A 20 \dx00000003
\2sto 1A 20 \dx00000081
\2r 49 28 \dx0000000F
\2u>> 1A 20 \dx00000000
\2& 1A 20 \dx00000003
\2* 1A 20 \dx00000004
\2+ 7D 81 20 \dxFFFFFFFF
\2+ 7D 80 20 \dxFFFFFFFF
\2% 1A 20 \dx00000010
\2u>> 1A 20 \dx00000002
\2& 1A 00 \dx00000003
\b4
\wx00FD \dx00000000 \dx00000000 // 0 .. 0: cranes_spriteset;
\wx00FC \dx00000001 \dx00000001 // 1 .. 1: trucks_spriteset;
\wx00FB \dx00000002 \dx00000002 // 2 .. 2: houses_spriteset;
\wx00FA \dx00000003 \dx00000003 // 3 .. 3: forklifts_spriteset;
\wx00F9 // No default specified -> fail callback
// Name: coal_cargo - feature 04
82 * 9 02 04 FA \b1 \b1
\w1
\w2
83 * 15 00 04 \b2 01 FF \wx0000
08 "NML_"
10 \wx01F4
84 * 16 04 04 FF 01 \wxC400 "NML CHIPS" 00
85 * 29 04 04 FF 01 \wxC500 "CHIPS Asphalt platform" 00
// Name: asphalt_track_ground - feature 04
86 * 7 02 04 FC \b0 \b1
\w3
// Name: no_cargo - feature 04
87 * 7 02 04 FD \b0 \b1
\w4
88 * 281 00 04 \b1 01 FF \wx0000
1A \b2
\b73 \dx000003F4 \wx0000
\dx8000042D \wx0042 \b0 \b0 80 80 01
\dx8000042D \wx0042 \b0 \b0 80 81 01
\dx8000042D \wx0043 \b0 \b0 \b0 \b1 \b16 \b4 82 83 03
\dx8000042D \wx0043 \b16 \b0 \b0 \b1 \b16 \b4 84 85 03
\dx8000042D \wx0053 \b0 \b0 \b0 \b16 \b4 \b8 86 87 88 06 04
\dx8000042D \wx0053 \b0 \b0 \b0 \b16 \b4 \b8 89 8A 8B 06 04
\dx8000842D \wx0043 \b0 \b0 \b0 \b16 \b4 \b20 8C 07 05
\dx8000042D \wx0003 \b0 \b0 \b0 \b16 \b4 \b5 8D 8E
\dx8000042D \wx0003 \b0 \b12 \b0 \b16 \b4 \b5 8F 90
\b73 \dx000003F3 \wx0000
\dx8000042D \wx0042 \b0 \b0 80 91 01
\dx8000042D \wx0042 \b0 \b0 80 92 01
\dx8000042D \wx0043 \b0 \b0 \b0 \b16 \b1 \b4 93 94 03
\dx8000042D \wx0043 \b0 \b16 \b0 \b16 \b1 \b4 95 96 03
\dx8000042D \wx0053 \b0 \b0 \b0 \b4 \b16 \b8 97 98 06 99 04
\dx8000042D \wx0053 \b0 \b0 \b0 \b4 \b16 \b8 9A 9B 06 9C 04
\dx8000842D \wx0043 \b0 \b0 \b0 \b4 \b16 \b20 9D 9E 05
\dx8000042D \wx0003 \b0 \b0 \b0 \b4 \b16 \b5 9F A0
\dx8000042D \wx0003 \b12 \b0 \b0 \b4 \b16 \b5 A1 A2
// Name: Station Layout@registers - Id 00
89 * 669 02 04 F8 89
1A 20 \dx00000000
\2sto 1A 20 \dx00000080
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000081
\2r 7D 00 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000082
\2r 1A 20 \dx00000000
\2sto 1A 20 \dx00000083
\2r 7D 01 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000084
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000085
\2r 7D 02 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000086
\2r 7D 06 20 \dxFFFFFFFF
\2/ 1A 20 \dx00000003
\2sto 1A 20 \dx00000087
\2r 1A 20 \dx00000000
\2sto 1A 20 \dx00000088
\2r 7D 03 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000089
\2r 7D 06 20 \dxFFFFFFFF
\2/ 1A 20 \dx00000003
\2+ 1A 20 \dx00000001
\2sto 1A 20 \dx0000008A
\2r 1A 20 \dx00000000
\2sto 1A 20 \dx0000008B
\2r 7D 04 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx0000008C
\2r 7D 05 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx0000008D
\2r 1A 20 \dx00000000
\2sto 1A 20 \dx0000008E
\2r 7D 05 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx0000008F
\2r 1A 20 \dx00000001
\2sto 1A 20 \dx00000090
\2r 1A 20 \dx00000002
\2sto 1A 20 \dx00000091
\2r 1A 20 \dx00000003
\2sto 1A 20 \dx00000092
\2r 7D 00 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000093
\2r 1A 20 \dx00000002
\2sto 1A 20 \dx00000094
\2r 7D 01 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000095
\2r 1A 20 \dx00000003
\2sto 1A 20 \dx00000096
\2r 7D 02 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx00000097
\2r 7D 06 20 \dxFFFFFFFF
\2/ 1A 20 \dx00000003
\2+ 1A 20 \dx00000002
\2sto 1A 20 \dx00000098
\2r 1A 20 \dx00000000
\2sto 1A 20 \dx00000099
\2r 7D 03 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx0000009A
\2r 7D 06 20 \dxFFFFFFFF
\2/ 1A 20 \dx00000003
\2+ 1A 20 \dx00000003
\2sto 1A 20 \dx0000009B
\2r 1A 20 \dx00000000
\2sto 1A 20 \dx0000009C
\2r 7D 04 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx0000009D
\2r 7D 07 20 \dxFFFFFFFF
\2+ 1A 20 \dx00000002
\2sto 1A 20 \dx0000009E
\2r 7D 05 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx0000009F
\2r 1A 20 \dx00000002
\2sto 1A 20 \dx000000A0
\2r 7D 05 20 \dxFFFFFFFF
\2^ 1A 20 \dx00000001
\2sto 1A 20 \dx000000A1
\2r 1A 20 \dx00000003
\2sto 1A 00 \dx000000A2
\b0
\wx8000 // Return computed value
// Name: buffer_spriteset - feature 04
90 * 7 02 04 F7 \b0 \b1
\w5
// Name: @action3_0
91 * 69 02 04 F6 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // asphalt_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
// Name: @action3_1
92 * 69 02 04 F5 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // asphalt_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FA // coal_cargo;
// Name: @action3_2
93 * 69 02 04 FC 89
7E FE 20 \dxFFFFFFFF // purchase_fill_temp
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // asphalt_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
94 * 13 03 04 01 00 \b2
00 \wx00F5 // @action3_1;
FF \wx00FC // @action3_2;
\wx00F6 // @action3_0;
95 * 15 00 04 \b2 01 FF \wx0001
08 "NML_"
10 \wx01F4
96 * 37 04 04 FF 01 \wxC501 "CHIPS Asphalt platform - dirty" 00
// Name: asphalt_dirty_track_ground - feature 04
97 * 7 02 04 F6 \b0 \b1
\w6
98 * 9 00 04 \b1 01 FF \wx0001
0A 00
// Name: @action3_3
99 * 69 02 04 FC 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00F6 \dx00000001 \dx00000001 // asphalt_dirty_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
// Name: @action3_4
100 * 69 02 04 F5 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00F6 \dx00000001 \dx00000001 // asphalt_dirty_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FA // coal_cargo;
// Name: @action3_5
101 * 69 02 04 F6 89
7E FE 20 \dxFFFFFFFF // purchase_fill_temp
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00F6 \dx00000001 \dx00000001 // asphalt_dirty_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
102 * 13 03 04 01 01 \b2
00 \wx00F5 // @action3_4;
FF \wx00F6 // @action3_5;
\wx00FC // @action3_3;
103 * 15 00 04 \b2 01 FF \wx0002
08 "NML_"
10 \wx01F4
104 * 25 04 04 FF 01 \wxC502 "CHIPS Mud platform" 00
// Name: mud_track_ground - feature 04
105 * 7 02 04 FC \b0 \b1
\w7
106 * 9 00 04 \b1 01 FF \wx0002
0A 00
// Name: @action3_6
107 * 69 02 04 F6 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // mud_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
// Name: @action3_7
108 * 69 02 04 F5 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // mud_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FA // coal_cargo;
// Name: @action3_8
109 * 69 02 04 FC 89
7E FE 20 \dxFFFFFFFF // purchase_fill_temp
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // mud_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
110 * 13 03 04 01 02 \b2
00 \wx00F5 // @action3_7;
FF \wx00FC // @action3_8;
\wx00F6 // @action3_6;
111 * 15 00 04 \b2 01 FF \wx0003
08 "NML_"
10 \wx01F4
112 * 28 04 04 FF 01 \wxC503 "CHIPS Cobble platform" 00
// Name: cobble_track_ground - feature 04
113 * 7 02 04 F6 \b0 \b1
\w8
114 * 9 00 04 \b1 01 FF \wx0003
0A 00
// Name: @action3_9
115 * 69 02 04 FC 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00F6 \dx00000001 \dx00000001 // cobble_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
// Name: @action3_10
116 * 69 02 04 F5 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00F6 \dx00000001 \dx00000001 // cobble_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FA // coal_cargo;
// Name: @action3_11
117 * 69 02 04 F6 89
7E FE 20 \dxFFFFFFFF // purchase_fill_temp
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00F6 \dx00000001 \dx00000001 // cobble_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
118 * 13 03 04 01 03 \b2
00 \wx00F5 // @action3_10;
FF \wx00F6 // @action3_11;
\wx00FC // @action3_9;
119 * 12 00 04 \b1 01 FF \wx0004
08 "NML_"
120 * 36 04 04 FF 01 \wxC504 "CHIPS Concrete slabs platform" 00
// Name: slab_track_ground - feature 04
121 * 7 02 04 FC \b0 \b1
\w9
122 * 9 00 04 \b1 01 FF \wx0004
0A 00
// Name: @action3_12
123 * 69 02 04 F6 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // slab_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
// Name: @action3_13
124 * 69 02 04 FA 89
7E FF 20 \dxFFFFFFFF // fill_temp_0
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // slab_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FA // coal_cargo;
// Name: @action3_14
125 * 69 02 04 FD 89
7E FE 20 \dxFFFFFFFF // purchase_fill_temp
\2r 7E F8 20 \dxFFFFFFFF // Station Layout@registers - Id 00
\2r 10 00 \dx000000FF
\b4
\wx00FC \dx00000001 \dx00000001 // slab_track_ground;
\wx00F7 \dx00000003 \dx00000003 // buffer_spriteset;
\wx00FB \dx00000004 \dx00000004 // houses_spriteset;
\wx00F9 \dx00000005 \dx00000005 // custom_building;
\wx00FD // no_cargo;
126 * 13 03 04 01 04 \b2
00 \wx00FA // @action3_13;
FF \wx00FD // @action3_14;
\wx00F6 // @action3_12;
##grflangid 0x01
##plural 0
STR_GRF_NAME :NML CHIPS Stations
STR_GRF_DESCRIPTION :{ORANGE}NML Example NewGRF: Station{}{BLACK}This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.{}Conversion of CHIPS Cow pens.
STR_VERSION_22723 :1.2.0 (r22723)
STR_NAME_STATCLASS :NML CHIPS
STR_NAME_STATION_ASPHALT :CHIPS Asphalt platform
STR_NAME_STATION_ASPHALT_DIRTY :CHIPS Asphalt platform - dirty
STR_NAME_STATION_COBBLE :CHIPS Cobble platform
STR_NAME_STATION_MUD :CHIPS Mud platform
STR_NAME_STATION_SLAB :CHIPS Concrete slabs platform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment