Page 1 of 1
Editing a GRF
Posted: 25 Jan 2008 17:26
by Slye_Fox
Is there an Easy way to edit the UK Renewal set to change the introduction, and removal years of the train so they're at their propper real life years?
What tools will i need to do it?
Re: Editing a GRF
Posted: 25 Jan 2008 17:37
by UltraNub
Look, There is no easy way to do that (unless this was TTD) without using the good old notepad.
http://wiki.ttdpatch.net/tiki-index.php ... llbacks_1E_
Re: Editing a GRF
Posted: 25 Jan 2008 17:57
by DeletedUser5
caibrenden wrote:good old notepad
There's no need to use notepad. Any other program that handles .nfo files can be used too. For decoding you need
grfcodec.
Re: Editing a GRF
Posted: 25 Jan 2008 18:05
by UltraNub
Soeb wrote:caibrenden wrote:good old notepad
There's no need to use notepad. Any other program that handles .nfo files can be used too. For decoding you need
grfcodec.
Although that is an alternative to the original ways. Yeah, that would work.
(That does not include 'System Information' which also stores info in NFO format)
Re: Editing a GRF
Posted: 25 Jan 2008 18:18
by Slye_Fox
errrrrrrrrrr.......... you've both lost me.
Re: Editing a GRF
Posted: 25 Jan 2008 18:35
by DeletedUser5
Step by step tutorial:
1. Download grfcodec. I posted link in topic already.
2. Just enter grfcodec/./grfcodec ( first one if you use windows / second one if you use linux ) to see all available commends.
3. Enter "grfcodec-d *****.grf -p 2" to decode grf you want. As stars write grf name.
4. Now look on ttdpatch wiki. Links also were here.
5. Read it, do what do you want to do with grf.
6. Now encode grf. Enter that commend: "grfcodec -e *****.nfo". As stars enter nfo file name.
7. All commends enter in console
I hope it's understandable. But better tutorial on making grfs you'll find on ttdpatch wiki.
Re: Editing a GRF
Posted: 25 Jan 2008 18:51
by Slye_Fox
I allready got my file decoded, but i can't find what/how to edit the coding to set the years
Re: Editing a GRF
Posted: 25 Jan 2008 19:01
by DeletedUser5
I don't know that too. Read ttdpatch wiki and/or ask Dalestan
Re: Editing a GRF
Posted: 25 Jan 2008 19:26
by Slye_Fox
I found the thing i need to edit is on here:
http://wiki.ttdpatch.net/tiki-index.php ... on0General
But i've no idea where they are in the .nfo file
Re: Editing a GRF
Posted: 25 Jan 2008 19:30
by DaleStan
I dunno either. You have to find it. The wiki tells you everything you need to know.
Re: Editing a GRF
Posted: 25 Jan 2008 19:32
by Slye_Fox
All i see is a jumble of numbers and hexi code
Code: Select all
229 * 7 00 00 01 01 2F 27 07
230 * 7 00 00 01 01 39 27 07
231 * 7 00 00 01 01 3E 27 07
232 * 7 00 00 01 01 41 27 07
233 * 9 00 00 02 01 1B 27 03 1E 0B
234 * 9 00 00 02 01 1C 27 03 1E 0B
235 * 9 00 00 02 01 25 27 03 1E 0B
236 * 13 00 00 03 01 25 00 00 00 09 FF FF 06 03
237 * 13 00 00 03 01 1B 00 00 00 09 FF FF 06 03
238 * 13 00 00 03 01 1C 00 00 00 09 FF FF 06 03
239 * 15 00 00 05 01 1B 12 FD 17 56 1C 0F 16 23 14 28
240 * 15 00 00 05 01 1C 12 FD 17 48 1C 08 16 20 14 23
241 * 15 00 00 05 01 25 12 FD 17 48 1C 08 16 20 14 1E
Re: Editing a GRF
Posted: 25 Jan 2008 19:40
by DaleStan
Obviously you did not read (enough of) the wiki, as if you had, it would have become abundantly clear that that is exactly what you are supposed to see.
Find the vehicle's ID (either by name or graphics) then find its action 0s, then edit them.
Re: Editing a GRF
Posted: 25 Jan 2008 19:43
by Slye_Fox
I can't be bothered anymore, it is just too much of a hasstle.
And i know that's what i suposed to see.
What i'm saying, is that it makes zero sence to me.
Re: Editing a GRF
Posted: 25 Jan 2008 21:05
by michael blunck
Slow_Fox wrote:it makes zero sence to me.
Obviously. But reading the Wiki, as Dale pointed out, would turn zero to a much higher number, believe me.
OTOH, it´d indeed less "hassle" to do nothing.
regards
Michael
Re: Editing a GRF
Posted: 25 Jan 2008 22:51
by Gonozal_VIII
use grf2html, that generates a html file out of the grf, in that html you can search for the line that contains the things you want to change
Re: Editing a GRF
Posted: 25 Jan 2008 23:05
by Bilbo
Slye_Fox wrote:What tools will i need to do it?
You can directly use a hex editor. Using grfcodec is usually slightly easier, though the difference is pretty small :)
Gonozal_VIII wrote:use grf2html, that generates a html file out of the grf, in that html you can search for the line that contains the things you want to change
There are also some atempts to convert NFO to something more human readable, like:
NFO2 language:
http://www.tt-forums.net/viewtopic.php?f=26&t=35541
GRL language:
http://www.tt-forums.net/viewtopic.php?f=26&t=35535
Newgrf Description Language (NDL):
http://www.tt-forums.net/viewtopic.php?f=26&t=35497
Though none of the ttempts lived long enough to produce some usable (de)compiler for NFO
Re: Editing a GRF
Posted: 26 Jan 2008 00:09
by DaleStan
Bilbo wrote:Slye_Fox wrote:What tools will i need to do it?
You can directly use a hex editor. Using grfcodec is usually slightly easier, though the difference is pretty small

No, the difference is quite large. There's no reliable way to detect an end-of-sprite in the GRF, except by reading all previous sprites. For early sprites, this is OK (The most recent ttdpbase[w].grf, for example, was generated by hex-editing the previous one) but for later sprites it's rather a lot of bother, and quite prone to failure, especially in the real sprites.