• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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

40
Posts
8
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?
     

    #Not Important

    All hail the wishmaker
    910
    Posts
    4
    Years
  • 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

    Change battle graphics based on switch

    Search for that, then under add: pbChangeBGSpriteOnSwitch
    Done!
     
    40
    Posts
    8
    Years
  • 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
     
    40
    Posts
    8
    Years
  • 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?
     
    1,682
    Posts
    8
    Years
    • Seen May 16, 2024
    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