• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Changing sprite palettes temporarily in battle?

Okay, so I'm working on a Pokemon Gold/Silver battle system, and a thing about wild Pokemon and the trainer backsprite is that they have another 4 color palette, which is greyscale. They also scroll into place at the battle start, which can be displayed in this GIF I compiled:

Spoiler:


When they lock into place simultaneously they play a sound effect, and the battle begins. For now, I am just wondering how to change their palette for a couple seconds, play a SE and begin the battle.

This is the palette:

[PokeCommunity.com] Changing sprite palettes temporarily in battle?


If anyone can help me out that'd be great, my RGSS knowledge doesn't extend too far well in Essentials.

Thank you,
Pia Carrot
 
In Essentials, when wild Pokémon are sliding onto the screen, they're darkened and then light up. This is achieved by changing the tone of the sprite displaying the Pokémon. Search PokeBattle_ActualScene for @sprites["pokemon1"].tone (also applies to pokemon3 for double battles).

Fiddle around with the numbers to make the sprites monochrome (-255 for the RGB values should do it, plus whatever you might want for the fourth brightness/grey value). You can also apply this tone business to other sprites such as @sprites["player"] (the player's back sprite) if you want.
 
Thank you, I ended up getting it close to this system. If I use 255 all the way through it's completely black, so I had to compromise at 239,231,231. Maybe I'm simply using the 4th value wrong :s
 
Decrementing all the colour values will indeed produce a black image. In image processing, there are several methods of achieving a greyscale image. The simplest of these is to take the average of the RGB values and set all three to that average (for instance, for 250, 200, 222, the RGB would change to 224, 224, 224). There is also a more complex method of doing this that takes advantage of the human eyes' bias towards green light. You can read about that here: https://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/ (just look for the luminosity method).

What you would need to do is implement a method that samples the colour of each pixel in the image, calculates the average RGB value, and sets its new colour to that value in each of the RGB fields, though I've not looked into this before so I have no idea how you would do it, if at all possible.
 
Back
Top