Page 63 of 64

Re: NML - a Newgrf Meta Language

Posted: 05 Dec 2018 14:27
by PNDA_
Eddi wrote:
  • property 08 is a 4 byte-ID (like GRF-ID, Cargo-Label, etc.), not a String
Ah, that makes sence, so it would work like Railtypelabels, just for stationtypelabels, I guess. For example, I think, that something like "STSP" (=Station Single Platforms) would work, right?
Eddi wrote:
  • where did you get 0xC5 from for "name"? couldn't find that anywhere
  • the action0 complains about C5 being unknown (see previous question)
I got 0xC5 from the nfo output of m4nfo. I saw the C5 in front of the Name in the shown code, so I thought that might be it. So what should be used instead of C5, I could not find reference on the wiki for the definition of the name of a station tile?

Code: Select all

10 * 21	 04 04 FF 01 01 C5 "Empty Platform" 00
Eddi wrote:
  • the action2 is completely ill-formed. as far as i understand stations, tile layout should be a property (action0), not "graphics" (action2). no clue what you were trying to achieve there
I took a look at the Airports and Airport tiles, and they worked like the code I showed, that it referred to graphics. Though you might be right, because 0x0E for Stations is a custom layout definition, so that might define the layout and the default is just a single tile.
Eddi wrote:
  • the two action4 complain that you're using language ID 7F (indicating byte-IDs) instead of FF (indicating word-IDs). what that means i have no clue.
Maybe that has to do with the size of the ID? As of output_base.py the size seems to switch between "bytex", "wordx" and "dwordx" according to the size of the value. Could also be because I used C5 for the Name, that those correspond.
planetmaker wrote:Do you happen to have a WIP git repo for your station code?
Well, kinda. Im currently just testing files and sometimes when I get something to work, I push it to this git repo.

Re: NML - a Newgrf Meta Language

Posted: 05 Dec 2018 17:04
by Eddi
PNDA_ wrote:
Eddi wrote:
  • where did you get 0xC5 from for "name"? couldn't find that anywhere
  • the action0 complains about C5 being unknown (see previous question)
I got 0xC5 from the nfo output of m4nfo. I saw the C5 in front of the Name in the shown code, so I thought that might be it. So what should be used instead of C5, I could not find reference on the wiki for the definition of the name of a station tile?

Code: Select all

10 * 21	 04 04 FF 01 01 C5 "Empty Platform" 00
yeah, but that is in an action 4, not an action 0. let's dissect that:

Code: Select all

10 * 21 // sprite number and length
04 //action 4 (string)
04 //feature 4 (station)
FF //language ID (like i mentioned above, FF for Word-sized IDs instead of 7F)
01 //one string
01 //lower byte of the ID, which station
C5 //upper byte of the ID, indicating "station name"
"Empty Platform" //actual string
00 //terminating 0
nmlc likely will have a flag somewhere to define that action4 should be output with word-sized IDs instead of byte-sized, look at e.g. how houses do it differently to vehicles.

Re: NML - a Newgrf Meta Language

Posted: 09 Dec 2018 07:51
by stefino_cz
Hi all, is possible to code in NML houses what will be dependent on road possition? We need to rotate houses into right possition to do best vizual effect :) We found this function in NFO. Is there any way how to code it in NML? Thanks :)
nfo.png
(43.27 KiB) Not downloaded yet

Re: NML - a Newgrf Meta Language

Posted: 10 Dec 2018 02:05
by planetmaker
Yes. Check the "nearby" variables, nearby_tile_class in particular and simply check for the presence of road. I believe FIRS uses similar for more than 5 years for the petrol pump.

Re: NML - a Newgrf Meta Language

Posted: 05 Mar 2019 11:45
by Vanderbildt
Hello
NML 4 need a update.
can someone help please.

Thank you

Vanderbildt

Re: NML - a Newgrf Meta Language

Posted: 05 Mar 2019 21:32
by GarryG
I get my updates to NML from here https://bundles.openttdcoop.org/nml/?C=M&O=D

Re: NML - a Newgrf Meta Language

Posted: 06 Mar 2019 09:35
by Vanderbildt
Thank you.
SORRY my request was not precise.
NML needs a update for:https://github.com/OpenTTD/OpenTTD/pull/6867

Vanderbildt

Re: NML - a Newgrf Meta Language

Posted: 06 Mar 2019 09:41
by GarryG
information I received before say it could be several months before that update is available .. I to is waiting for that update :D

Re: NML - a Newgrf Meta Language

Posted: 06 Mar 2019 11:38
by andythenorth
For 16-cargo-in-16-cargo-out, there's a set of updates from nielsm here https://github.com/PeterN/nml/commits/16-in-out

I'm testing them with FIRS, they work so far, but they may be incomplete.

If you know how to build NML yourself from the sources, you can try them, helping test will be very valuable.

https://github.com/OpenTTD/nml/
https://github.com/OpenTTD/nml/pull/15

Meanwhile...

NML has no regular maintainer or active contributors currently.

It has been kept on life support by frosch, planetmaker and me. But none of us are able to develop it or release it regularly.

To be quite precise then, it if newgrf authors wish to continue using NML, new contributors will need to emerge :)

Otherwise I think NML will die.

I am already evaluating the alternatives (nfo, m4nfo).

Re: NML - a Newgrf Meta Language

Posted: 06 Mar 2019 12:10
by GarryG
andythenorth wrote:For 16-cargo-in-16-cargo-out,
Wish I could help but my knowledge of coding is limited.

Even visiting those sites you provided links to I get lost looking at what you have there.

