Any more information on how to build NewGRFs with nmlc??
Moderator: OpenTTD Developers
Any more information on how to build NewGRFs with nmlc??
I feel like I want to strangle a bunny. Want to look into how GRFs are put together and the information is so sparse and distributed amongst 20 defunct websites and people linking to pages that no longer exist. I downloaded and built, as best I can tell, nml from the OpenTTD repo. So I then downloaded FIRS source to use as reference, which states a few prerequisites that need to be installed, which I have ostensibly done. I finally got 'make' working, and tried to build it and just want to cry after bashing my head off it for like 4 hours. I think nmlc is failing to load because 'ply' doesn't exist, but I installed ply via pip and python is convinced 'requirements are already satisfied' yet I just get these confusing errors insinuating it doesn't.
Traceback (most recent call last):
File "nmlc", line 3, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "nml\main.py", line 21, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "nml\parser.py", line 16, in <module>
ModuleNotFoundError: No module named 'ply'
[43728] Failed to execute script nmlc
I'm hoping this is all that is wrong because the makefile seems to be saying every 'CreateProcess' has failed and the output is not clear as to whether there are fails before this or the traceback shown at the end is the reason for those 10 fails above it.
PS D:\OpenTTD\firs> make
process_begin: CreateProcess(NULL, env python3 D:\OpenTTD\firs\bin\find-files --ext=.py --ext=.pynml --ext=.lng src, ...) failed.
process_begin: CreateProcess(NULL, env python3 D:\OpenTTD\firs\bin\find-files --ext=.py --ext=.pynml --ext=.pt --ext=.lng src, ...) failed.
process_begin: CreateProcess(NULL, which dot, ...) failed.
process_begin: CreateProcess(NULL, which gvpr, ...) failed.
process_begin: CreateProcess(NULL, which gvpr, ...) failed.
process_begin: CreateProcess(NULL, which dot, ...) failed.
process_begin: CreateProcess(NULL, env python3 D:\OpenTTD\firs\bin\find-files --ext=.py --ext=.pynml src, ...) failed.
process_begin: CreateProcess(NULL, env python3 D:\OpenTTD\firs\bin\find-files --ext=.py --ext=.png src, ...) failed.
nmlc -c -l generated/lang --verbosity=4 --grf=generated/firs.grf generated/firs.nml
Traceback (most recent call last):
File "nmlc", line 3, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "nml\main.py", line 21, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "nml\parser.py", line 16, in <module>
ModuleNotFoundError: No module named 'ply'
[37136] Failed to execute script nmlc
make: *** [generated/firs.grf] Error 1
This unix style makefile stuff always feels so obtuse and vague like you're just meant to innately understand how to do it all, I don't think I've ever managed to successfully build something with a makefile without these kinds of cascading problems (that wasn't cmake) and is one reason I've shied away from being involved with open source stuff in the past god bless lovely visual studio projects where you just load it up and click compile.
Traceback (most recent call last):
File "nmlc", line 3, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "nml\main.py", line 21, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "nml\parser.py", line 16, in <module>
ModuleNotFoundError: No module named 'ply'
[43728] Failed to execute script nmlc
I'm hoping this is all that is wrong because the makefile seems to be saying every 'CreateProcess' has failed and the output is not clear as to whether there are fails before this or the traceback shown at the end is the reason for those 10 fails above it.
PS D:\OpenTTD\firs> make
process_begin: CreateProcess(NULL, env python3 D:\OpenTTD\firs\bin\find-files --ext=.py --ext=.pynml --ext=.lng src, ...) failed.
process_begin: CreateProcess(NULL, env python3 D:\OpenTTD\firs\bin\find-files --ext=.py --ext=.pynml --ext=.pt --ext=.lng src, ...) failed.
process_begin: CreateProcess(NULL, which dot, ...) failed.
process_begin: CreateProcess(NULL, which gvpr, ...) failed.
process_begin: CreateProcess(NULL, which gvpr, ...) failed.
process_begin: CreateProcess(NULL, which dot, ...) failed.
process_begin: CreateProcess(NULL, env python3 D:\OpenTTD\firs\bin\find-files --ext=.py --ext=.pynml src, ...) failed.
process_begin: CreateProcess(NULL, env python3 D:\OpenTTD\firs\bin\find-files --ext=.py --ext=.png src, ...) failed.
nmlc -c -l generated/lang --verbosity=4 --grf=generated/firs.grf generated/firs.nml
Traceback (most recent call last):
File "nmlc", line 3, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "nml\main.py", line 21, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "nml\parser.py", line 16, in <module>
ModuleNotFoundError: No module named 'ply'
[37136] Failed to execute script nmlc
make: *** [generated/firs.grf] Error 1
This unix style makefile stuff always feels so obtuse and vague like you're just meant to innately understand how to do it all, I don't think I've ever managed to successfully build something with a makefile without these kinds of cascading problems (that wasn't cmake) and is one reason I've shied away from being involved with open source stuff in the past god bless lovely visual studio projects where you just load it up and click compile.
- 2TallTyler
- Route Supervisor
- Posts: 508
- Joined: 11 Aug 2019 18:15
- Contact:
Re: Any more information on how to build NewGRFs with nmlc??
FIRS is one of the more complicated NewGRFs to build because it uses Python to generate code. Try something simpler like my X2000 train made for a contest. It can be compiled by running nmlc from the command line on the merged NML file in src/merged, or using the simple Python script make.py in the root folder of the repo.
Also, you may want to join the OpenTTD Discord, where most NewGRF and a lot of game development is discussed, more so than the forums. There’s an invite link on the website:
https://wiki.openttd.org/en/Community/Community
Also, you may want to join the OpenTTD Discord, where most NewGRF and a lot of game development is discussed, more so than the forums. There’s an invite link on the website:
https://wiki.openttd.org/en/Community/Community
Re: Any more information on how to build NewGRFs with nmlc??
if you ever encounter this type of error, the first impulse should be to run
Code: Select all
pip install ply
Re: Any more information on how to build NewGRFs with nmlc??
Thanks! Yup that's exactly what I did, as I said it just reports "'requirements are already satisfied'" and the error continues.Eddi wrote: ↑24 Apr 2021 14:02if you ever encounter this type of error, the first impulse should be to runCode: Select all
pip install ply
Re: Any more information on how to build NewGRFs with nmlc??
You're probably better off using a Linux environment (Linux VM, WSL 2, or similar) and not native Windows.
As soon as you see make, Python, shell scripts, or any other standard POSIX tooling you should take it a strong hint to not use Windows.
As soon as you see make, Python, shell scripts, or any other standard POSIX tooling you should take it a strong hint to not use Windows.
Ex TTDPatch Coder
Patch Pack, Github
Patch Pack, Github
Re: Any more information on how to build NewGRFs with nmlc??
Ha yup I can definitely see this is the case, however I've been pretty allergic to linux my entire life, made multiple attempts at installs or vms and can't help feeling it's not made for me, ended up with the rather angry feeling experience above magnified to doing even simpler things in the OS like unzipping a file or editing a text file. Will consider it but more likely will just look at the simpler grf stuff posted above. Too old and set in my ways to be excited to dive into linux again
Re: Any more information on how to build NewGRFs with nmlc??
WSL2 is dead simple to install and set up. I used a couple of YouTube videos to help me. Took all of 10 minutes to have an environment ready to go.
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
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 | GarryG's Auz Sets
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 | GarryG's Auz Sets
Re: Any more information on how to build NewGRFs with nmlc??
I can 2nd using WSL on windows. It's great, I've got a few of my projects to a point I can just shift+right click in a projects main folder, click 'Open Linux Shell Here', type make clean, then make, and just take the finished .grf and do whatever with it.
Also, you can just install all the NML components with PIP and call it a day, it'll install grfcodec, nforenum, nmlc and everything in your $PATH so you don't even have to worry, just run the commands in the Linux shell straight from whatever folder you're in. You can also launch those same linux shells from within VS2019 as well, so you can use VS as your IDE for working on .grf projects be they NFO or NML.
s***'s pretty comfy, yo.
Also, you can just install all the NML components with PIP and call it a day, it'll install grfcodec, nforenum, nmlc and everything in your $PATH so you don't even have to worry, just run the commands in the Linux shell straight from whatever folder you're in. You can also launch those same linux shells from within VS2019 as well, so you can use VS as your IDE for working on .grf projects be they NFO or NML.
s***'s pretty comfy, yo.
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
Re: Any more information on how to build NewGRFs with nmlc??
Will check that out, thanks all <3
Re: Any more information on how to build NewGRFs with nmlc??
Hello
Tschö, Auge
Do you possibly run multiple Python versions on your machine? Maybe a 2.7.x and a 3.x?lemmy101 wrote: ↑24 Apr 2021 15:02Thanks! Yup that's exactly what I did, as I said it just reports "'requirements are already satisfied'" and the error continues.Eddi wrote: ↑24 Apr 2021 14:02if you ever encounter this type of error, the first impulse should be to runCode: Select all
pip install ply
Tschö, Auge
Re: Any more information on how to build NewGRFs with nmlc??
Nope!Auge wrote: ↑25 Apr 2021 11:26 Hello
Do you possibly run multiple Python versions on your machine? Maybe a 2.7.x and a 3.x?lemmy101 wrote: ↑24 Apr 2021 15:02Thanks! Yup that's exactly what I did, as I said it just reports "'requirements are already satisfied'" and the error continues.Eddi wrote: ↑24 Apr 2021 14:02
if you ever encounter this type of error, the first impulse should be to runCode: Select all
pip install ply
Tschö, Auge
Who is online
Users browsing this forum: Google [Bot] and 3 guests