new grf coding/adjusting?

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
SniperDJ
Traffic Manager
Traffic Manager
Posts: 223
Joined: 08 Oct 2011 09:21
Location: The Netherlands

new grf coding/adjusting?

Post by SniperDJ »

hello everybody,

are there any clear guide or tutorials on adjusting newgrfs (road vehicle ones)?

because I would really like to adjust some road sets (with permission of course) to fix compatibility with new industries.
ImageImageTake a look at my Australia Scenario (work in progress)Image Proud citizen of The Netherlands
recently aquired the FCE
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: new grf coding/adjusting?

Post by Supercheese »

AFAIK, there are no guides for editing existing GRFs via decompiling and recompiling, as that results in uncommented NFO, which is a real pain in the ass to read. However, if you're lucky enough to have the source available, then you should just be able to follow existing tutorials, but simply starting with what already exists and moving from there.
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: new grf coding/adjusting?

Post by Alberth »

I'd first try to write a new newgrf that performs the fix. At least for the default vehicles that can be done, and perhaps for the non-standard ones it can be done as well.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: new grf coding/adjusting?

Post by frosch »

Maybe instead of editing the GRF it is easier to write an add-on GRF.

1) Get grf2html and use it to figure out the vehicle IDs the target GRF uses: http://www.tt-forums.net/viewtopic.php?f=68&t=34279
2) Write your own GRF, e,g. with NML: http://www.tt-wiki.net/wiki/NMLTutorial
2.1) Define you GRF as add-on to the target GRF: http://newgrf-specs.tt-wiki.net/wiki/NM ... er_NewGRFs
2.2) Assign new values to the refitting properties: http://newgrf-specs.tt-wiki.net/wiki/NML:Vehicles
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: new grf coding/adjusting?

Post by FooBar »

For example code for such an add-on, you can take a look at the Dutch Trainset Cargo Extension: http://www.tt-forums.net/viewtopic.php?t=55872
Source code is provided in the download of the first post.
With only minor adjustments you can modify that to work with a different vehicle set, it's pretty straightforward. And in this case you don't need permission of the original set's author, as you're not modifying that. My code is GPL'ed, so as long as you respect that license you can do whatever you want with it.

If you want to fix an existing set with permission, you might as well ask for the source code when asking for permission.
SniperDJ
Traffic Manager
Traffic Manager
Posts: 223
Joined: 08 Oct 2011 09:21
Location: The Netherlands

Re: new grf coding/adjusting?

Post by SniperDJ »

thank you for all your quick replies

i'll check them all out and see what i can do with them

thanks in advance
ImageImageTake a look at my Australia Scenario (work in progress)Image Proud citizen of The Netherlands
recently aquired the FCE
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 71 guests