Edit an exisiting OpenTTD GRF for windows or ... ?

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

maaboo
Engineer
Engineer
Posts: 14
Joined: 28 Jun 2007 14:22
Location: Russia, Moscow
Contact:

Edit an exisiting OpenTTD GRF for windows or ... ?

Post by maaboo »

Hi!

If i want to change the parameters of trains in a existing trainset - what and where need i do? For ex.: US Train set. :-)

Is there any grf editor (not decoder!)? Or where these parameters stored and how i can change them?

Thanks.
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

You'll need grfcodec (search the TTDPatch wiki) and a text editor (notepad will do), you also need to read the grfspecification of the TTDPatch wiki to know what you'll have to edit.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
maaboo
Engineer
Engineer
Posts: 14
Joined: 28 Jun 2007 14:22
Location: Russia, Moscow
Contact:

Post by maaboo »

XeryusTC wrote:You'll need grfcodec (search the TTDPatch wiki) and a text editor (notepad will do), you also need to read the grfspecification of the TTDPatch wiki to know what you'll have to edit.
As i understand there is no frontend or GUI to make it all-in-one?

Thanks i'm going to see TTDPatch Wiki for it...
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

maaboo wrote:
XeryusTC wrote:You'll need grfcodec (search the TTDPatch wiki) and a text editor (notepad will do), you also need to read the grfspecification of the TTDPatch wiki to know what you'll have to edit.
As i understand there is no frontend or GUI to make it all-in-one?

Thanks i'm going to see TTDPatch Wiki for it...
there are some small tools that can help you with sprite positioning, but for all the really nitty-gritty stuff you'll have to do it by hand.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

There is no program that can convert NFO into something higher-level. To my knowledge, there is one program that can compile to NFO, but this is not a reversible procedure. Unfortunately, it is also woefully out of date, and there is no indication that it will be updated any time soon.
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
maaboo
Engineer
Engineer
Posts: 14
Joined: 28 Jun 2007 14:22
Location: Russia, Moscow
Contact:

Post by maaboo »

Okay, thanks.. I decoded for ex. US Train Set, but i can't find where train parameters such as cost, speed, starting year are stored. There are a lot of hexadecimal digits... I tried km/h and mph, pounds and dollars, and nothing... I can't find patterns for it.
User avatar
CMircea
Chairman
Chairman
Posts: 887
Joined: 29 Dec 2006 14:05

Post by CMircea »

NFO is pure HEX.
maaboo
Engineer
Engineer
Posts: 14
Joined: 28 Jun 2007 14:22
Location: Russia, Moscow
Contact:

Post by maaboo »

I see the string:

6335 * 26 04 00 1F 01 00 "K4 'Pacific' (Steam)" 00

But don't see what does it mean?

It's not pure HEX until u decode it with -t option.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1794
Joined: 30 Mar 2005 09:43

Post by peter1138 »

See http://wiki.ttdpatch.net/tiki-index.php ... phicsSpecs for all the nitty gritty details on NFO.
He's like, some kind of OpenTTD developer.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

maaboo wrote:I see the string:

6335 * 26 04 00 1F 01 00 "K4 'Pacific' (Steam)" 00

But don't see what does it mean?

It's not pure HEX until u decode it with -t option.
Hmmm .. I wonder whether is there some tool that will decode (well, decode is to really necessary, but more important will be encoding) using some more human-readable file?

Like the line would be at least something like this:

6335 * define_vehicle train all_langages 1 0 "K4 'Pacific' (Steam)"

This would make such files much better editable.
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)
User avatar
lobster
Tycoon
Tycoon
Posts: 5671
Joined: 21 Dec 2003 23:30
Location: Atlantic Ocean
Contact:

Post by lobster »

why d'you want to decode and change those parameters anyway?
"Your mother was a lobster, and your father... was also a lobster" -- The rascal formerly known as astath -- Last.fm -- Official TT-Dave Worley Fan Club

Image

<orudge> make love to me while I surf, dear lobster
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

