The PokéCommunity Forums Fan Games Game Development Scripts & Tutorials
Essentials Script IV star ratings in summary/storage

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
 
Thread Tools
  #1    
Old October 6th, 2015 (6:00 PM). Edited January 8th, 2018 by Lucidious89.
Lucidious89 Lucidious89 is offline
     
    Join Date: Apr 2014
    Gender: Male
    Posts: 183
    This adds new graphics to the Pokemon's stat screen and PC window that'll give you a good idea of the quality of the Pokemon's IV's at a glance. The scale works like this:

    Empty Star= 0 IV
    Dull Star = 1-29 IV
    Yellow Star = 30 IV
    Big Orange Star = 31 IV

    So you'll be able to determine a quality Pokemon fairly quickly, without needing to cram your display with extra numbers.

    This is now compatible with Essentials 17. This script is now built-in to my Pokemon Birthsigns project by default, so there's no need to install this if you're already using that. Just make sure that the SHOW_IV_STARS toggle is set to "true" for this to show up.

    IV Star Ratings



    PC Example


    Installation

    Go to Thread Tools > Show Printable Version in the top right corner of this post before copy/pasting any code. This'll avoid errors.

    Spoiler:
    First, you must install the following graphics into your Pictures folder:
    Empty Star
    Low Star
    High Star
    Perfect Star

    Step 1
    In PScreen_Summary, paste the following above "def drawPage(page)".
    Code:
    #=============================================================================
      # IV Stars - Shows IV Star ratings on Page 3 (Stats)
      #=============================================================================
      def pbDisplayIVStars
        nostar="Graphics/Pictures/starempty"
        lowstar="Graphics/Pictures/starlow"
        highstar="Graphics/Pictures/starhigh"
        perfectstar="Graphics/Pictures/starperfect"
        overlay = @sprites["overlay"].bitmap
        imagepos=[]
        imagepos.push([nostar,465,82,0,0,-1,-1])
        imagepos.push([nostar,465,126,0,0,-1,-1])
        imagepos.push([nostar,465,158,0,0,-1,-1])
        imagepos.push([nostar,465,190,0,0,-1,-1])
        imagepos.push([nostar,465,222,0,0,-1,-1])
        imagepos.push([nostar,465,254,0,0,-1,-1])
        #HP
        if @pokemon.iv[0]>30
          imagepos.push([perfectstar,465,82,0,0,-1,-1])
        elsif @pokemon.iv[0]>29
          imagepos.push([highstar,465,82,0,0,-1,-1])
        elsif @pokemon.iv[0]>0 && @pokemon.iv[0]<30
          imagepos.push([lowstar,465,82,0,0,-1,-1])
        end
        #Atk
        if @pokemon.iv[1]>30
          imagepos.push([perfectstar,465,126,0,0,-1,-1])
        elsif @pokemon.iv[1]>29
          imagepos.push([highstar,465,126,0,0,-1,-1])
        elsif @pokemon.iv[1]>0 && @pokemon.iv[1]<30
          imagepos.push([lowstar,465,126,0,0,-1,-1])
        end
        #Def
        if @pokemon.iv[2]>30
          imagepos.push([perfectstar,465,158,0,0,-1,-1])
        elsif @pokemon.iv[2]>29
          imagepos.push([highstar,465,158,0,0,-1,-1])
        elsif @pokemon.iv[2]>0 && @pokemon.iv[2]<30
          imagepos.push([lowstar,465,158,0,0,-1,-1])
        end
        #SpAtk
        if @pokemon.iv[4]>30
          imagepos.push([perfectstar,465,190,0,0,-1,-1])
        elsif @pokemon.iv[4]>29
          imagepos.push([highstar,465,190,0,0,-1,-1])
        elsif @pokemon.iv[4]>0 && @pokemon.iv[4]<30
          imagepos.push([lowstar,465,190,0,0,-1,-1])
        end
        #SpDef
        if @pokemon.iv[5]>30
          imagepos.push([perfectstar,465,222,0,0,-1,-1])
        elsif @pokemon.iv[5]>29
          imagepos.push([highstar,465,222,0,0,-1,-1])
        elsif @pokemon.iv[5]>0 && @pokemon.iv[5]<30
          imagepos.push([lowstar,465,222,0,0,-1,-1])
        end
        #Speed
        if @pokemon.iv[3]>30
          imagepos.push([perfectstar,465,254,0,0,-1,-1])
        elsif @pokemon.iv[3]>29
          imagepos.push([highstar,465,254,0,0,-1,-1])
        elsif @pokemon.iv[3]>0 && @pokemon.iv[3]<30
          imagepos.push([lowstar,465,254,0,0,-1,-1])
        end
        pbDrawImagePositions(overlay,imagepos)
      end
    Then, somewhere in "def drawPage(page)", paste this:
    Code:
    pbDisplayIVStars if @page==3
    Step 2
    In PScreen_Storage, locate the following section:
    Code:
    if pokemon.isShiny?
            imagepos.push(["Graphics/Pictures/shiny",156,198,0,0,-1,-1])
          end
    And paste the following below it:
    Code:
    #=========================================================================
          # IV Star Gauge
          #=========================================================================
          nostar="Graphics/Pictures/starempty"
          lowstar="Graphics/Pictures/starlow"
          highstar="Graphics/Pictures/starhigh"
          perfectstar="Graphics/Pictures/starperfect"
          #HP
          if pokemon.iv[0]>30
            imagepos.push([perfectstar,8,198,0,0,-1,-1])
          elsif pokemon.iv[0]>29
            imagepos.push([highstar,8,198,0,0,-1,-1])
          elsif pokemon.iv[0]>0 && pokemon.iv[0]<30
            imagepos.push([lowstar,8,198,0,0,-1,-1])
          else
            imagepos.push([nostar,8,198,0,0,-1,-1])
          end
          #Atk
          if pokemon.iv[1]>30
            imagepos.push([perfectstar,24,198,0,0,-1,-1])
          elsif pokemon.iv[1]>29
            imagepos.push([highstar,24,198,0,0,-1,-1])
          elsif pokemon.iv[1]>0 && pokemon.iv[1]<30
            imagepos.push([lowstar,24,198,0,0,-1,-1])
          else
            imagepos.push([nostar,24,198,0,0,-1,-1])
          end
          #Def
          if pokemon.iv[2]>30
            imagepos.push([perfectstar,40,198,0,0,-1,-1])
          elsif pokemon.iv[2]>29
            imagepos.push([highstar,40,198,0,0,-1,-1])
          elsif pokemon.iv[2]>0 && pokemon.iv[2]<30
            imagepos.push([lowstar,40,198,0,0,-1,-1])
          else
            imagepos.push([nostar,40,198,0,0,-1,-1])
          end
          #SpAtk
          if pokemon.iv[4]>30
            imagepos.push([perfectstar,56,198,0,0,-1,-1])
          elsif pokemon.iv[4]>29
            imagepos.push([highstar,56,198,0,0,-1,-1])
          elsif pokemon.iv[4]>0 && pokemon.iv[4]<30
            imagepos.push([lowstar,56,198,0,0,-1,-1])
          else
            imagepos.push([nostar,56,198,0,0,-1,-1])
          end
          #SpDef
          if pokemon.iv[5]>30
            imagepos.push([perfectstar,72,198,0,0,-1,-1])
          elsif pokemon.iv[5]>29
            imagepos.push([highstar,72,198,0,0,-1,-1])
          elsif pokemon.iv[5]>0 && pokemon.iv[5]<30
            imagepos.push([lowstar,72,198,0,0,-1,-1])
          else
            imagepos.push([nostar,72,198,0,0,-1,-1])
          end
          #Speed
          if pokemon.iv[3]>30
            imagepos.push([perfectstar,88,198,0,0,-1,-1])
          elsif pokemon.iv[3]>29
            imagepos.push([highstar,88,198,0,0,-1,-1])
          elsif pokemon.iv[3]>0 && pokemon.iv[3]<30
            imagepos.push([lowstar,88,198,0,0,-1,-1])
          else
            imagepos.push([nostar,88,198,0,0,-1,-1])
          end
          #=========================================================================


    Known Issues:
    • Some Pokemon that have very large sprites (such as Ho-oh, Charizard, Zekrom, etc) will overlap with the IV Star Gauge graphics when viewed in the PC, and obscure them from view. You may need to reposition things if this bothers you.


    Other scripts of mine that you may like:
    Spoiler:
    • "Pokemon Birthsigns"
      This is my most ambitious project, consisting of several scripts that adds an entirely new breeding mechanic to the game known as 'Birthsigns'. These are added perks that are applied to a Pokemon at its moment of birth, which vary depending on the different constellations for each month of the year. Think Elder Scrolls, but with a Pokemon twist!
      You can find this project here: http://www.pokecommunity.com/showthread.php?p=8740502#8740502
    • "Egg Group Types"
      A script that displays the Egg Groups that a Pokemon belongs to in its summary, allowing you to easily look up compatible species for breeding. You can even stick this script into other places, such as the Pokedex, or PC menu.
      You can find this script here: http://www.pokecommunity.com/showthread.php?p=8957794#8957794
    • "HGSS Shiny Leaf Display"
      A script that adds the ability to attach Shiny Leaves to your Pokemon, a feature exclusive to HGSS. This adds an extra way of adding some uniqueness to your Pokemon. How you utilize them is up to you!
      You can find this script here: http://www.pokecommunity.com/showthread.php?p=8956957#8956957
    • "Unique Party Ball"
      A script that changes the ball graphic in the party screen to reflect the actual ball the Pokemon was caught in, rather than always displaying the standard Pokeball.
      You can find this script here: http://www.pokecommunity.com/showthr...959506#8959506
    Reply With Quote

    Relevant Advertising!

      #2    
    Old October 8th, 2015 (12:09 PM).
    Zesk12 Zesk12 is offline
       
      Join Date: Mar 2011
      Gender: Male
      Posts: 10
      Thanks man, i´m gonna use it in my project !!! looks great !!!
      Reply With Quote
        #3    
      Old February 1st, 2016 (8:11 AM).
      Lucidious89 Lucidious89 is offline
         
        Join Date: Apr 2014
        Gender: Male
        Posts: 183
        Just noting that this should still function perfectly fine in Essentials v16. Of course, let me know if anyone encounters any issues.
        Reply With Quote
          #4    
        Old March 1st, 2016 (11:48 AM).
        mewlover22's Avatar
        mewlover22 mewlover22 is offline
        Pokemon Creator
           
          Join Date: Oct 2008
          Location: South Carolina
          Gender: Male
          Nature: Quiet
          Posts: 336
          Has any one tired this on version 16 im not getting any errors it just doesn't work right the stars are on page of the summary screen for the pokemon.
          __________________
          Reply With Quote
            #5    
          Old March 2nd, 2016 (11:25 AM). Edited March 2nd, 2016 by Lucidious89.
          Lucidious89 Lucidious89 is offline
             
            Join Date: Apr 2014
            Gender: Male
            Posts: 183
            Quote:
            Originally Posted by mewlover22 View Post
            Has any one tired this on version 16 im not getting any errors it just doesn't work right the stars are on page of the summary screen for the pokemon.
            Are you sure you're putting all this code under the section def drawPageThree(pokemon)? It sounds like you installed the code fine, you just put it all under the wrong summary page.

            Use CTL+F to locate def drawPageThree(pokemon), and then about 20 lines or so under that you should find the line pbDrawImagePositions(overlay,imagepos). This is where the code should be installed. This is assuming you're working with the default Summary script that comes with Essentials.

            Make sure the code is being place ABOVE the pbDrawImagePositions(overlay,imagepos) line. Placing it below this line will not produce any errors, but no graphics will not show up. This may be what's happening with you.
            Reply With Quote
              #6    
            Old March 2nd, 2016 (5:41 PM).
            Anova's Avatar
            Anova Anova is offline
               
              Join Date: Jan 2016
              Location: Las Vegas
              Gender: Female
              Nature: Impish
              Posts: 31
              I had a problem with the stars not showing in the PC...
              Not sure if it has anything to do with the pokemon being the animated ones or not, but I did fix it by
              changing
              nostar="Graphics/Pictures/starempty"
              lowstar="Graphics/Pictures/starlow"
              highstar="Graphics/Pictures/starhigh"
              perfectstar="Graphics/Pictures/starperfect"
              To
              nostar=sprintf("Graphics/Pictures/starempty")
              lowstar=sprintf("Graphics/Pictures/starlow")
              highstar=sprintf("Graphics/Pictures/starhigh")
              perfectstar=sprintf("Graphics/Pictures/starperfect")

              And the stars show with no problems now.
              __________________
              I believe in Jesus Christ my Savior.
              God the Son, Yeshua Hamashiach
              {<3}
              Reply With Quote
                #7    
              Old March 3rd, 2016 (2:21 AM).
              Lucidious89 Lucidious89 is offline
                 
                Join Date: Apr 2014
                Gender: Male
                Posts: 183
                Quote:
                Originally Posted by Anova View Post
                I had a problem with the stars not showing in the PC...
                Not sure if it has anything to do with the pokemon being the animated ones or not, but I did fix it by
                changing
                nostar="Graphics/Pictures/starempty"
                lowstar="Graphics/Pictures/starlow"
                highstar="Graphics/Pictures/starhigh"
                perfectstar="Graphics/Pictures/starperfect"
                To
                nostar=sprintf("Graphics/Pictures/starempty")
                lowstar=sprintf("Graphics/Pictures/starlow")
                highstar=sprintf("Graphics/Pictures/starhigh")
                perfectstar=sprintf("Graphics/Pictures/starperfect")

                And the stars show with no problems now.
                Interesting. I'm using animated sprites and they display fine in the PC for me. But good to know that this solution may help people that have this issue.
                Reply With Quote
                  #8    
                Old March 3rd, 2016 (3:01 PM).
                mewlover22's Avatar
                mewlover22 mewlover22 is offline
                Pokemon Creator
                   
                  Join Date: Oct 2008
                  Location: South Carolina
                  Gender: Male
                  Nature: Quiet
                  Posts: 336
                  Quote:
                  Originally Posted by Lucidious89 View Post
                  Are you sure you're putting all this code under the section def drawPageThree(pokemon)? It sounds like you installed the code fine, you just put it all under the wrong summary page.

                  Use CTL+F to locate def drawPageThree(pokemon), and then about 20 lines or so under that you should find the line pbDrawImagePositions(overlay,imagepos). This is where the code should be installed. This is assuming you're working with the default Summary script that comes with Essentials.

                  Make sure the code is being place ABOVE the pbDrawImagePositions(overlay,imagepos) line. Placing it below this line will not produce any errors, but no graphics will not show up. This may be what's happening with you.
                  I set it up right and it works the issue is when i look at the summary screen the stars show up on page one not by the stats.
                  __________________
                  Reply With Quote
                    #9    
                  Old March 3rd, 2016 (11:42 PM).
                  Lucidious89 Lucidious89 is offline
                     
                    Join Date: Apr 2014
                    Gender: Male
                    Posts: 183
                    Quote:
                    Originally Posted by mewlover22 View Post
                    I set it up right and it works the issue is when i look at the summary screen the stars show up on page one not by the stats.
                    That shouldn't be happening if you installed it correctly as you say. If the stars are showing up on page one, then you pasted the code within the def drawPageOne(pokemon), and not under drawPageThree(pokemon) like it should be.

                    Unless your project has previous modifications to the Summary scripts, I have no idea why pasting the code under the def for Page Three would end up displaying images on Page One.
                    Reply With Quote
                      #10    
                    Old December 28th, 2017 (4:39 PM).
                    kurugane's Avatar
                    kurugane kurugane is offline
                       
                      Join Date: Aug 2014
                      Gender: Male
                      Posts: 5
                      It doesn't work on essentials 17.2
                      Reply With Quote
                        #11    
                      Old December 29th, 2017 (8:26 AM).
                      Lucidious89 Lucidious89 is offline
                         
                        Join Date: Apr 2014
                        Gender: Male
                        Posts: 183
                        Quote:
                        Originally Posted by kurugane View Post
                        It doesn't work on essentials 17.2
                        Instructions have been updated. Thanks for letting me know.
                        Reply With Quote
                          #12    
                        Old December 30th, 2017 (12:15 AM). Edited December 30th, 2017 by p.claydon.
                        p.claydon p.claydon is offline
                           
                          Join Date: Jan 2011
                          Gender: Female
                          Posts: 399
                          ive followed the instructions but the stars dont show up any ideas?

                          EDIT

                          Ok fixed the issue

                          so adding pbDisplayIVStars if @page==3 to def drawPage(page) does not work instead you need to add pbDisplayIVStars to def drawPageThree
                          __________________
                          Still learning how to sprite but if you want to look at my progress then here you go
                          http://pclaydon.deviantart.com/gallery/
                          Reply With Quote
                            #13    
                          Old December 30th, 2017 (2:36 AM).
                          Lucidious89 Lucidious89 is offline
                             
                            Join Date: Apr 2014
                            Gender: Male
                            Posts: 183
                            Quote:
                            Originally Posted by p.claydon View Post
                            ive followed the instructions but the stars dont show up any ideas?

                            EDIT

                            Ok fixed the issue

                            so adding pbDisplayIVStars if @page==3 to def drawPage(page) does not work instead you need to add pbDisplayIVStars to def drawPageThree
                            It does work, but perhaps the placement of it matters more than I thought. I just stuck it in under the part that displays the shiny star graphic. But either way is fine, so it doesn't matter really.
                            Reply With Quote
                              #14    
                            Old January 3rd, 2018 (2:36 PM). Edited January 3rd, 2018 by Metekulous.
                            Metekulous's Avatar
                            Metekulous Metekulous is offline
                            Studio
                               
                              Join Date: Dec 2017
                              Location: Erie, PA
                              Gender: Male
                              Nature: Adamant
                              Posts: 10
                              We actually created something very similar to this but it's a little more elaborate.
                              We included the EVs as well and also have 32 stars created for each IV.

                              I like the PC IVs though. That's a neat idea.

                              Here's what ours looks like.
                              __________________
                              Reply With Quote
                                #15    
                              Old January 3rd, 2018 (3:05 PM).
                              Lucidious89 Lucidious89 is offline
                                 
                                Join Date: Apr 2014
                                Gender: Male
                                Posts: 183
                                Quote:
                                Originally Posted by Metekulous View Post
                                We actually created something very similar to this but it's a little more elaborate.
                                We included the EVs as well and also have 32 stars created for each IV.

                                I like the PC IVs though. That's a neat idea.

                                Here's what ours looks like.
                                Nice, yours looks really good.
                                Reply With Quote
                                  #16    
                                Old January 3rd, 2018 (4:06 PM). Edited January 3rd, 2018 by Metekulous.
                                Metekulous's Avatar
                                Metekulous Metekulous is offline
                                Studio
                                   
                                  Join Date: Dec 2017
                                  Location: Erie, PA
                                  Gender: Male
                                  Nature: Adamant
                                  Posts: 10
                                  I'm still kind of new to spriting but I have a bachelors in graphic design so I'd hope it looks at least decent haha. Thanks though! I think I'll definitely be implementing your in PC IV checker into my game. I don't know how I didn't think of that beforehand. It's one of sun and moons best features.

                                  Also, we extended the width of our viewport allowing for more information on the screen. I think this is what helped with reorganizing all the summary pages and keeping it cleaner.
                                  __________________
                                  Reply With Quote
                                  Reply

                                  Quick Reply

                                  Join the conversation!

                                  Create an account to post a reply in this thread, participate in other discussions, and more!

                                  Create a PokéCommunity Account

                                  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 11:07 AM.