Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Feb 24, 2019 12:09 am

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Jan 29, 2019 10:09 am 
Offline
Engineer
Engineer
User avatar

Joined: Fri Jan 18, 2019 4:48 am
Posts: 6
I'm trying to follow these instructions: https://www.tt-wiki.net/wiki/NFO_Foundations
But at the point where it comes to encoding the file with the command "grfcodec -e mytrain.grf" in step 4, GRFCodec tells me "NFO file missing header and version info", but I've added the // lines so it's not clear how to proceed.

Here's my code so far... I've tried this with the header they show, as well as the following variations from the base graphics NFO in my installation.

Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 6)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
 0 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  466 11656    8   21   -3  -11 normal
 1 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  482 11656   20   14  -14   -7 normal
 2 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  514 11656   29   12  -16   -8 normal
 3 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  562 11656   20   14   -6   -7 normal
 4 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  594 11656    8   20   -3  -10 normal
 5 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  610 11656   20   14  -14   -7 normal
 6 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  642 11656   29   12  -16   -8 normal
 7 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  690 11656   20   14   -6   -7 normal


Variations of header tried, producing same error:

Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 32)
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags


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


Top
   
PostPosted: Tue Jan 29, 2019 12:36 pm 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5338
Location: The Moon
For a NewGRF, you also need a sprite 0 - which just tells it how many sprites there are altogether - and an action 8 before you jump in to writing useful code. Here's something vague I wrote a long time ago.

_________________
Pikkarail.com blog | Patreon
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API


Top
   
PostPosted: Tue Jan 29, 2019 2:56 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Jan 18, 2019 4:48 am
Posts: 6
According to your link, NFORenum will add a sprite 0 for me. NFOrenum however says "Does not appear to be an NFO file. Skipping file." when I try to process what I have. I've tried adding an Action8 line using your example, to the same response from the executable.

Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 32)
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags
 0 * 1    08 07 "JB01" "My first Newgrf" 00 "By Joe Bloggs" 00
 1 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  466 11656    8   21   -3  -11 normal
 2 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  482 11656   20   14  -14   -7 normal
 3 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  514 11656   29   12  -16   -8 normal
 4 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  562 11656   20   14   -6   -7 normal
 5 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  594 11656    8   20   -3  -10 normal
 6 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  610 11656   20   14  -14   -7 normal
 7 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  642 11656   29   12  -16   -8 normal
 8 c:\program files\openttd\sprites/ogfx1_base00.png  8bpp  690 11656   20   14   -6   -7 normal


Top
   
PostPosted: Tue Jan 29, 2019 10:17 pm 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5338
Location: The Moon
Here's a minimally working nfo file. If you're more familiar with actual programming languages, you could also give NML a try - it's what most people use these days.

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    07 00 00 00

// INFO DATA CHUNKS

    1 * 19    14 "C" "INFO"
                  "B" "VRSN" \w4 \d0
              00
    00
    2 * 19    14 "C" "INFO"
                  "B" "MINV" \w4 \d0
              00
    00

    3 * 16    14 "C" "INFO"
                  "B" "PALS" \w1 "A"
              00
    00

    4 * 16    14 "C" "INFO"
                  "B" "BLTR" \w1 "3"
              00
    00

    5 * 67    14 "C" "INFO"
                 "T" "URL_" 7f "https://www.tt-forums.net/viewtopic.php?f=26&t=84786" 00
                 00
             00   

    6 * 17    14 "C" "INFO"
                "B" "NPAR" \w1 \b0
            00

         00
   00   

    7 * 16    08 08 "IDID" "Name" 00 "Desc" 00


//Something goes here.

_________________
Pikkarail.com blog | Patreon
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API


Top
   
PostPosted: Thu Jan 31, 2019 11:38 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
Cryolaser wrote:
...
GRFCodec is distributed with a lintner called nforenum.

Try running nforenum -c / mytrain.nfo
Then view mytrain.nfo in your text editor.
Note: The -c / allows you to insert comments after //
You should see the header as it appears in PikkaBird's sample.

If all looks good then run grfcodec -e mytrain.grf

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Sat Feb 23, 2019 5:03 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Jan 18, 2019 4:48 am
Posts: 6
Been a while but I want to thank y'all, it's most gracious of you. I don't have any experience of coding, but I only want to make a few locomotives, so the template is immensely helpful.


Top
   
PostPosted: Sat Feb 23, 2019 6:20 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9178
Location: Sol d
You might want to have a look at the tutorials over at tt-wiki: https://www.tt-wiki.net/wiki/NMLTutorial

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Sat Feb 23, 2019 7:58 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 6464
Location: Eastern KY
Cryolaser wrote:
Been a while but I want to thank y'all, it's most gracious of you. I don't have any experience of coding, but I only want to make a few locomotives, so the template is immensely helpful.


Congratulations! You're now a coder! We look forward to your contributions.

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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-2019 phpBB Limited

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