• 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] Change battle graphics based on switch

  • 38
    Posts
    9
    Years
    Hey all, so I'm working on adding a feature to change graphics styles in game via an option from the default RSE style included with essentials to the GSC style. So far so good, I know how to do it for events, the Player Character, and tilesets, but not battle graphics, or other menus like the pokedex or pokegear, etc. Any ideas on how I could say activate a switch to change battle graphics or something like that?
     
    OK:
    In PokeBattle_Battle search for: def pbCommonAnimation(name,attacker,opponent,hitnum=0)
    Under that add:
    Code:
      def pbChangeBGSpriteOnSwitch
        if $game_switches[999]
          @scene.sprites["battlebg"].setBitmap("Graphics/Battlebacks/battlebgIndoorA.png")
          @scene.sprites["playerbase"].setBitmap("Graphics/Battlebacks/playerbaseIndoorA.png")
          @scene.sprites["enemybase"].setBitmap("Graphics/Battlebacks/enemybaseIndoorA.png")
        end
      end

    [PokeCommunity.com] Change battle graphics based on switch

    Search for that, then under add: pbChangeBGSpriteOnSwitch
    Done!
     
    Thanks Vendily and #not important, checking that thread with the similar question told me what i needed to know, I have it working perfectly now :D
     
    I have a follow up question related to the battle graphics...I imagine that this would also work for other things besides graphics, so I thought I might try something similar for music. Would it be possible to, for example, play the HGSS version of Pewter City by default, but play the GSC version when a switch is activated? Like, if I name the HGSS version "Pewter City.bgm" and the GSC version "Pewter City_gbc.bgm"? Also, what script section would I have to change?
     
    Entirely possible, after all, essentials already plays nighttime themes if there is a file with an n on the end, like "[Name of bgm]n". That's coded in def autoplayAsCue and def autoplay in script section Game_Map.

    It's just a matter of checking if your switch is on first, then elsif-ing into the nighttime check otherwise.

    Basically just a matter of finding the thing you want to change and adding an if/else with the switch as a condition, generally.
     
    Back
    Top