Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.

Reply
 
Thread Tools
  #1    
Old June 27th, 2012 (10:01 AM).
pokemongarnet's Avatar
pokemongarnet pokemongarnet is offline
CAT-BUS!
     
    Join Date: Mar 2009
    Gender: Male
    Posts: 729
    Okay, I made a new battle box for my game, and I want to modify the fonts, and placement of the HP Bar/ Exp Bar as well as the position of the battle box itself. So if anyone could point me in the right direction or at least what section of the script to look in, it'd be a great help. Thanks.
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old June 27th, 2012 (10:19 AM).
    xalien95's Avatar
    xalien95 xalien95 is offline
    Developer of Pokémon Omicron
       
      Join Date: Jan 2011
      Location: Italy, Monopoly
      Age: 21
      Gender: Male
      Posts: 76
      You have to go to PokeBattle_ActualScene.. find the class PokemonDataBox and then the def refresh ;]
      Reply With Quote
        #3    
      Old June 27th, 2012 (10:53 AM).
      pokemongarnet's Avatar
      pokemongarnet pokemongarnet is offline
      CAT-BUS!
         
        Join Date: Mar 2009
        Gender: Male
        Posts: 729
        Ok but from here which lines should I edit?
        __________________
        Reply With Quote
          #4    
        Old June 27th, 2012 (11:23 AM).
        xalien95's Avatar
        xalien95 xalien95 is offline
        Developer of Pokémon Omicron
           
          Join Date: Jan 2011
          Location: Italy, Monopoly
          Age: 21
          Gender: Male
          Posts: 76
          If you have basic rgss knowledges, to:
          - change the font, you have to import the new font in the game (editing SpriteWindow and PokemonLoad) and call it with the command bitmap.font.name = ["name_of_the_new_font"]
          - change coordinates of HP and EXP bar, you have to find something like this
          Code:
          # fill with HP color
              hpGaugeX=PokeBattle_Scene::HPGAUGE_X
              hpGaugeY=PokeBattle_Scene::HPGAUGE_Y
              expGaugeX=PokeBattle_Scene::EXPGAUGE_X
              expGaugeY=PokeBattle_Scene::EXPGAUGE_Y
              self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY,hpgauge,2,hpcolors[hpzone*2])
              self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY+2,hpgauge,4,hpcolors[hpzone*2+1])
              if @showexp
                # fill with EXP color
                self.bitmap.fill_rect(@spritebaseX+expGaugeX,expGaugeY,self.exp,2,PokeBattle_Scene::EXPCOLORSHADOW)
                self.bitmap.fill_rect(@spritebaseX+expGaugeX,expGaugeY+2,self.exp,2,PokeBattle_Scene::EXPCOLORBASE)
              end
          and edit
          - change coordinates of boxes, you have to find and edit this
          Code:
          if (@battler.index&1)==0 # if player's Pokémon
                @spritebaseX=34
              else
                @spritebaseX=16
              end
              yoffset=(Graphics.height-320)                       # Adjust for screen size
              if doublebattle
                case @battler.index
                  when 0
                    @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxD")
                    @spriteX=224+Graphics.width-480
                    @spriteY=102+yoffset
                  when 1 
                    @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxD")
                    @spriteX=-4
                    @spriteY=2
                  when 2 
                    @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxD")
                    @spriteX=236+Graphics.width-480
                    @spriteY=162+yoffset
                  when 3 
                    @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxD")
                    @spriteX=-16
                    @spriteY=62
                end
              else
                case @battler.index
                  when 0
                    @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxS")
                    @spriteX=236+Graphics.width-480
                    @spriteY=128+yoffset
                    @showhp=true
                    @showexp=true
                  when 1 
                    @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxS")
                    @spriteX=-16
                    @spriteY=36
                end
              end
          Reply With Quote
            #5    
          Old June 27th, 2012 (12:26 PM).
          pokemongarnet's Avatar
          pokemongarnet pokemongarnet is offline
          CAT-BUS!
             
            Join Date: Mar 2009
            Gender: Male
            Posts: 729
            Quote:
            Originally Posted by xalien95 View Post
            If you have basic rgss knowledges, to:
            - change the font, you have to import the new font in the game (editing SpriteWindow and PokemonLoad) and call it with the command bitmap.font.name = ["name_of_the_new_font"]
            - change coordinates of HP and EXP bar, you have to find something like this
            Code:
            # fill with HP color
                hpGaugeX=PokeBattle_Scene::HPGAUGE_X
                hpGaugeY=PokeBattle_Scene::HPGAUGE_Y
                expGaugeX=PokeBattle_Scene::EXPGAUGE_X
                expGaugeY=PokeBattle_Scene::EXPGAUGE_Y
                self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY,hpgauge,2,hpcolors[hpzone*2])
                self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY+2,hpgauge,4,hpcolors[hpzone*2+1])
                if @showexp
                  # fill with EXP color
                  self.bitmap.fill_rect(@spritebaseX+expGaugeX,expGaugeY,self.exp,2,PokeBattle_Scene::EXPCOLORSHADOW)
                  self.bitmap.fill_rect(@spritebaseX+expGaugeX,expGaugeY+2,self.exp,2,PokeBattle_Scene::EXPCOLORBASE)
                end
            and edit
            - change coordinates of boxes, you have to find and edit this
            Code:
            if (@battler.index&1)==0 # if player's Pokémon
                  @spritebaseX=34
                else
                  @spritebaseX=16
                end
                yoffset=(Graphics.height-320)                       # Adjust for screen size
                if doublebattle
                  case @battler.index
                    when 0
                      @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxD")
                      @spriteX=224+Graphics.width-480
                      @spriteY=102+yoffset
                    when 1 
                      @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxD")
                      @spriteX=-4
                      @spriteY=2
                    when 2 
                      @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxD")
                      @spriteX=236+Graphics.width-480
                      @spriteY=162+yoffset
                    when 3 
                      @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxD")
                      @spriteX=-16
                      @spriteY=62
                  end
                else
                  case @battler.index
                    when 0
                      @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxS")
                      @spriteX=236+Graphics.width-480
                      @spriteY=128+yoffset
                      @showhp=true
                      @showexp=true
                    when 1 
                      @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxS")
                      @spriteX=-16
                      @spriteY=36
                  end
                end
            Ah, thank you for that but I know pretty much 0 RGSS. Alright, off to make some changes.
            __________________
            Reply With Quote
              #6    
            Old June 28th, 2012 (11:03 AM).
            pokemongarnet's Avatar
            pokemongarnet pokemongarnet is offline
            CAT-BUS!
               
              Join Date: Mar 2009
              Gender: Male
              Posts: 729
              Sorry for the double post, but is there any way that I could only move the player HP Bar? Because every time I change coordinates it does it for both.
              __________________
              Reply With Quote
                #7    
              Old June 28th, 2012 (11:19 AM). Edited June 28th, 2012 by xalien95.
              xalien95's Avatar
              xalien95 xalien95 is offline
              Developer of Pokémon Omicron
                 
                Join Date: Jan 2011
                Location: Italy, Monopoly
                Age: 21
                Gender: Male
                Posts: 76
                You have to find HPGAUGE_X=102 and HPGAUGE_Y=40 in PokeBattle_ActualScene to edit coordinates ;]
                Reply With Quote
                  #8    
                Old June 29th, 2012 (4:28 AM).
                Maruno's Avatar
                Maruno Maruno is offline
                Lead Dev of Pokémon Essentials
                   
                  Join Date: Jan 2008
                  Location: England
                  Posts: 5,171
                  Quote:
                  Originally Posted by pokemongarnet View Post
                  Sorry for the double post, but is there any way that I could only move the player HP Bar? Because every time I change coordinates it does it for both.
                  The icon indicating shininess is in different places depending on which side that Pokémon is on. Use the same kind of thing to modify the coordinates of the bar.
                  __________________
                  Go to the Pokémon Essentials Wiki

                  | Downloads | Tutorials | Fangames |
                  | All Animations Project |

                  Follow me on Twitter: @maruno42


                  Reply With Quote
                    #9    
                  Old June 29th, 2012 (10:34 AM).
                  pokemongarnet's Avatar
                  pokemongarnet pokemongarnet is offline
                  CAT-BUS!
                     
                    Join Date: Mar 2009
                    Gender: Male
                    Posts: 729
                    Sorry for my minimal scripting knowledge here, but I'm guessing that the shininess code that you're talking about is this... And that @battler.index&1 defines which pokemon it is?

                    Code:
                    if @battler.pokemon.isShiny?
                          shinyX=206
                          shinyX=-6 if (@battler.index&1)==0 # If player's Pokémon
                          imagepos=[["Graphics/Pictures/shiny.png",@spritebaseX+shinyX,36,0,0,-1,-1]]
                          pbDrawImagePositions(self.bitmap,imagepos)
                        end
                    Or I would put something like this near line 1264 and make it like this:
                    Code:
                    # Position of HP gauge
                      HPGAUGE_X=115
                      HPGAUGE_X=90 if (@battler.index&1)==0 
                      HPGAUGE_Y=40
                      HPGAUGE_Y=70 if (@battler.index&1)==0
                    And that would make the HP coordinates for the Player's bar (90,70) While the opponent bar is at (115,70).

                    Again I have no idea what I'm doing. I've never guessed about something this much in my life.

                    EDIT: But I guess I would have to define the method battler.index&1 first.
                    __________________
                    Reply With Quote
                      #10    
                    Old June 29th, 2012 (12:52 PM).
                    Maruno's Avatar
                    Maruno Maruno is offline
                    Lead Dev of Pokémon Essentials
                       
                      Join Date: Jan 2008
                      Location: England
                      Posts: 5,171
                      Leave those constants alone. You want to edit the same method that the if (@battler.index&1)==0 appears in (i.e. def update). The change is exactly the same, except you change different variables instead. It's up to you to learn at least a little scripting in order to do this - it's really not difficult, since half the time just reading the code will give you an idea about what it's doing. For example, hpGaugeX does not mean "throw an octopus into the sink".

                      That red code doesn't need "defining" or messing around with in any way. It literally means "if the Pokémon is on the player's side". The comment right next to that code (which exists in the shiny icon bit) says as much.
                      __________________
                      Go to the Pokémon Essentials Wiki

                      | Downloads | Tutorials | Fangames |
                      | All Animations Project |

                      Follow me on Twitter: @maruno42


                      Reply With Quote
                      Reply
                      Quick Reply

                      Sponsored Links
                      Thread Tools

                      Posting Rules
                      You may not post new threads
                      You may not post replies
                      You may not post attachments
                      You may not edit your posts

                      BB code is On
                      Smilies are On
                      [IMG] code is On
                      HTML code is Off

                      Forum Jump


                      All times are GMT -8. The time now is 3:29 AM.