Problem changing palette slots (SOLVED)

Started by Chicky, Fri 05/05/2006 11:30:11

Previous topic - Next topic

Chicky

Okay so I've had a fair amount of help with this from Eric, using Ghormak's palette program i've managed to get mine sorted and all the colours are in the relevant slots and all seems to be working. But when i try to press my button to change the colours of the bg nothing happens. Here's the code:

  if (interface == OPTIONS) {
    // They clicked a button on the GUI
   
    if (button == 0) {
SetPalRGB (18,26,17,17) ;
SetPalRGB (19,63,29,13) ;
UpdatePalette () ;
    }
   
    if (button == 1) {
SetPalRGB (18,27,24,5) ;
SetPalRGB (19,58,55,35) ;
UpdatePalette () ;
    }

  }


and here's an image of the palette



Do you think it's possible that the background isn't linked with the colours in my palette and moreso link to the 'room dependant' colours?


All help is greatly apreciated, i really need to get this sorted this morning!

regards,

Gilbert

It depends on whether you imported the background using exact palette, if it's not in exact palette, the slots will be rearranged during import.

There's a way to check it though, in AGSedit, load up that particular room, then go to palette, select all the "X" (room dependent slots) and uncheck the "room dependent" check box, you'll see how all the are arranged then.

Toy with the slots and the sliders, and toggle to the room tab repeatedly to see how each colour changes, until you find the slots you wanted, then, quit the editor WITHOUT SAVING ANYTHING (or else you might screw up something).

(Though in my opinion the best was is to import the image using exact palette to get the most out of 8-bit games)

Chicky

Ahh thanks Gilbot!

Okay so it turns out the last two palette slots are the ones for the background, and my buttons now work at changing them but what about my sprites? any reason why they dont change?

And when i exit the room wont the room colours go back to normal?

thanks again :)

Scorpiorus

Quote from: Chicky on Fri 05/05/2006 16:06:52my buttons now work at changing them but what about my sprites? any reason why they dont change?

Make sure the code changing them actually runs (just put Display("check"); before changing palette).

The other possibility is, you specified a slot number that's different to one actually used by the sprite. Your palette can have two or more slots with identical (or similar) colours. So see if you are changing the right one.

There is a Remap colors to game palette checkbox when importing sprites. If it's ticked, AGS changes a sprite being imported to match the palette of the AGS Editor. This can make slot numbers different from what they were in the paint program. Lock sprite to current room will also remap sprite graphic to palette of background image of the currently loaded room (that's when a sprite uses "X"-marked slots).

QuoteAnd when i exit the room wont the room colours go back to normal?

Yes, if you load a new room, all the "X" slots will be changed according to those of that room. Others will stay intact, though.

Chicky


SMF spam blocked by CleanTalk