What exactly are your problems with M4?Tony Pixel wrote: I didn't think what m4 is bad, I have so many problems with it.
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: Select all
M4 -R m4nfo_trains.m4 < test.nfx > test.nfo
- "count.m4"
This is a special m4nfo file which adds real sprite numbers to the resulting nfo code, for trouble shooting:
Code: Select all
copy count.m4 + test.nfo test.tt
Code: Select all
M4 < test.tt > test.nfo
The resulting file "test.nfo" can now be fed to grfcodec, together with any graphics, included in file "test.png":
Code: Select all
grfcodec -e test.grf
Eventually, all of the previous commands can be easily put into a batch file, e.g. "train.bat":
Code: Select all
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
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