NML Py-Patcher - a pre-compiler written in Python 3

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
User avatar
FulliAutomatix
Engineer
Engineer
Posts: 104
Joined: 24 Aug 2014 12:20
Location: Kaon Prison, Cybertron

NML Py-Patcher - a pre-compiler written in Python 3

Post by FulliAutomatix » 11 May 2018 18:10

So I was having issues with other methods to "patch" (as I call it) pnml files into the one nml file that NMLC can read.
So I decided to write my own "patcher" myself in Python (sounding like a good idea as NMLC already needs python), and since I think I've made it robust enough I believe I should share it with the community!
Download link!
I'm distributing it under Creative Commons Attribution-NonCommercial-ShareAlike 4.0

So far it can read references from pnml files (#include "example.pnml") to patch together and use custom variable definitions for reference in the code (#define CUSTOM_DEFINITION 288).
The rest will just be written directly to the nml file to be compiled.

The definition does NOT currently work with function-like definitions.

Please give any feedback, it is much appreciated :P

I hope you enjoy!

Edit 26 05 18: Use the download link above, includes full example and license
Last edited by FulliAutomatix on 26 May 2018 22:43, edited 3 times in total.


Tony Pixel
Route Supervisor
Route Supervisor
Posts: 411
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: NML Py-Patcher - a pre-compiler written in Python 3

Post by Tony Pixel » 22 May 2018 17:59

You're god man :bow: :bow: :bow:
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.

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest