GRF encoder tool: GRFMaker [under development]

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

Moderator: Graphics Moderators

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

GRFMaker wrote:"And mask: 255"
OW!!!

Surely there's a config option so hex numbers are acceptable there?
I'm pretty sure I've used an and-mask of 22h, or something similarly obscure, at least a couple times, and converting such things between hex and decimal on a regular basis is not my idea of a good time.

VarAction2Advanced support, and 60+x support, if existant, are non-obvious. I know I've used both of them:

Code: Select all

-1 * 34 02 09 ED 81 60 00 33 1F 00 60 00 60 FF 0F 10 01 60 01 33 1F 01 60 01 40 FF 0F 10 01 EC 00 00 00 00 FF
                    If you're trying to read this, I'll help you out a bit. nvar is here ^^.
(Not to be interpreted as feature requests; I don't intend to use GRFMaker even if such things do get implemented. At least not until it can read all NFO.)
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
gl2
Engineer
Engineer
Posts: 21
Joined: 21 Jun 2004 08:20
Location: Budapest, Hungary

Post by gl2 »

Hello!

In the next days I want to update the program.

Currently these changes are ready:
- Error corrected: "data" variable in Action D now WORD. (for Csaboka)
- In the Variational graphid block the AND mask can switch between HEX and DEC.** (for DaleStan)
- Effect block (Action 11)
- Missing callbacks
- Missing action 0 properties
- Enhanced variational graphid block (advanced variable action 2)

** In the feature if Anybody want, I will make other block's other fields to be switchable between hex and dec. :)

If need some other modification, or there is any missing thing, please tell Szappy or me.

Laci
goalie
Route Supervisor
Route Supervisor
Posts: 406
Joined: 28 Aug 2003 14:54
Location: Düsseldorf
Contact:

Post by goalie »

where can i download the tool
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

pm szappy or gl2 for a link to the download plus the code to download it!
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
User avatar
Szappy
Chief Executive
Chief Executive
Posts: 689
Joined: 29 Mar 2004 14:35
Location: Budapest, Hungary
Contact:

Post by Szappy »

GRFMaker updated to 3.0

There has been a major change in the sprite block storing format, and due to this, GRFM won't be able to read pre-2.17 version lst files.
You can correct this by simply saving the lst with any of the post 2.17 versions.


Due to the major internal change, it's imperative, that you save your previos work, in case anything goes wrong

changelog follows...

3.00 (2006 Jan 30)
============================
1. internal structure of the sprite blocks was modified, that's the cause of the major version change.
2. incorporated the changes of the unpublised 2.22

2.22 (2006 Jan 1)
===========================
1. added missing variables for road vehicles
2. added missing callbacks
3. added action11
4. dev: changed creation of variational blocks (CreateVariationalGraphidBlock)
5. dev: changed creation of randomized blocks (CreateRandomizedGraphidBlock)
6. actionD "data" field changed to word
7. AND mask in variational block can be set to HEX in settings
Image please use email instead of PM
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Szappy wrote:6. actionD "data" field changed to word
Um... Are your definitions of "word" and "doubleword" different from mine? I was under the impression that those were pretty universal.

In any case, the data field is four bytes wide. If that's just a typo, or is what you mean by "word", that's fine, but having only two bytes where TTDPatch wants four may cause problems, either now or sometime in the future.
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
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

Dale:
gl2 wrote:Error corrected: "data" variable in Action D now WORD. (for Csaboka)
Now why would Csaba want that?
DaleStan wrote:...having only two bytes where TTDPatch wants four may cause problems, either now or sometime in the future.
It's an outright error - you're no longer able to set the value of variable 9F, which is 4 bytes. I mean something like this:

Code: Select all

   -1 * -1	 0D 9F 00 FF FF 15 01 04 00
There are other DWORD variables there too, and having the upper word undefined is hardly desireable.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

minime wrote:
gl2 wrote:Error corrected: "data" variable in Action D now WORD. (for Csaboka)
Now why would Csaba want that?
I was coding some GRF with GRFMaker (I forgot what it was, probably just a quick test), and I wanted to do an action D that sets a variable to a value higher than 255. When pressing OK, GRFMaker died with some ugly Delphi exception. I've looked into the source code and found that the value is stored in a byte and Delphi dies when it wants to store a too big value in it.

Since I have gl2 in my YIM contact list, I could report the error directly without coming here. All in all, the bugfix isn't specially for me, I was just the one who reported it.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

Csaboka wrote:
minime wrote:
gl2 wrote:Error corrected: "data" variable in Action D now WORD. (for Csaboka)
Now why would Csaba want that?
I was coding some GRF with GRFMaker (I forgot what it was, probably just a quick test), and I wanted to do an action D that sets a variable to a value higher than 255. When pressing OK, GRFMaker died with some ugly Delphi exception. I've looked into the source code and found that the value is stored in a byte and Delphi dies when it wants to store a too big value in it.

Since I have gl2 in my YIM contact list, I could report the error directly without coming here. All in all, the bugfix isn't specially for me, I was just the one who reported it.
That's understandable, but it's not what I was asking (it makes no difference whether you reported the bug here or when you saw him in the pub). My (and Dale's as well) point is that it's still wrong - it should be a doubleword, not a byte neither a word.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

minime wrote:That's understandable, but it's not what I was asking (it makes no difference whether you reported the bug here or when you saw him in the pub). My (and Dale's as well) point is that it's still wrong - it should be a doubleword, not a byte neither a word.
Well, I haven't told him to make it be a word. I think I told him to make it a doubleword, but I might have forgotten about that part. Anyway, he said he'll fix it soon.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
Aegir
Tycoon
Tycoon
Posts: 2884
Joined: 09 Feb 2004 10:02
Contact:

Post by Aegir »

Recently, in either GRFMaker v3.00 or Wine 0.9.8, the mysterious .lst deletion on GRFMaker exit bug has dissapeared.

If this is a fix in GRFMaker v3.00, then THANKYOU THANKYOU THANKYOU! Now I don't have to use convoluted scripts to fix restore backups etc...

If not, remind me to offer the Wine devs a beer.
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.

14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
DeletedUser21
Tycoon
Tycoon
Posts: 11501
Joined: 20 Sep 2004 22:45

Post by DeletedUser21 »

maybe that I'm blind or anything, but where can I find grfmaker to install it on my pc?
Can someone tell me please? :)
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

PM Szappy for it!
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
DeletedUser21
Tycoon
Tycoon
Posts: 11501
Joined: 20 Sep 2004 22:45

Post by DeletedUser21 »

hmmm, okay, I will do that!
thanks!
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

No problems Mr. X, got it working?

Szappy, i think there is a bug ive found in the program that stops you having a HP larger than 10000...

James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

Sorry for the double post, but any idea if this is fixable Szappy? The Swiss Set has several engines over 10k HP and i cant program it! :P
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

http://wiki.ttdpatch.net/tiki-index.php ... ion0Trains

AIUI, GRFMaker provides a method of entering arbitrary NFO.
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
lws1984
President
President
Posts: 945
Joined: 03 May 2004 11:34
Location: Spaceship Heart of Gold
Contact:

Post by lws1984 »

Thanks, I love GRFMaker, but I encountered an error and I can't quite figure it out....

"Error loading new graphics:
File "newgrf\01800w.grf" has invalid sprite
#24 (code 10/ 8)"

There shoudn't be a space inbetween the slash and 8, that's just to prevent smilies.

Here's the GRF in question.
Attachments
01800w.GRF
(2.02 KiB) Downloaded 182 times
It's not me in my avatar, it's a time lord!

Time is an illusion. Lunchtime, doubly so.
-Douglas Adams
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

lws1984 wrote:Here's the GRF in question.
No it isn't. That file has invalid sprite #25 (code 10/8)

http://wiki.ttdpatch.net/tiki-index.php ... riteErrors

Code: Select all

Code	Meaning
10	  Action 2 (var./random) or action 3 refers to an action 2 cargo-id that hasn't been defined yet
So either (1) you coded an action 2 or 3 that refers to an ID you did not previously define, or (2) GRFMaker is broken, and debugging this will require the .lst, and maybe the png/pcx/whatever too.

(And you can prevent smilies without adding extra characters to your post; there's a useful little "Disable Smilies in this post" checkbox.)

@Szappy/gl2: Putting one-byte pseudos in an action 1 block is considered bad style, and doesn't actually save any real-sprite space over having real-sprites. Please don't do that; if you only need 1 sprite, only output one sprite.
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
lws1984
President
President
Posts: 945
Joined: 03 May 2004 11:34
Location: Spaceship Heart of Gold
Contact:

Post by lws1984 »

Hmm, thanks DaleStan.

Here's the .lst file and .pcs, zipped because the forums won't all .lst or .pcx extensions.
Attachments
RedLineStuff.zip.zip
(2.65 KiB) Downloaded 184 times
It's not me in my avatar, it's a time lord!

Time is an illusion. Lunchtime, doubly so.
-Douglas Adams
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 6 guests