Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Sep 25, 2018 6:14 am

All times are UTC




Post new topic  Reply to topic  [ 15 posts ] 
Author Message
 Post subject: NFO meta-data problem
PostPosted: Tue Aug 15, 2017 1:19 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Jul 02, 2015 8:05 am
Posts: 141
Location: Czech Republic
Hi all
I'm new in NFO coding, cause I know code in nml. But some things like stations I have to code in NFO. I found soume tutorial here. Tried to make some station tile and it gives to me error in grfcodec. What happened?
Attachment:
bug.JPG [190.5 KiB]
Not downloaded yet

And the second question. In line 7, there are information about tiles itself. It has two parts - background and foreground. But what, if I have only background? How to write it? Code in tutorial seems like this. Two tiles with background and foreground.
Code:
 7 * 62    00 04 02 01 00 08 "TUT0" 09 02 F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 00 00 10 10 7A 2E 84 00 00 80 F3 03 00 00 00 00 00
 05 10 03 2F 84 00 00 00 00 00 10 10 7A 30 84 00 00 80

Thanks :)

_________________
Image


Top
   
PostPosted: Tue Aug 15, 2017 2:09 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1601
Location: The Netherlands
What version of GRFcodec are you using?
Looks to me like an older version... (as it refers to a pcxfile in the format description)

I use version 603 (more recent versions may be available) that has this format for the graphicssprites:
Code:
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags

The code for my sprites look like this then (note: I dont use a zoomlevel, the 32bpp sprite is for all zoomlevels, If I am correct "normal" in the 32bpp sprite should then be changed to the zoomlevel you want):
Code:
   11 c:/grfcodec603/dstatadd_part3/gfx/zwolle/zwolle_frontview_8bpp_EMPTY.png  8bpp   10  40   64  122  -31  -91 normal chunked
    | c:/grfcodec603/dstatadd_part3/gfx/zwolle/zwolle_frontview_32bpp.png  32bpp   10    40   64  122  -31  -91 normal chunked
   12 c:/grfcodec603/dstatadd_part3/gfx/zwolle/zwolle_frontview_8bpp_EMPTY.png  8bpp   90  40   64  122  -0  -0 normal chunked
    | c:/grfcodec603/dstatadd_part3/gfx/zwolle/zwolle_frontview_32bpp.png  32bpp    90   40   64  122  -0  -0 normal chunked

Quote:
And the second question. In line 7, there are information about tiles itself. It has two parts - background and foreground. But what, if I have only background? How to write it? Code in tutorial seems like this. Two tiles with background and foreground.

A stationtile is built up from two graphicssprites, one for in front of the track and the other for the back of the track (logical, as a train can pass between them and you want the backpart be obstructed from view by the train and you want the train be obstructed from view by structures on the frontpart)
Keep the code as is (so code for a foreground and background), but leave the part you want "empty" as transparent blue box in the 8bpp graphics and transparent in the 32bpp graphics.
Thats how you get the single-sided platforms. So do that graphically, not via the code.

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Aug 15, 2017 2:33 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Jul 02, 2015 8:05 am
Posts: 141
Location: Czech Republic
I have version 6.0.5 of grfcodec. If I for example decode some existing grf, sprite-line looks like this (witn my edit due 32bit. But it works corectly)
Code:
1594 sprites/total_bridges_NAR00.png  8bpp  130 4184   50   39  -25   -6 normal chunked
    | sprites/MOSTY_CZ.png    32bpp 0 200 256 173 -128 -79 zi4 chunked nocrop

But if I tried copy it in my new grf and rewrite numbers/paths - it gives to me the error like in post above.

Second question is OK. I had the same idea, to made it transparent but I didn't sure. And maybe one more question about it. If I will have for example 10 station tiles like a group, I code them in NFO like a group too? I mean - I will take my code above and add 6*2 sprites and to line 7 add next 6 codes, ok? Here is my next question. I take for example the foreground like this
Code:
00 00 00 00 00 10 05 03 2D 84

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,...
Thanks :)

_________________
Image


Top
   
PostPosted: Tue Aug 15, 2017 3:26 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5237
Quast65 wrote:
A stationtile is built up from two graphicssprites [...]

A station tile might consist of more than two graphics sprites.

Quast65 wrote:
Keep the code as is (so code for a foreground and background), but leave the part you want "empty" as transparent blue [...] So do that graphically, not via the code.

This is pointless. You might only provide the needed graphics sprites in the code.

stefino_cz wrote:
Code:
00 00 00 00 00 10 05 03 2D 84


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,...

These are sprites numbers from an action1 sprite block, 0x42D being the first sprite, 0x42E being the second one, etc. 0x842D ("2D 84") meaning to draw the sprite in company colour translation.

The m4nfo user manual includes tutorials for station coding and other explanations w/r to coding stations, which might be more helpful than the raw specs.

regards
Michael

_________________
Image


Top
   
PostPosted: Tue Aug 15, 2017 3:32 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1601
Location: The Netherlands
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 ;-)



Quote:
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:
// 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.

Quote:
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!!
Quote:
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)
Quote:
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.
Quote:
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

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Aug 15, 2017 4:55 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Jul 02, 2015 8:05 am
Posts: 141
Location: Czech Republic
Thanks, Michael, but I think that I will try to understand basic nfo :)

