Ok, got some more free time now. So lets get on with the final part of explaining the code before we get to adding pieces of code.
Now we are going to look at the pieces of code that give us the various stationtiles we have so far.
I will highlight important pieces (that will need changing when you expand the code) and explain those under the code:
10 * 6 01 04 01 FF 10 00
11
c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 10 40 64 122 -31 -91 normal chunked
|
c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 10 40 64 122 -31 -91 normal chunked
12 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 90 40 64 122 -53 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 90 40 64 122 -53 -102 normal chunked
13 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 170 40 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 170 40 64 122 -31 -91 normal chunked
14 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 250 40 64 122 -9 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 250 40 64 122 -9 -102 normal chunked
15 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 330 40 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 330 40 64 122 -31 -91 normal chunked
16 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 410 40 64 122 -53 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 410 40 64 122 -53 -102 normal chunked
17 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 490 40 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 490 40 64 122 -31 -91 normal chunked
18 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 570 40 64 122 -9 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 570 40 64 122 -9 -102 normal chunked
19 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 650 40 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 650 40 64 122 -0 -0 normal chunked
20 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 730 40 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 730 40 64 122 -0 -0 normal chunked
21 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 810 40 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 810 40 64 122 -0 -0 normal chunked
22 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 890 40 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 890 40 64 122 -0 -0 normal chunked
23 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 970 40 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 970 40 64 122 -0 -0 normal chunked
24 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 1050 40 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 1050 40 64 122 -0 -0 normal chunked
25 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 1130 40 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 1130 40 64 122 -0 -0 normal chunked
26 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 1210 40 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 1210 40 64 122 -0 -0 normal chunked
27 * 376 00 04 04 01
00 08 "
AS00" 11 FF 0B 0F 09 08
F4 03 00 00 00 00 00 10 05 03 31 84 00 00 00 00 80 00 00 00 39 44 22 03 00 0B 00 10 05 03 32 84 00 00 00 00 80 00 00 00 3A 44 22 03 80
F3 03 00 00 00 00 00 05 10 03 33 84 00 00 00 00 80 00 00 00 3B 44 22 03 0B 00 00 05 10 03 34 84 00 00 00 00 80 00 00 00 3C 44 22 03 80
F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 00 80 00 00 00 35 44 22 03 00 0B 00 10 05 03 2E 84 00 00 00 00 80 00 00 00 36 44 22 03 80
F3 03 00 00 00 00 00 05 10 03 2F 84 00 00 00 00 80 00 00 00 37 44 22 03 0B 00 00 05 10 03 30 84 00 00 00 00 80 00 00 00 38 44 22 03 80
F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 00 80 00 00 00 35 44 22 03 00 0B 00 10 05 03 32 84 00 00 00 00 80 00 00 00 3A 44 22 03 80
F3 03 00 00 00 00 00 05 10 03 2F 84 00 00 00 00 80 00 00 00 37 44 22 03 0B 00 00 05 10 03 34 84 00 00 00 00 80 00 00 00 3C 44 22 03 80
F4 03 00 00 00 00 00 10 05 03 31 84 00 00 00 00 80 00 00 00 39 44 22 03 00 0B 00 10 05 03 2E 84 00 00 00 00 80 00 00 00 36 44 22 03 80
F3 03 00 00 00 00 00 05 10 03 33 84 00 00 00 00 80 00 00 00 3B 44 22 03 0B 00 00 05 10 03 30 84 00 00 00 00 80 00 00 00 38 44 22 03 80
28 * 7 02 04 00 00 01 00 00
29 * 14 02 04 01 81 41 14 0F 01 00 80 01 0F 02 80
30 * 14 02 04 02 81 41 0C 0F 01 06 80 00 00 01 00
31 * 14 02 04 03 81 41 08 0F 01 04 80 00 00 02 00
32 * 14 02 04 04 81 41 14 0F 01 03 00 02 0F 02 80
33 * 14 02 04 05 81 0C 00 FF 01 04 00 14 14 00 00
34 * 10 03 04 01
00 01 FE 05 00 00 00
35 * 32 04 48 FF 01
00 "Å
TEMPLATE REGULAR PLATFORM" 00
36 * 44 04 48 FF 01
00 "Ä
AuzStations: Normal OpenTTD Platforms" 00
37 * 6 01 04 01 FF 06 00
38 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 10 170 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 10 170 64 122 -31 -91 normal chunked
39 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 90 170 64 122 -53 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 90 170 64 122 -53 -102 normal chunked
40 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 170 170 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 170 170 64 122 -0 -0 normal chunked
41 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 250 170 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 250 170 64 122 -31 -91 normal chunked
42 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 330 170 64 122 -9 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 330 170 64 122 -9 -102 normal chunked
43 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 410 170 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 410 170 64 122 -0 -0 normal chunked
44 * 84 00 04 03 01
01 08 "
AS01" 11 FF 09 02
F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 0B 00 10 05 03 2E 84 00 00 00 00 80 00 00 00 2F 44 22 03 80
F3 03 00 00 00 00 00 05 10 03 30 84 00 00 0B 00 00 05 10 03 31 84 00 00 00 00 80 00 00 00 32 44 22 03 80
45 * 7 02 04 00 00 01 00 00
46 * 7 02 04 01 00 01 00 00
47 * 10 03 04 01
01 01 FE 01 00 00 00
48 * 39 04 48 FF 01
01 "Å
TEMPLATE REGULAR PLATFORM, Front" 00
49 * 42 04 48 FF 01
01 "Ä
AuzStations: Single Sided Platforms" 00
50 * 6 01 04 01 FF 06 00
51 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 10 300 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 10 300 64 122 -31 -91 normal chunked
52 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 90 300 64 122 -53 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 90 300 64 122 -53 -102 normal chunked
53 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 170 300 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 170 300 64 122 -0 -0 normal chunked
54 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 250 300 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 250 300 64 122 -31 -91 normal chunked
55 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 330 300 64 122 -9 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 330 300 64 122 -9 -102 normal chunked
56 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 410 300 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 410 300 64 122 -0 -0 normal chunked
57 * 84 00 04 03 01
02 08 "
AS01" 11 FF 09 02
F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 0B 00 10 05 03 2E 84 00 00 00 00 80 00 00 00 2F 44 22 03 80
F3 03 00 00 00 00 00 05 10 03 30 84 00 00 0B 00 00 05 10 03 31 84 00 00 00 00 80 00 00 00 32 44 22 03 80
58 * 7 02 04 00 00 01 00 00
59 * 7 02 04 01 00 01 00 00
60 * 10 03 04 01
02 01 FE 01 00 00 00
61 * 38 04 48 FF 01
02 "Å
TEMPLATE REGULAR PLATFORM, Back" 00
62 * 42 04 48 FF 01
02 "Ä
AuzStations: Single Sided Platforms" 00
63 * 6 01 04 01 FF 0E 00
64 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 10 430 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 10 430 64 122 -31 -91 normal chunked
65 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 90 430 64 122 -53 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 90 430 64 122 -53 -102 normal chunked
66 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 170 430 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 170 430 64 122 -0 -0 normal chunked
67 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 250 430 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 250 430 64 122 -31 -91 normal chunked
68 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 330 430 64 122 -9 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 330 430 64 122 -9 -102 normal chunked
69 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 410 430 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 410 430 64 122 -0 -0 normal chunked
70 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 490 430 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 490 430 64 122 -31 -91 normal chunked
71 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 570 430 64 122 -53 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 570 430 64 122 -53 -102 normal chunked
72 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 650 430 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 650 430 64 122 -0 -0 normal chunked
73 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 730 430 64 122 -31 -91 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 730 430 64 122 -31 -91 normal chunked
74 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 810 430 64 122 -9 -102 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 810 430 64 122 -9 -102 normal chunked
75 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 890 430 64 122 -0 -0 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 890 430 64 122 -0 -0 normal chunked
76 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 970 430 64 46 -31 -20 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 970 430 64 46 -31 -20 normal chunked
77 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png 8bpp 1050 430 64 46 -31 -20 normal chunked
| c:/grfcodec603/auzstations/gfx/template_AuzPlatform_32bpp.png 32bpp 1050 430 64 46 -31 -20 normal chunked
78 * 192 00 04 07 01
03 08 "
AS02" 0B 02 0C FD 0D FE 11 FF 14 00 09 06
F4 03 00 00 00 00 00 10 05 03 2D 04 00 00 00 0B 00 10 05 03 2E 04 00 00 00 00 80 00 00 00 2F 44 22 03 80
F3 03 00 00 00 00 00 05 10 03 30 04 00 00 0B 00 00 05 10 03 31 04 00 00 00 00 80 00 00 00 32 44 22 03 80
02 00 00 00 00 00 00 10 10 10 39 04 00 00 80
02 00 00 00 00 00 00 10 10 10 3A 04 00 00 80
F4 03 00 00 00 00 00 10 05 03 33 04 00 00 00 0B 00 10 05 03 34 04 00 00 00 00 80 00 00 00 35 44 22 03 80
F3 03 00 00 00 00 00 05 10 03 36 04 00 00 0B 00 00 05 10 03 37 04 00 00 00 00 80 00 00 00 38 44 22 03 80
79 * 7 02 04 00 00 01 00 00
80 * 14 02 04 01 81 41 0C 0F 01 04 80 01 01 00 80
81 * 16 02 04 02 81 41 80 0F 00 04 01 01 00 00 00 18 80
82 * 14 02 04 03 81 41 0C 0F 01 08 80 01 01 06 80
83 * 16 02 04 04 81 41 80 0F 00 04 01 03 00 01 01 02 00
84 * 14 02 04 05 81 41 0C 0F 01 0C 80 01 01 0A 80
85 * 16 02 04 06 81 41 80 0F 00 04 01 05 00 02 02 04 00
86 * 14 02 04 07 81 41 0C 0F 01 10 80 01 01 0E 80
87 * 16 02 04 08 81 41 80 0F 00 04 01 07 00 03 03 06 00
88 * 14 02 04 09 81 0C 00 FF 01 08 00 14 14 00 00
89 * 10 03 04 01
03 01 FE 09 00 00 00
90 * 32 04 48 FF 01
03 "Å
TEMPLATE REGULAR PLATFORM" 00
91 * 36 04 48 FF 01
03 "Ä
AuzStations: Island Platforms" 00
Path to the empty graphics templatePath to the 32bpp colored graphicsWe have already adressed these earlier in this thread, you know you need to change those to the appropriate paths
00, 01, 02, 03The Station-IDs.
Each station needs a unique number (just like with objects).
These numbers are hexadecimal!! So, after 09, you get 0A, 0B, 0C, 0D, 0E and 0F, then 10 etc etc
Maximum number is FF, so a maximum of 255 individual stations in one GRF.
So, if you want to add a piece of code, you need to change that number. In this case, the next one should have
04Name that you want to give to the stationThis is where you can give that particular station its name.
IMPORTANT!! keep the "Å"-symbol in front of that name!!!EDIT September 11th 2017:
Actually this is a not entirely correct way to code this!
I used decompiled pieces of code for this and then you get this weird symbol, it does work, but it should be done this way (see Kamnets post and the subsequent post of Michael Blunck):https://www.tt-forums.net/viewtopic.php?f=26&t=62069&hilit=station+dummies#p1099008AS00, AS01, AS02The Purchase Submenu ID.
This will place the stations in their purchase submenu's.
I usually use a combination of 2 letters (related to the name of the GRF, in this case AS for AuzStations) and 2 numbers (the order in which I want to have the submenu's, in this case 00 is the first one, 01, the second etc etc).
IMPORTANT!!! This ID is linked to the Purchase Submenu Name (see below)The Purchase Submenu NameThe name you want to give to the particular purchase submenu.
This name is linked to the purchase submenu ID!!! So make sure that when you add a piece of code with the same Submenu ID, that the Purchase Submenu Name is also the same!!
IMPORTANT!! keep the "Ä"-symbol in front of that name!!!EDIT September 11th 2017:
Actually this is a not entirely correct way to code this!
I used decompiled pieces of code for this and then you get this weird symbol, it does work, but it should be done this way (see Kamnets post and the subsequent post of Michael Blunck):https://www.tt-forums.net/viewtopic.php?f=26&t=62069&hilit=station+dummies#p1099008If you want to add a new category (lets say, non-track tiles), you will have to give that a new Purchase Submenu ID and a new Purchase Submenu Name.
So, for example,
AS03 and
AuzStations: Non-track TilesIf you add something that already has a category, then you dont have to give it a new Submenu-ID and Submenu Name.
Basically, that is all you need to know for now for the coding of these basic stationtiles.
If you want to add a new piece of code, you can just copy/paste one of the codepieces you already have and change the highlighted pieces accordingly.
REALLY REALLY IMPORTANT!!! The Station-IDs you have to change every time, keep good track of what number you are at when you add more stations!!!This is very important regarding the order the stations show up in the purchase menus. The order they show up is in the order they are coded.
So lets say you wanted to insert a station before one that was already coded, then you need to copy/paste its code in before the code of the station already in the GRF. But you will need to give it a Station-ID number higher than the last one you coded, otherwise you will need to change all IDs after it to prevent errors.
If you then add another new station at the end of the code, then that number needs to be one higher than the one you inserted somewhere earlier in the code, thats when you really need to keep track of what number you are at
This hopefully wont happen too often, but just in case I wanted you to know about this.
Also note that inserting code in already existing code will break up save-games and make it incompatible with existing games as the stations in that particular sub-menu will then shift a place.
It may be needed then to let a user know about this, for example in the forum, or in the GRF-description that you can see in the GRF-menu ingame.
Simply adding stations will not give any problems, as they will just show up as a new station after the already existing ones (just like when adding objects).
Do not worry about the numbers in front of the codelines not being in sequence anymore when you copy/paste code in. nforenum.exe will correct those (and also the total number of codelines, as will be stated in line 0 of the code).
I understand that this is a lot to digest
Feel free to ask further explanations!
With this information you should now be able to add more similar style of stations to the ones we already have, I am more than happy to help you on your way with adding those if you run into trouble.
If you eventually want to add new styles of stations (lets say non-track buildings in various sizes, or platforms that have graphics that go over the tracks, like footbridges or roofs) just let me know. I will then make graphics and code templates for you that you can use, without having to exactly understand how they work
You only need to change the above highlighted pieces to make it work in your GRFs.
Good luck!!!