EDIT:
Just read Michaels responce while typing this.
First I should write this:
*DISCLAIMER*
There are many ways (and probably better ways) to draw, code and compile a stationGRF, I do NOT claim that my way is the best or simplest or tidiest, but it works for me.
*/DISCLAIMER*
Secondly, as you said that you understand NML, then going with Michaels m4nfo is a better way to go....
Ok, my post before Michaels responce
But if I tried copy it in my new grf and rewrite numbers/paths - it gives to me the error like in post above.
Hmmmm.....
I'm guessing now a bit...
But how do the first lines of your code look like (those that start with "//" ), does it look like this:
Code: Select all
// 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
If not, try this or the one you got when decoding with version 605.
If I will have for example 10 station tiles like a group, I code them in NFO like a group too?
Yes.
But you need to specify in the Action-0 (line 7 in your example) what the lay-out will be (2x5 or 5x2, note that the max size of a station that can be built as a complete "block/group" is 7x7, so for example 1x10 is not possible without using drag&drop).
And you need Action-2s to specify what tile goes where in the lay-out!!
I mean - I will take my code above and add 6*2 sprites
No.
For a 10-tile station you will need 40 regular sprites (8bpp) (10 for foreground direction-1, 10 for background direction-1, 10 for foreground direction-2 and 10 for background direction-2) and this is multiplied by the number of 32bpp zoomlevels you have (with that "|" in front of it)
and to line 7 add next 6 codes, ok
Line 7 will then have 20 lines (10 for the first direction and 10 for the other direction), so the number of tiles used by the station ingame x2.
But for multitile stations you will also need to add purchase-menu sprites (2, for each direction), these sprites you will also have to add into the graphics-block of your code offcourse.
behind sprite data - 10 05 03 there is 2D 84 bits. 84 is somethink like separation bit (I think) and what is the 2D bit? In next part of code it is 2E, in next 2F, 30,...
2D 84 00 00 is the spritenumber that refers to the sprites in your Action-1 block (the graphicsblock) Actually the number is 0000842D (its HexaDecimal, reversed bite order), 33837 in Decimals.
The next numbers then are 0000842E, 0000842F, 00008430, 00008431,...,...,..., 00008439, 0000843A, 0000843B,...,...,..., 0000843F, 00008440, 00008441, etc etc.
ALWAYS START WITH 2D FOR YOUR FIRST SPRITENUMBER!!!
This has something to do with that you are adding new graphics to the game, 33837 (in decimals) is some kind of "magic" number
Dont ask me why, it just is
EDIT: The "magic" number is offcourse 2D 04 00 00 (the first number used for regular sprites, see later on in this post) so 1069 in Decimal.
EDIT2: Just checked the above, 1069 is the spritenumber for the first stationsprite in the Base Graphics, probably not a coincidence
These numbers add up only for that single station. So the next station-code can start again with 2D 84 00 00
Furthermore, in this case the 84 means that the sprite has companycolors and those should be displayed accordingly to the companycolors of the player, when the tile is placed ingame.
Regular sprites have 04 (so 2D 04 00 00) and sprites that have the see-thru glass effect have 44 22 03 (so 2D 44 22 03)
Have you checked out the NFO-wiki? As that gives a lot of information:
https://newgrf-specs.tt-wiki.net/wiki/Main_Page
Furthermore, this site can be handy for converting decimals into hexadecimals:
http://www.statman.info/conversions/hexadecimal.html