OpenTTD / nml

NewGRF Meta Language
GNU General Public License v2.0
44 stars 36 forks source link

Incorrect error when not providing a `name` property for waypoints. #311

Closed zephyris closed 11 months ago

zephyris commented 1 year ago

I don't think waypoints, coded as a special class of station, can have a name.

If you code a station using the "WAYP" class for ITEM_STATIONS and provide a name property, then OpenTTD reports a NewGRF error: Unknown action0 property.

If you do not provide a name property, then nmlc reports the error nmlc ERROR: "ogfx2_stations.nml", line XXX: Property 'name' is not set. Item will be invalid., but makes a functional NewGRF that OpenTTD seems happy with.

Presumably just needs a special case for reporting the error? Or is this an OpenTTD bug?

Brickblock1 commented 1 year ago

I believe Openttd supports waypoint names so it is probably a nml bug

PeterN commented 1 year ago

Waypoints can have names. Possibly your version of nmlc produces a NewGRF that is incompatble with 13.x?

zephyris commented 1 year ago

@PeterN Yes, you're right, OpenTTD error does not happen for the latest nightly. I guess this can be closed...

But why? Seems like a basic thing, nmlc vs. OpenTTD version sensitivity seems weird to me...

glx22 commented 1 year ago

OpenTTD did https://github.com/OpenTTD/OpenTTD/commit/bc7dfd7b46c0184dc4b2cc376556702ac0ac1019 in nightlies, which has been then added to nml in 0.7.4 (but there's a bug with a fix waiting for approval in #305)

PeterN commented 1 year ago

TBH I assumed nmlc would try to keep compatibility with older versions were possible, e.g. by only using the new method if the local id was >= 255.

zephyris commented 1 year ago

I've tested for sanity's sake, and it is indeed action0 and 0x1C 0x1D/name and class_name responsible for the OpenTTD error. I second @PeterN, for NewGRFs with few station names, retaining backwards compatibility is preferable...

glx22 commented 1 year ago

I can rewrite #305