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:
This is the "trains module", you have to include it in the command which starts M4:
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!)
This is a special m4nfo file which adds real sprite numbers to the resulting nfo code, for trouble shooting:
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!):
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":
grfcodec -e test.grf
Eventually, all of the previous commands can be easily put into a batch file, e.g. "train.bat":
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.