Quast65: I made some changes. The main problem was in first // lines. I had it wrong. Now it is ok. But I have the next problem at last lines atm.
Attachment:
bug.JPG [187.76 KiB]
Not downloaded yet

I decoded your Dutchsets addons and it looks like the same but grfcodec gives this error due filename :?

_________________
Image


Top
   
PostPosted: Tue Aug 15, 2017 5:24 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1601
Location: The Netherlands
I assume you are following the tutorial I wrote 5 years ago:
https://www.tt-forums.net/viewtopic.php?f=26&t=62069

Have you read the last two posts in that thread?
Try that first. As that is how it should be done.

At the time I used code-examples from decoded GRFs and didnt know what the "Å" and "Ä" symbols did and meant in the last lines of the code...
For some silly reason I kept using those (well it worked... :oops: ), even now... :oops:

Are you actualy using the "Å" symbol in codeline 12 (so capital A with a little circle above it)? As your picture is a bit unclear (looks more like a small stripe, then a little circle).
Placing the actual code here would be better, rather than a picture of it.

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Aug 15, 2017 5:36 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Jul 02, 2015 8:05 am
Posts: 141
Location: Czech Republic
Mmm...I read it but still doesn't work
Code:
// 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    0D 00 00 00
    1 * 16    14 "CSSTATIONS" 01 00 57 00 00
    2 * 127    08 07 "MI" 01 08 "CS Stations Addition Set "
    "v1" 00 "Doplnujici set pro Cesko-Slovenske stanice." 0D 0D 0D "By stefno_cz" 0D "This "
    "set includes station addons " 00
    3 * 6    01 04 01 FF 04 00                   
    4  sprites/PLACEHOLDER.png  8bpp  0 0 32 32 0 0  normal chunked
       |  sprites/vyhybky_1.png    32bpp 0 0 256 128 -128 0 zi4 chunked nocrop
    5 sprites/PLACEHOLDER.png   8bpp  0 0 32 32 0 0 normal chunked
       |  sprites/vyhybky_1.png    32bpp 256 0 256 128 -128 0 zi4 chunked nocrop
    6 sprites/PLACEHOLDER.png   8bpp  0 0 32 32 0 0 normal chunked
       |  sprites/vyhybky_1.png    32bpp 512 0 256 128 -128 0 zi4 chunked nocrop
    7 sprites/PLACEHOLDER.png   8bpp  0 0 32 32 0 0 normal chunked
    |  sprites/vyhybky_1.png        32bpp 768 0 256 128 -128 0 zi4 chunked nocrop
 8 * 62    00 04 02 01 00 08 "VYH0" 09 02
 F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 00 00 10 10 7A 2E 84 00 00 80
 F3 03 00 00 00 00 00 05 10 03 2F 84 00 00 00 00 00 10 10 7A 30 84 00 00 80
   9 * 7    02 04 00 00 01 00 00   
   10 * 7    02 04 01 00 01 00 00   
   11 * 10    03 04 01 00 01 FE 01 00 00 00
   12 * 25    04 48 FF 01 00 C5"Vyhybka rucni 1" 00
   13 * 16    04 48 FF 01 00 C4"Vyhybky" 00

_________________
Image


Top
   
PostPosted: Tue Aug 15, 2017 5:37 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1601
Location: The Netherlands
there has to be a space between C5 "text" and C4 "text"

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Aug 15, 2017 5:57 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5237
stefino_cz wrote:
Thanks, Michael, but I think that I will try to understand basic nfo :)

It´s always a good thing to *understand* plain nfo, but you won´t like to code in it. :p
You might believe me (or not), I´ve been coding in plain nfo for years.

But anyway, at least then there won´t be questions. :cool:

regards
Michael

_________________
Image


Top
   
PostPosted: Tue Aug 15, 2017 5:59 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1601
Location: The Netherlands
Quote:
But anyway, at least then there won´t be questions.

Lucky you.... :wink:

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Aug 15, 2017 6:27 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1601
Location: The Netherlands
stefino_cz wrote:
Mmm...I read it but still doesn't work

There is something else that may not be correct.

Change the Action-14 in codeline 1 from:
Code:
    1 * 16    14 "CSSTATIONS" 01 00 57 00 00

to:
Code:
    1 * 24    14 "C" "INFO" "B" "PALS" \w1 "D" "B" "BLTR" \w1 "3" 00 00

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Aug 15, 2017 7:10 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Jul 02, 2015 8:05 am
Posts: 141
Location: Czech Republic
Problem was in note in 8th line. I delete it and it is OK now :) So thanks ^_^

_________________
Image


Top
   
PostPosted: Tue Aug 15, 2017 7:31 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1601
Location: The Netherlands
Quote:
it is OK now

Good!!!
Attachment:
DarkSideForce.jpg
DarkSideForce.jpg [ 141.75 KiB | Viewed 956 times ]

You have now joined the Dark Side of the OpenTTD-Force called Station-coding....
Unlimited options and possibilities are now at your feet, providing a hunger for more and more that can never be satisfied!!!
Muhahahahahaha!!! ;-)

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Aug 15, 2017 8:14 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Jul 02, 2015 8:05 am
Posts: 141
Location: Czech Republic
Yes yes...and a lot of work ahead of me (us) :lol: We are two and still searching for new members what will help us with graphics. You can see it in grf develop section in my topic :)
Attachment:
Nové Sedliště Transport, 6. úno 2002.jpg [1000.61 KiB]
Not downloaded yet

_________________
Image


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.