If can PM what I need, happy to test with my Industry or with you fires and see what I can find any problems.

Cheers

Garry

Re: NML - a Newgrf Meta Language

Posted: 06 Mar 2019 20:44
by jfs
I'm trying to splice together support for the 16-in-16-out feature, it works on the basic level, but yes it still needs a lot of care to be good.

Some tasks that aren't (as) dependent on grokking Python, parsers, and their combination:
- Writing better examples and test cases (NML code)
- Writing documentation and a migration guide for going from the old syntax and variables to the new

Re: NML - a Newgrf Meta Language

Posted: 08 Mar 2019 17:07
by McZapkie
I los my laptop together with all openttd dev environmen and, what is worse, together with command history.
Now I don't remeber, how to set-up properly nmlc on my new computer.
I have nmlc installed, nmlc dir added to the path, ply dir from ply-3.11 copied to nml-master dir,
now I'm trying to perform command
import ply.lex as lex
then computer is stalled for while, later I got message:
import: not authorized `lex' @ error/constitute.c/WriteImage/1028.
(even with sudo).
Any clue what goes wrong?

Re: NML - a Newgrf Meta Language

Posted: 08 Mar 2019 17:18
by Eddi
i would guess it's trying to write a temp file somewhere it shouldn't.

have you tried using pip to install ply, instead of manually copying?

Re: NML - a Newgrf Meta Language

Posted: 08 Mar 2019 23:38
by McZapkie
Eddi wrote: have you tried using pip to install ply, instead of manually copying?
Thanks, sudo apt-get install python-ply works well and is much more simply than generic method desrcibed on ply page.

Re: NML - a Newgrf Meta Language

Posted: 12 Mar 2019 10:25
by 3iff
andythenorth wrote:For 16-cargo-in-16-cargo-out, there's a set of updates from nielsm here https://github.com/PeterN/nml/commits/16-in-out

I'm testing them with FIRS, they work so far, but they may be incomplete.

If you know how to build NML yourself from the sources, you can try them, helping test will be very valuable.

https://github.com/OpenTTD/nml/
https://github.com/OpenTTD/nml/pull/15

Meanwhile...

NML has no regular maintainer or active contributors currently.

It has been kept on life support by frosch, planetmaker and me. But none of us are able to develop it or release it regularly.

To be quite precise then, it if newgrf authors wish to continue using NML, new contributors will need to emerge :)

Otherwise I think NML will die.

I am already evaluating the alternatives (nfo, m4nfo).
I'd love to help...BUT... I don't have regular internet access, I'm unable to compile anything at the moment, and barely know how to do it anyway.

I am very good at testing existing/new code and wrangling out bugs, so I'm very happy to assist with those tasks.

If there's anyone who has compiled this forked-nml and can send me a copy, then I'd love to give it a go. (via PM is fine)

Re: NML - a Newgrf Meta Language

Posted: 14 Mar 2019 15:05
by Eddi
you don't have to compile nmlc, it's a python program that you can just run with an installed version of python

the .exe is just provided for convenience, and is basically just python and nmlc wrapped up in one bundle

Re: NML - a Newgrf Meta Language

Posted: 19 Mar 2019 10:17
by 3iff
Ah, didn't know that. I'll give it a go. I can do some python programming, My skill level is about 5 out of 100 (so not exactly brilliant!)

Re: NML - a Newgrf Meta Language

Posted: 21 Mar 2019 08:01
by stefino_cz
Hi. I have a question about houses graphics. Is possible to have a house graphics dependent at population of the city? I know that way how to classify houses or city object generaly is due to city zones. But there is still a lot of objects what could be dependent at population. For example housing estates in the cities are in outskirts. Village has outskirt too but there are no housing estates. In case of population depndency I can for example say that this and this bulding will show in outskirt but the first building will be build in the cities under 1500 population and second in the cities above 1501. This will make cities more different - we will get smaller cities with "older" village's elements and bigger cities with modern elements.

Stefino_cz

Re: NML - a Newgrf Meta Language

Posted: 21 Mar 2019 08:10
by PikkaBird
stefino_cz wrote:Hi. I have a question about houses graphics. Is possible to have a house graphics dependent at population of the city?
Short answer: Yes. Long answer: Yeeees. Check the town variables.

You're probably better off having two different buildings (unless you want "old village" to become "modern city" instantly when the population hits 1501), and either gradually supplanting one with the other once a city reaches the size limit, having some buildings reserved for OpenTTD "Cities", or finding some other mechanism to decide when each is built.

Re: NML - a Newgrf Meta Language

Posted: 21 Mar 2019 09:24
by planetmaker
PikkaBird wrote: You're probably better off having two different buildings (unless you want "old village" to become "modern city" instantly when the population hits 1501), and either gradually supplanting one with the other once a city reaches the size limit, having some buildings reserved for OpenTTD "Cities", or finding some other mechanism to decide when each is built.
Indeed. Don't make your lief needlessly complicated: use different houses / houseIDs for different looks.
Use placement rules for (dis)allowing construction instead of (ab)using animation for a single house.
As additional benefit you gain the advantage of the houses being constructed (constuction stages shown) when they change as a town grows beyond a size threshold instead of changing view in an instant.

https://newgrf-specs.tt-wiki.net/wiki/NML:Towns and https://newgrf-specs.tt-wiki.net/wiki/NML:Houses
Especially interesting might be the town variables is_city and population. And the house variables other_class_count_town (if you define house classes (property building_class) and use different for different towns). Use these variables in the houses construction_check callback.