mikem
Quake 2 Mapping Club
Posts: 328
|
Post by mikem on Jul 20, 2023 1:58:46 GMT -5
Do you know of a way or a tool to change the size of sprites (.sp2)? The size is defined in the sp2 file. So it doesn't help if I change the TGA/PCX file. With hgspr2_v0.2b I can only change the path and the origin. I use model_spawn to display sprites as a flare sfx: Maybe model_spawn can achieve that somehow. For this effect, it would be best if the sprite gets smaller as the player gets closer and the sprite fades out when it's behind a brush.
|
|
|
Post by knightmare on Jul 20, 2023 3:17:47 GMT -5
I'm not familiar with sprite editors, but you can certainly edit one using a hex editor.
The sp2 file format is pretty simple:
typedef struct { int width, height; int origin_x, origin_y; // raster coordinates inside pic char name[MD2_MAX_SKINNAME]; // name of pcx file } dspr2frame_t;
typedef struct { int ident; int version; int numframes; dspr2frame_t frames[1]; // variable sized } dspr2_t;
Look for the start of the image name (assuming the spirte has only one frame, as it will be non-animated), then jump back 16 bytes. The next 2 dwords will be the width and height in little endian hexadecimal. You can edit them using the Windows calculator to convert to hex and then swapping to little endian in a text editor.
As far as sizing the flare sprite according to player distance, that can't be done currently. It would probably require an enhanced Q3-style shader system in the renderer.
|
|
mikem
Quake 2 Mapping Club
Posts: 328
|
Post by mikem on Jul 20, 2023 13:12:55 GMT -5
Thanks, I'll try that after my vacation.
|
|
mikem
Quake 2 Mapping Club
Posts: 328
|
Post by mikem on Aug 9, 2023 8:10:47 GMT -5
Thanks, it worked. With or without halos as sprites?
|
|