Pallette don't change (SOLVED)

AngelAC

New member
Hello guys, i hope you are well, i have a little problem, i'm trying to give an enemy a different pallete when is spawned, i've set that in the level file, i've also loaded "palette" and "alternatepal"in entity's file, but it don't change in game, i'm trying to understand what is the issue.

Here is the code at entity's file:
Code:
name grunt_bomber
type enemy
health  100
gfxshadow	1
speed   8

load plasma_grenade
bomb plasma_grenade

palette 	Data/chars/grunt/grunt_bomber/idle.gif
alternatepal 	Data/chars/grunt/grunt_bomber/map1.gif

And here is the code in level file:
Code:
spawn grunt_bomber
alias bomber
health 60
map 1
coords 335 160
at 190

here is a picture of the images:
 

Attachments

  • grunt.jpg
    grunt.jpg
    58.3 KB · Views: 13
Solution
AngelAC said:
Can you upload idle.gif and map1.gif so we can check their palette?

Of course, here it is:

AngelAC,

I see your problem right away. The two images you posted do NOT have identical color tables. The second one has its pixels pointing to different entries in the color table. That is a severely outdated method and not valid for palette or alternatepal.

I also noticed your color tables contain a ton of superfluous entries that fill them up to 128, even though your images only use 17 of them (including the transparent background). Unused colors don't hurt anything, but that also makes me think you are following very outdated instructions for making sprites and remaps.

The current method is much simpler...
do all the images actually share the same palette ? (same colours and same order of colours)
Yes, i made sure of that, they share the same source.
I don't know if the "fall" frames have something to do with it, i mean, they have a different position, could be that the cause?
 
AngelAC said:
Can you upload idle.gif and map1.gif so we can check their palette?

Of course, here it is:

AngelAC,

I see your problem right away. The two images you posted do NOT have identical color tables. The second one has its pixels pointing to different entries in the color table. That is a severely outdated method and not valid for palette or alternatepal.

I also noticed your color tables contain a ton of superfluous entries that fill them up to 128, even though your images only use 17 of them (including the transparent background). Unused colors don't hurt anything, but that also makes me think you are following very outdated instructions for making sprites and remaps.

The current method is much simpler. First, make and apply a palette for only that model's source images. Models in OpenBOR don't share colors, so the palette doesn't need colors for anything else.

Once that's done, making a new palette is also easier. You don't remap the pixels to different points in a color table, you just open the color table and edit its entries with new RGB values (see screenshots). Save the image with new colors and that's your new palette. The images don't even have to match poses, all that matters is color table. In fact, you can just save and use the .act palette files - palette and alternatepal will accept them.

Table_0.PNG

Table_1.PNG


One last thing - .gif format is also outdated. Save as .png instead.

HTH,
DC

 
Solution
I see your problem right away. The two images you posted do NOT have identical color tables.

Wow i see now, i was checking the colors in the wrong window (i use GIMP), humm there are a lot of changes, then one solution is to apply a correct palette to all the images, i'm going to make the neccesary changes and reply when it's fixed. Thank you so much for the feedback, it was very helpfull.

Pd: Yes actually i was exporting in gif because i had some problem with OpenborStats to recognize all the pngs, but now i'm going to change that :)
 
IT WORKED! IT WORKED!  ;D, now i realize what was the issue, i had to change the colors that i wanted but keeping the same order of the others, so the color must match in order number. Thank you so much for your help!

 

Attachments

  • idle.jpg
    idle.jpg
    116.1 KB · Views: 7
  • map1.jpg
    map1.jpg
    113.3 KB · Views: 5
Back
Top Bottom