Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri Aug 17, 2018 11:20 pm

All times are UTC




Post new topic  Reply to topic  [ 30 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: 5237
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 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sat Oct 14, 2017 11:06 am
Posts: 355
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: 4655
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
   
PostPosted: Tue Aug 14, 2018 8:11 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sat Oct 14, 2017 11:06 am
Posts: 355
Location: Mariupol, Ukraine.
After many time, I return to this thread, and have an old questions. As You said, I downloaded the grfcodec and set up the PATH variable - added to the end:
Code:
;D:\Anton\grfcodec\

Next, I went to the this page, downloaded and unpacked "m4-1.4.18.tar.gz" archive. Then also added to the PATH variable:
Code:
;D:\Anton\m4nfo\

What to do next? I tried "M4 -R m4nfo_trains.m4 < test.nfx > test.nfo" in cmd, but nothing happened.

_________________
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: Tue Aug 14, 2018 10:53 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1198
Location: Courbevoie, near Paris, France
Did it send an error or something ?

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Tue Aug 14, 2018 10:53 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sat Oct 14, 2017 11:06 am
Posts: 355
Location: Mariupol, Ukraine.
File not found

_________________
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: Tue Aug 14, 2018 10:55 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1198
Location: Courbevoie, near Paris, France
What file is it talking about ?

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Tue Aug 14, 2018 11:49 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sat Oct 14, 2017 11:06 am
Posts: 355
Location: Mariupol, Ukraine.
It simply says "File not found"

_________________
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: Tue Aug 14, 2018 12:46 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1198
Location: Courbevoie, near Paris, France
Did you open m4nfo correctly by a command file ? You have to right-click on the directory, click on modify the adress and type "cmd" instead of the adress.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Wed Aug 15, 2018 6:38 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4655
Location: home
Tony Pixel wrote:
After many time, I return to this thread, and have an old questions. As You said, I downloaded the grfcodec and set up the PATH variable - added to the end:
Code:
;D:\Anton\grfcodec\

Next, I went to the this page, downloaded and unpacked "m4-1.4.18.tar.gz" archive. Then also added to the PATH variable:
Code:
;D:\Anton\m4nfo\

What to do next? I tried "M4 -R m4nfo_trains.m4 < test.nfx > test.nfo" in cmd, but nothing happened.
Since you start with "m4", you're trying to run the 'm4' program. Is there an m4 executable either in "D:\Anton\grfcodec\" or in "D:\Anton\m4nfo\" ? (There shouldn't be, since the command failed.)

The next question is then, where did you put the "m4" executable instead?
Given that you donwloaded a GNU package, I would gamble it is in d:\anton\m4-1.4.16\bin\m4 (if you unpacked the m4-1.4.18.tar.gz in d:\anton). If you did, you should also add "d:\anton\m4-1.4.18\bin" to the PATH. (In any case, PATH should contain the directory path of the directory that has the m4 program.)

Note that the PATH is mostly a convenience for you, so you can type "m4" and the computer looks through the directories in the PATH, until it finds an executable with the given name. If you type what to run with a \ in it, the entire PATH resolving is skipped, and it tries to run whatever you typed. ie, if you enter "d:\somewhere\sometime\somehow\bla" at the command-line, it will literally try run the "bla" program at the given path (if it exists), without using the PATH variable.
As such, you can always type the full path of a program to run it (eg "d:\anton\m4-1.4.18\bin\m4 < test.nfx > test.nfo" if d:\anton\m4-1.4.18\bin\m4 exists).

_________________
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  [ 30 posts ]  Go to page Previous 1 2

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.