Editing a GRF

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

Moderator: Graphics Moderators

Post Reply
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Editing a GRF

Post 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?
Image
User avatar
UltraNub
Engineer
Engineer
Posts: 119
Joined: 13 Dec 2007 21:22

Re: Editing a GRF

Post 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_
ERROR: Signature Not Found, Search Behind Couch? Y/N
User avatar
DeletedUser5
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 07 Oct 2007 15:10

Re: Editing a GRF

Post 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.
User avatar
UltraNub
Engineer
Engineer
Posts: 119
Joined: 13 Dec 2007 21:22

Re: Editing a GRF

Post 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)
ERROR: Signature Not Found, Search Behind Couch? Y/N
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: Editing a GRF

Post by Slye_Fox »

errrrrrrrrrr.......... you've both lost me.
Image
User avatar
DeletedUser5
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 07 Oct 2007 15:10

Re: Editing a GRF

Post 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.
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: Editing a GRF

Post by Slye_Fox »

I allready got my file decoded, but i can't find what/how to edit the coding to set the years
Image
User avatar
DeletedUser5
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 07 Oct 2007 15:10

Re: Editing a GRF

Post by DeletedUser5 »

I don't know that too. Read ttdpatch wiki and/or ask Dalestan
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: Editing a GRF

Post 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
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Editing a GRF

Post by DaleStan »

I dunno either. You have to find it. The wiki tells you everything you need to know.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: Editing a GRF

Post 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
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Editing a GRF

Post 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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: Editing a GRF

Post 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.
Image
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Editing a GRF

Post 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
Image
Gonozal_VIII
Traffic Manager
Traffic Manager
Posts: 165
Joined: 03 Dec 2007 15:06

Re: Editing a GRF

Post 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
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Editing a GRF

Post 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
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Editing a GRF

Post 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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 29 guests