• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Akari, Selene, Mint, Solana - 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] Changing Overworld Sprite

  • 132
    Posts
    10
    Years
    I have a feeling this will be the last question I have for the moment. Thanks all for the help so far.

    So there are these quests in my game that temporarily allow the player to play as one of his party pokémon with the command $game_variables[34]=x, where x is the sprite of the overworld pokémon. The sucky thing about this though is that, because x is a constant, the player has to use the specified pokémon in accord with the script (i.e., there's an event that checks to see if the player has a clefairy. If the script returns true, the player picks the clefairy and his sprite changes accordingly, as shown in the pic below).
    [PokeCommunity.com] Changing Overworld Sprite

    My question is, how can the player choose whichever pokémon he has in his party, rather than have a predetermined pokémon he has to have caught? It'd be nice for a script to pull out the pokémon's number—001.png, 001s.png, 002.png, and so on—from a separate folder called "pokemon overworld sprites" and not the characters folder, just for simplicity. If I have to make a new script section and do each pokémon manually then I can do that.

    Thanks!
     
    The sucky thing about this though is that, because x is a constant,

    I think you're letting presumptions get the better of you. All PBSpecies is is a large class that assigns Pokemon's national dex number to readable constants. PBSpecies::CLEFAIRY IS the number 35. That's all it is. If you check a pokemon's species attribute, it'll literally be the pokemon's national pokedex number.

    (:CLEFAIRY is different, it's a Ruby Symbol class, but it always gets resolved to one of the numbers in PBSpecies before it gets properly used in Essentials.)

    As for loading the images, I suggest you look through how pbLoadPokemonBitmapSpecies and pbCheckPokemonBitmapFiles does it, in the PSystem_Utilities script section.
     
    Hm, I checked the Utilities and just kinda Frankensteined this code together:

    Spoiler:


    Is that an okay start? Obviously I'm doing something wrong, because it causes an argument error upon using pbPokeSpriteFile in an event. I'm very helpless it seems.

    EDIT: Well, I'm a little closer with this script:
    Spoiler:


    At this point I'm getting errors like "sprintf cannot convert [the chosen pokémon] to an integer" or "too few arguments for sprintf." How do I combine this with pbPlayerSprite(type)? And does the (type) argument have to be there? Wouldn't that require an event script like "pbPokeSpriteFile(:CONSTANT)"?
     
    Last edited:
    Back
    Top