• 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!
  • Dawn, Gloria, Juliana, or Summer - 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.

[Scripting Question] Displaying Pokémon’s icon in the Battle Databox

HM100

HM100 the Techno
  • 108
    Posts
    8
    Years
    • Seen Jan 30, 2025
    Hello. I'm trying to add Pokémon 's icon to be displayed in the battle databox but when I try to do that, it causes the game to crash. Is there a way to achieve this without causing the game to crash
     
    Do you want to show us the error message you got? How about the code you've changed? I don't feel like reading your mind at the moment.
     
    It displayed that Sprite Resizer couldn't convert it into viewport. The only code I added is in the def refresh of the databox code to display Pokémon's icon.
     
    That doesn't really tell us what you changed. Can you show us the def refresh of the database class? Perhaps you've passed a bad argument.
    Later. Just added after the shiny icon display for shony Pokémon, three lines that set a variable to be a Pokémon Icon, then set its x and y and it crashed giving a sprite_resizer error. I will give the code once I use my PC for the internet. I can't while using my tab.
     
    Here's some code of the Databox I use (See Spoilers for code)
    Spoiler:

    Please note that it also has some other working changes I did barring the icon addition to the battle hud databoxes
     
    So here's the thing. The icon code by itself works completely fine, in both v17.2 and v16.2 (since the latter is what you are using).

    Can you post the full stack trace? I don't think it was the icon that caused this error. Or at the very least, there's more to be seen here.
     
    So here's the thing. The icon code by itself works completely fine, in both v17.2 and v16.2 (since the latter is what you are using).

    Can you post the full stack trace? I don't think it was the icon that caused this error. Or at the very least, there's more to be seen here.

    The problem must be with the viewport parameter. I used self.bitmap but it crashed when using that as viewport
     
    To be blunt, if you knew what the problem was, you wouldn't be asking for help. You have also repeatedly failed to show us the error message you get. We want to actually see it, not have you tell us very little about it.

    You say you used self.bitmap as a viewport (which is just wrong, of course; a bitmap isn't a viewport), but your code doesn't show this. Again, you're not showing us all the information we might need to actually help you.
     
    In the end I tried several methods and it seems that I have fixed that problem without any errors. Only bug is that it is displayed as if the viewport was the entire window size. Now no errors appear!
     
    Back
    Top