NML - a Newgrf Meta Language
Moderator: Graphics Moderators
Re: NML - a Newgrf Meta Language
Thanks for replies, indeed, I had old 2.7 pip
Re: NML - a Newgrf Meta Language
How to downgrade to previous nml?
I made something wrong and have error:
even if removed by apt-get, autocleaned and installed old nml_0.2.4 which was working before, got same error.
I made something wrong and have error:
Code: Select all
$ nmlc
Traceback (most recent call last):
File "/usr/local/bin/nmlc", line 9, in <module>
load_entry_point('nml==0.4.0.r5530-84d58305a9ed', 'console_scripts', 'nmlc')()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named 'nml'
Re: NML - a Newgrf Meta Language
The 'nml' package needs to be available, as it contains the actual Python code of the compiler. The 'nmlc' file is just a simple 5 line wrapper script.
'available package' to Python means either to have it in the packages search path of your Python version, or have it right next to the program that you start (ie the 'nml' directory has to be right next to 'nmlc'). The latter is the case if you download the source (or clone the nml repository).
In other words, if you use the 'nmlc' that comes with the downloaded source, it will run without installing it. The simplest way to do that is by something like
However, typing that full path gets a bit boring after a few times. A better solution is to make 'nmlc' available in one of the standard shell PATH directories, or add a new directory to it.
I have added $HOME/bin to my PATH variable (containing all my own custom programs), and did
It creates a link named $HOME/bin/nmlc that points to the nmlc program in the repository.
When I type 'nmlc', the shell looks for a program with that name using the PATH variable, finds $HOME/bin/nmlc, follows the link, and runs /long/absolute/path/to/nml/repository/nmlc .
'available package' to Python means either to have it in the packages search path of your Python version, or have it right next to the program that you start (ie the 'nml' directory has to be right next to 'nmlc'). The latter is the case if you download the source (or clone the nml repository).
In other words, if you use the 'nmlc' that comes with the downloaded source, it will run without installing it. The simplest way to do that is by something like
Code: Select all
cd nml_project
/long/absolute/path/to/nml/repository/nmlc myproject.nml
I have added $HOME/bin to my PATH variable (containing all my own custom programs), and did
Code: Select all
cd $HOME/bin
ln -s /long/absolute/path/to/nml/repository/nmlc nmlc
When I type 'nmlc', the shell looks for a program with that name using the PATH variable, finds $HOME/bin/nmlc, follows the link, and runs /long/absolute/path/to/nml/repository/nmlc .
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: NML - a Newgrf Meta Language
There was already nmlc wrapper in usr/local/bin, installed by nml 0.4.0 setup.py, but not working properly.
I removed it, installed old nml_0.2.4-1_all.deb and it works fine again.
I removed it, installed old nml_0.2.4-1_all.deb and it works fine again.
Re: NML - a Newgrf Meta Language
Is it possible to suppress all these "animation" (blinking pixels) warnings spam in 0.4.0 version, without forcing ---quiet for all warnings?
-
- Tycoon
- Posts: 2781
- Joined: 22 Feb 2011 18:34
Re: NML - a Newgrf Meta Language
See Realsprites. Since some time warnings are given because animated pixels are often unintentional, so you need to set the ANIM flag for your sprites instead of the default NOANIM.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Graphics Workflow
Try pillow instead of PILabregado wrote:Yeah I ment the XY Offsets. Terminology fail.V453000 :) wrote:What do you mean by pixel locations?
I'll dig around in RAWR. Right now it seems my biggest issue is getting the nml encoder to install. First it was Python version issues and now it wont detect that I have Python Image Library installed. gah!
Also: why do you need to install that manually? Any linux comes with a decent packaging system, thus you just install python3, pillow and ply. On OSX you can do the same by means of macports or brew. And for windows there are pre-compiled binaries of nml.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Graphics Workflow
Im kinda new to Ubuntu/unix. It seems that I have several versions of python installed 2.6/2.7/3.2/3.4 and regardless of which interpreter I choose to run setup.py with it tells me I dont have the right version. I guess it is detecting the default version of the python executable (2.7)planetmaker wrote: Also: why do you need to install that manually? Any linux comes with a decent packaging system, thus you just install python3, pillow and ply. On OSX you can do the same by means of macports or brew. And for windows there are pre-compiled binaries of nml.
So Im trying some other solutions with virtualenv but this is failing as pip doesn't seem to find ply and pillow in the package repos (tells me those are not valid package names)
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Graphics Workflow
maybe there is no pillow or pil for python3 in your repositories. If so, install it using pip (use the pip for the proper version, thus either 3.2 or 3.4, whatever is your default python3; check by looking at what python it points to:abregado wrote:Im kinda new to Ubuntu/unix. It seems that I have several versions of python installed 2.6/2.7/3.2/3.4 and regardless of which interpreter I choose to run setup.py with it tells me I dont have the right version. I guess it is detecting the default version of the python executable (2.7)planetmaker wrote: Also: why do you need to install that manually? Any linux comes with a decent packaging system, thus you just install python3, pillow and ply. On OSX you can do the same by means of macports or brew. And for windows there are pre-compiled binaries of nml.
So Im trying some other solutions with virtualenv but this is failing as pip doesn't seem to find ply and pillow in the package repos (tells me those are not valid package names)
Code: Select all
ls -l /usr/bin/python3
Code: Select all
sudo apt-get install python3
sudo apt-get install python3-ply
sudo apt-get install python3-pip
sudo /usr/bin/pip-3.2 install pillow
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
- te_lanus
- Transport Coordinator
- Posts: 326
- Joined: 19 Jul 2012 18:04
- Location: The Elizabeth Arkham Asylum for the Criminally Insane
Re: NML - a Newgrf Meta Language
Just a quick question. what's the longest townname allowed in NML/OpenTTD?
We've got one in South Africa that I added that might be way too long, as it seems not to show. It's Tweebuffelsmeteenskootmorsdoodgeskietfontein it's a very small town.
We've got one in South Africa that I added that might be way too long, as it seems not to show. It's Tweebuffelsmeteenskootmorsdoodgeskietfontein it's a very small town.
Re: NML - a Newgrf Meta Language
No idea, did you try renaming an existing town?
Being a retired OpenTTD developer does not mean I know what I am doing.
- te_lanus
- Transport Coordinator
- Posts: 326
- Joined: 19 Jul 2012 18:04
- Location: The Elizabeth Arkham Asylum for the Criminally Insane
Re: NML - a Newgrf Meta Language
Did it this morning and seems the max number of letters for a town name is 31.Alberth wrote:No idea, did you try renaming an existing town?
-
- Tycoon
- Posts: 2781
- Joined: 22 Feb 2011 18:34
Re: NML - a Newgrf Meta Language
At least the name is very descriptive.te_lanus wrote:Tweebuffelsmeteenskootmorsdoodgeskietfontein
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Re: Graphics Workflow
right well that got me through the nml install.
Now when I use nmlc it throws an error 'no module named nml'
Now when I use nmlc it throws an error 'no module named nml'
Code: Select all
Traceback (most recent call last):
File "/usr/local/bin/nmlc", line 9, in <module>
load_entry_point('nml==0.4.0.r5576M-84560317b163', 'console_scripts', 'nmlc')()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named 'nml'
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Graphics Workflow
Can you try whether the lastest development build works better for you? (and why is it announced as modified?) There are / were some issues with packaging.abregado wrote:right well that got me through the nml install.
Now when I use nmlc it throws an error 'no module named nml'
Code: Select all
Traceback (most recent call last): File "/usr/local/bin/nmlc", line 9, in <module> load_entry_point('nml==0.4.0.r5576M-84560317b163', 'console_scripts', 'nmlc')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2363, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2088, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) ImportError: No module named 'nml'
http://bundles.openttdcoop.org/nml/push/LATEST/
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: NML - a Newgrf Meta Language
I had similar issue described by abregado.
Creating nmlc symlink in /usr/local/bin (or whenever nmlc was installed) pointing to real folder where *nmlc executable file exist (and ohter nml files and dirs), solved problem, if I remember correctly.
Question from a different kettle of fish:
according to http://newgrf-specs.tt-wiki.net/wiki/NML:Houses, there is house cargo_production callback: "The return value specifies what cargo and what amount is produced."
Is it possible to use such callback to define other cargo than mail or passengers, to produce? For example food produced by outskirts houses?
Similar question: is it possible, for multi-tile house, using cargo_type_accept callback, to accept more than 3 types of cargo per whole house?
Creating nmlc symlink in /usr/local/bin (or whenever nmlc was installed) pointing to real folder where *nmlc executable file exist (and ohter nml files and dirs), solved problem, if I remember correctly.
Question from a different kettle of fish:
according to http://newgrf-specs.tt-wiki.net/wiki/NML:Houses, there is house cargo_production callback: "The return value specifies what cargo and what amount is produced."
Is it possible to use such callback to define other cargo than mail or passengers, to produce? For example food produced by outskirts houses?
Similar question: is it possible, for multi-tile house, using cargo_type_accept callback, to accept more than 3 types of cargo per whole house?
Re: NML - a Newgrf Meta Language
Yes to both. However, because the callback decision is only available for existing houses it has several drawbacks to the user interface. For example the cargo chain overview will never show houses as accepting or producing something else.McZapkie wrote:Question from a different kettle of fish:
according to http://newgrf-specs.tt-wiki.net/wiki/NML:Houses, there is house cargo_production callback: "The return value specifies what cargo and what amount is produced."
Is it possible to use such callback to define other cargo than mail or passengers, to produce? For example food produced by outskirts houses?
Similar question: is it possible, for multi-tile house, using cargo_type_accept callback, to accept more than 3 types of cargo per whole house?
It is probably fine, as long as you do not add new cargos which are only accepted by houses, with no industry accepting them.
Adding a new cargo, which is only accepted by houses, and not by industries, will however break most GameScripts, AIs, and players
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: NML - a Newgrf Meta Language
Righto, I got a step further. Now I get an arrow regarding my .nml file
I checked out some other nmls and they also had sprites over 255 pixels.
Code: Select all
nmlc: "input", line 11: Real sprite paramater 'ysize' out of range 1..255, encountered 256
Code: Select all
// Replace Grass Tiles
replace grass_tiles(3981, "src/topo/gfx/terrainmasksheet.png") {
[0,0, 256,256, -124, -66]
[ 256,0, 256,256, -124,-66]
[ 256*2,0, 256,256, -124,-66]
[ 256*3,0, 256,256, -124,-66]
[ 256*4,0, 256,256, -124,-66]
[ 256*5,0, 256,256, -124,-66]
[ 256*6,0, 256,256, -124,-66]
[ 256*7,0, 256,256, -124,-66]
[ 256*8,0, 256,256, -124,-66]
[ 256*9,0, 256,256, -124,-66]
[ 256*10,0, 256,256, -124,-66]
[ 256*11,0, 256,256, -124,-66]
[ 256*12,0, 256,256, -124,-66]
[ 256*13,0, 256,256, -124,-66]
[ 256*14,0, 256,256, -124,-66]
[ 256*15,0, 256,256, -124,-66]
[ 256*16,0, 256,256, -124,-66]
[ 256*17,0, 256,256, -124,-66]
}
Re: NML - a Newgrf Meta Language
NFO version 7 can only encode y-sizes up to 255, vs 65535 for NFO version 32. Presumably there is some similar mechanism at play here...
Re: NML - a Newgrf Meta Language
I changed them all to 255 and then it started complaining that ZOOM_LEVEL_IN_4X is not a valid identifier for alpternative_sprites. I guess I have an older version or something
Who is online
Users browsing this forum: No registered users and 10 guests