Page 6 of 31

Posted: 11 Oct 2005 17:26
by RK
use a pcx file, created by the GRFCodec and then select the sprite with the right mouse button.

Posted: 11 Oct 2005 17:39
by jvassie
Thanks!

By pcx file created by grfcodec... i assume you mean a decoded pcx file and then edit it?


Cheers
James

Posted: 11 Oct 2005 17:45
by DaleStan
That, or apply the palette from a decoded PCX to a new PCX.

Posted: 12 Oct 2005 06:42
by MrMuscle
Hello. I am sorry for my question but can I somewhere download the GrfMaker tool to test if ? Thanks

Posted: 12 Oct 2005 08:06
by Szappy
jamesvassie wrote:Im not sure if this is a bug, probably isnt though, maybe a need for help! When i try to add a vehicle sprite block, i choose my options, click ok, and i get errors saying firstly that the BMP file contains more than 500 sprites, then an error saying no sprite selected in the sprite block.
The 'more than 500 sprites' error is probably caused by the blue numbers that grfcodec pastes on the images. The program falsely recognizes them as sprites.
Use method1 for sprite search, it's designed to filter out those blue numbers.
Unless you're using an image file, with more than 500 spirites, but that's unlikely. ;)

Here's a quick guide, to get started with sprite blocks:

first you have to create the folder under \projects for your new project, and move all the graphic files there (the program can support bmp or pcx currently). Then save the project there (the project name will also be the grf's name, on encoding), so the program acknowledges the project directory. Then on creating the vehicle sprite block, you can select all the pcx or bmp files in the dir in 'bitmap file name' field.
Sprite search is for automatic sprite recognition mode, for grfcodec decoded sprites (with those blue numbers), use method1, for a file with only sprites, use method2.
One thing that is important, though, is the sprite layout in the image files. The program uses an automatic method, to recognize the sprites, and the requisites are as follows:
- the order of the directions for vehicle sprites is: facing up first, then rotating CW.
- you should never use the color 255 (the totally white) in any of the graphics (TTD never used that color anyway)
- the top edge of the sprites needs to be in line, which also means the highest sprite cannot extend to the next row of sprites
- the gaps between the sprites need to be at least (but can be any more): 2 column of pixels horizontally, and 6 row of pixels vertically between the highest sprite, and the upper edge of the next row
You can make as many sprite blocks as you want, each having a different .pcx, the only requirement is, that one vehicle's sprites be in one file. Although one .pcx file must not contain more than 500 sprites, this is a limitation of the implementation.
After creating such sprite blocks, you select individual sprites with the right mouse button, or full rows with middle one. Only sprites selected in a block are actually part of that graphic ID block. That means, that one image file can contain many sets' sprites, and you can select any subset of them.

Szappy

-edit- corrected RMB/MMB

Posted: 12 Oct 2005 19:29
by jvassie
Cheers for the reply! :D

Could you explain in more detail what RMB and MMB are please?

Also how do i select which sprite i want in that screen?

Cheers
James

Posted: 12 Oct 2005 20:16
by RK
the select the sprites with the the Right Mouse Button, or the full row with the Middle Mouse Button. (you need 4 or 8 sprites for a vehicle)


@ Szappy
why you don't release a FAQ instead explaining it to every user

Posted: 13 Oct 2005 06:33
by Szappy
RK wrote:@ Szappy
why you don't release a FAQ instead explaining it to every user
You're right, I should.
But since it's here now, I can just link to it ;)
someday I may write a walkthrough for a simple vehicle coding, but that won't happen anytime soon, I'm afraid.

Posted: 13 Oct 2005 06:57
by Purno
jamesvassie wrote:Could you explain in more detail what RMB and MMB are please?
Right Mouse Button and Middle Mouse Button? Pure guess...

Posted: 22 Oct 2005 17:17
by jvassie
Ok another thing ive found, may be a bug, not sure...

If i create my sprites in paint using the correct colours and save it as a 256 colour bmp file, then that loads in grfmaker no probs, but if i convert it to a pcx file then i get a range check error....

The thing is my graphics get all screwed up 'cos of the file compression. Is it possible to add other types of ffiles? best i think would be png, then it can get shown in the forum and its easier to use :wink:

Cheers
James

Posted: 22 Oct 2005 22:02
by BobDendry
way I do it is this: if you are using paint is to open it in paint, save it as a 24-bit bitmap, open GRFMaker's sprite editor, press 'import true color bitmap' and select the file you just saved.
AS for the range check error, I believe it has something to do with either the numbers made by GRFCodec, or there may be two different coloured background whites in there.

Posted: 22 Oct 2005 22:14
by Hyronymus
James, GRFmaker supports bmp ONLY. It's not my favourite graphics format either but it just works like that (I thought it had to do with GRFmaker internals).

Posted: 23 Oct 2005 00:37
by BobDendry
PNG would be too complicated to implement, because it has such a large library, that's what I heard

Posted: 23 Oct 2005 01:55
by krtaylor
Are there open-source converter algorithms, so it could read PNG and GIF simply by converting them to BMP and taking it from there?

Posted: 23 Oct 2005 08:26
by Hyronymus
What could possibly the benefit of that? It only adds an extra vulnerability to the proces.

Posted: 23 Oct 2005 15:56
by orudge
WhiteHand wrote:PNG would be too complicated to implement, because it has such a large library, that's what I heard
I'm not sure about languages other than C, but the PNG programming interface isn't too difficult to use at all - I've used it a few times now with minimal effort.

Posted: 24 Oct 2005 06:49
by Szappy
Hyronymus wrote:James, GRFmaker supports bmp ONLY. It's not my favourite graphics format either but it just works like that (I thought it had to do with GRFmaker internals).
You're actually wrong. GRFMaker supports .bmp and .pcx for quite some time now.
If jamesvassie got a range checking error, then it could be an error in the pcx conversion algorithm. Please, jamesvassie post the pcx involved, so gl2 can check if it's a bug, or a problem with MSPaint.

As for the .png, it has a complicated compression algorithm, and haven't got around to implementing it, but it's in the todo list ;)

Posted: 24 Oct 2005 08:12
by jvassie
Ok glad to hear about future png's! :D

How shall i send it, the forums dont loike pcx's!


James

Posted: 24 Oct 2005 08:39
by Hyronymus
Szappy wrote:
Hyronymus wrote:James, GRFmaker supports bmp ONLY. It's not my favourite graphics format either but it just works like that (I thought it had to do with GRFmaker internals).
You're actually wrong. GRFMaker supports .bmp and .pcx for quite some time now.
Why wasn't I told so :(.

Posted: 24 Oct 2005 08:42
by Szappy
jamesvassie wrote:How shall i send it, the forums dont loike pcx's!
Zip/rar it maybe? ;)
Hyronymus wrote:Why wasn't I told so :(.
err... dunno... maybe you didn't get my mail... gmail doesn't like my yahoo account, you know...