lobster wrote:why d'you want to decode and change those parameters anyway?
Well, I planned for making a new tram set and I wonder whether there is some easier way than encoding all that hex values by hand ... I'm not interested in modifying existing new GRFs, I want to create new ones at least a bit easier :)
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)
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Bilbo wrote:Well, I planned for making a new tram set and I wonder whether there is some easier way than encoding all that hex values by hand ...
There isn't really, but once you've done one vehicle it gets a lot easier. ;)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

PikkaBird wrote:
Bilbo wrote:Well, I planned for making a new tram set and I wonder whether there is some easier way than encoding all that hex values by hand ...
There isn't really, but once you've done one vehicle it gets a lot easier. ;)
Well, I found the tramset with most of the vehicles I seeked to create already created by someone else (not perfect, but I probably wouldn't create better), but I tried another thing - to create large capacity ships (like 15000 tons of cargo). There is one problem, cost is specified as "cost factor", which is byte - http://wiki.ttdpatch.net/tiki-index.php ... _for_ships

So you can stuff in 0-255, but at 255 the ship is still too cheap (it costs 99K pounds, but with such capacity it can easily make 3M pounds per 200 tiles trip if fully loaded). Is there any way to make the ship more expensive? It should cost about 2-4M pounds ... but values between 5000 and 10000 are too large for byte. Anybody know of some trick to increase the cost?
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)
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Bilbo wrote:Anybody know of some trick to increase the cost?
Yes; Change the base cost multiplier.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

PikkaBird wrote:
Bilbo wrote:Anybody know of some trick to increase the cost?
Yes; Change the base cost multiplier.
I prepended this line before the ship redefinitions:

2 * 7 00 08 01 01 08 13 0F

(2 *7 Action0, Global Variable, 1 property, 1 info, 8 for cost base multipliers, 13 for ship purchase, 0F should make them 128 times more expensive )

and it seems to have no effect. Any clue what I am doing wrong?
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)
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Bilbo wrote:Any clue what I am doing wrong?
You have the 13 (ID) and the 08 (property) the wrong way round.

It's "2 * 7 Action0, Global Variable, 1 property, for 1 ID, for 13 ship purchase, set prop 08 cost base multipliers to 0F"
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

PikkaBird wrote:
Bilbo wrote:Any clue what I am doing wrong?
You have the 13 (ID) and the 08 (property) the wrong way round.

It's "2 * 7 Action0, Global Variable, 1 property, for 1 ID, for 13 ship purchase, set prop 08 cost base multipliers to 0F"
Ah, thanks, now it works :)

Well, now the creation is finished, I think I'll post it in some new thread :)
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:

Post by DaleStan »

PikkaBird wrote:
Bilbo wrote:Any clue what I am doing wrong?
You have the 13 (ID) and the 08 (property) the wrong way round.
And, as usual, NFORenum would have objected:

Code: Select all

//!!Fatal Error (47): Offset 5: Invalid property 13.
TTDPatch would have objected too:

Code: Select all

File <file> has invalid sprite #2 (code 6/6)
For reasons that are beyond me, the Open devs seem to think that people who use OpenTTD are much too smart to need to be told where, or even if, their grf is invalid. (Yes, even users need to know whether or not the file loaded successfully, folks.)
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
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

DaleStan wrote:
PikkaBird wrote:
Bilbo wrote:Any clue what I am doing wrong?
You have the 13 (ID) and the 08 (property) the wrong way round.
And, as usual, NFORenum would have objected:

Code: Select all

//!!Fatal Error (47): Offset 5: Invalid property 13.
TTDPatch would have objected too:

Code: Select all

File <file> has invalid sprite #2 (code 6/6)
For reasons that are beyond me, the Open devs seem to think that people who use OpenTTD are much too smart to need to be told where, or even if, their grf is invalid. (Yes, even users need to know whether or not the file loaded successfully, folks.)
Well, if you use -d 2 option on command line and you'll dig through about 10000 lines of debug output, you'll see this:

"FeatureChangeInfo: Ignoring property 0x08 (not implemented)"

[irony] Isn't that helpful? With little effort, you know exactly in which sprite the bug is and at what position. :) [/irony]

Ok, the error handling for NewGRF's should be a bit better ...
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)
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 29 guests