Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Jun 21, 2018 10:07 am

All times are UTC




Post new topic  Reply to topic  [ 23 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Thu Jan 11, 2018 1:09 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5186
Tony Pixel wrote:
I didn't think what m4 is bad, I have so many problems with it.

What exactly are your problems with M4?

1) Did you download it? Here´s a pre-compiled version -> http://gnuwin32.sourceforge.net/packages/m4.htm

Make sure that the location where you put it is included in your $PATH var.

Does it work for you? -> run "m4 --version" in a command window. What does it tell?

2) Did you download grfcodec? Here it is -> http://www.openttd.org/en/download-grfcodec

Again, make sure that the location where you put it is included in your $PATH var.

Does it work? run "grfcodec -?" in a command window. What does it tell?

3) Now, download the m4nfo module for "trains" -> http://www.ttdpatch.de/grfspecs/m4nfoMa ... trains.zip

Unzip it, it includes two .m4 files:

- "m4nfo_trains.m4"
This is the "trains module", you have to include it in the command which starts M4:
Code:
M4 -R m4nfo_trains.m4 < test.nfx > test.nfo 

where "test.nfx" is your m4nfo source file and "test.nfo" is the resulting NFO output file for grfcodec (instead of "test", you should use your own file names here!)

- "count.m4"
This is a special m4nfo file which adds real sprite numbers to the resulting nfo code, for trouble shooting:
Code:
copy count.m4 + test.nfo test.tt

This (windows!) command writes "count.m4" and "test.nfo" into a new file "test.tt". And in a second step, is handed over to M4 (again!):

Code:
M4 < test.tt > test.nfo

Now, "test.nfo" contains proper sprite numbers which might be used e.g. by the linter program "nforenum".

The resulting file "test.nfo" can now be fed to grfcodec, together with any graphics, included in file "test.png":
Code:
grfcodec -e test.grf

That´s all.


Eventually, all of the previous commands can be easily put into a batch file, e.g. "train.bat":
Code:
M4 -R m4nfo_trains.m4 < $1.nfx > $1.nfo
copy count.m4 + $1.nfo $1.tt
M4 < $1.tt > $1.nfo
grfcodec -e $1.grf

so the command "train mytest" would produce "mytest.grf" from files "mytest.nfx" and "mytest.png".

The only problem is to set up your directory structure and your PATH var in a proper way so that every file can be found.

HTH
Michael

_________________
Image


Top
   
PostPosted: Thu Jan 11, 2018 3:01 pm 
Online
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sat Oct 14, 2017 11:06 am
Posts: 282
Location: Mariupol, Ukraine.
How to set PATH variable?

_________________
Image
Sprite artist and NewGRF developer, NML coder. My projects:
Screenshots: New York City Subway Episodes
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Over-sized Train Set | Tony Pixel's Subway Equipment Set

I use GPLv2+ license.


Top
   
PostPosted: Fri Jan 12, 2018 11:38 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4632
Location: home
Tony Pixel wrote:
How to set PATH variable?
Search for "windows set PATH", really the Internet knows the answer to most questions.

Random URL from the collection: https://stackoverflow.com/questions/954 ... in-windows

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 23 posts ]  Go to page Previous 1 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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.