The PokéCommunity Forums Fan Games Game Development Scripts & Tutorials
Essentials Script Family Tree

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 November 27th, 2014 (5:40 AM). Edited January 10th, 2016 by FL.
FL's Avatar
FL FL is offline
Pokémon Island Creator
     
    Join Date: Sep 2010
    Gender: Male
    Posts: 1,725
    PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
    Code:
    #===============================================================================
    # * Family Tree - by FL (Credits will be apreciated)
    #===============================================================================
    #
    # This script is for Pokémon Essentials. It displays a sixth page at pokémon
    # summary showing a little info about the pokémon mother, father, grandmothers
    # and grandfathers if the pokémon has any.
    #
    #===============================================================================
    #
    # To this script works, put it above main, put a 512x384 background for this
    # screen in "Graphics/Pictures/summary6" and in "Graphics/Pictures/summaryEgg6".
    # This last one is only necessary if SHOWFAMILYEGG is true. You also need to
    # update the below pictures in order to reflect the summary icon change:
    # - summary1
    # - summary2
    # - summary3
    # - summary4
    # - summary4details
    # - summary5
    #
    # -At PokemonDayCare, before line '$Trainer.party[$Trainer.party.length]=egg'
    # add line 'egg.family = PokemonFamily.new(egg, father, mother)'
    #
    # -At PokemonSummary, change both lines '@page=4 if @page>4'
    # to '@page=5 if @page>5'
    #
    # -Before line 'if Input.trigger?(Input::UP) && @partyindex>0'
    # add line 'handleInputsEgg'
    #
    # -Change line 'if @page!=0' to 'if @page!=0 && !(SHOWFAMILYEGG && @page==5)'
    #
    # -After line 'drawPageFive(@pokemon)' add
    #
    # when 5
    #   drawPageSix(@pokemon)
    #
    #===============================================================================
    
    class PokemonSummaryScene
      SHOWFAMILYEGG = true # when true, family tree is also showed in egg screen.
      
      def drawPageSix(pokemon)
        [email protected]["overlay"].bitmap
        overlay.clear
        @sprites["background"].setBitmap(@pokemon.isEgg? ? 
            "Graphics/Pictures/summaryEgg6" : "Graphics/Pictures/summary6")
        imagepos=[]
        if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
          status=6 if pbPokerus(pokemon)==1
          [email protected] if @pokemon.status>0
          status=5 if pokemon.hp==0
          imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
        end
        if pokemon.isShiny?
          imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
        end
        if pbPokerus(pokemon)==2
          imagepos.push([
              sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
        end
        [email protected] ? @pokemon.ballused : 0
        ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
        imagepos.push([ballimage,14,60,0,0,-1,-1])
        pbDrawImagePositions(overlay,imagepos)
        base=Color.new(248,248,248)
        shadow=Color.new(104,104,104)
        pbSetSystemFont(overlay)
        naturename=PBNatures.getName(pokemon.nature)
        itemname=pokemon.item==0 ? _INTL("None") : PBItems.getName(pokemon.item)
        [email protected]
        if @pokemon.name.split('').last=="♂" || @pokemon.name.split('').last=="♀"
          [email protected][0..-2]
        end
        textpos=[
           [_INTL("FAMILY TREE"),26,16,0,base,shadow],
           [pokename,46,62,0,base,shadow],
           [_INTL("Item"),16,320,0,base,shadow],
           [itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
        ]
        textpos.push([_INTL("{1}",pokemon.level),46,92,0,
               Color.new(64,64,64),Color.new(176,176,176)]) if [email protected]?
        if [email protected]?
          if pokemon.gender==0
            textpos.push([_INTL("♂"),178,62,0,
                Color.new(24,112,216),Color.new(136,168,208)])
          elsif pokemon.gender==1
            textpos.push([_INTL("♀"),178,62,0,
                Color.new(248,56,32),Color.new(224,152,144)])
          end
        end    
        base=Color.new(248,248,248)
        shadow=Color.new(104,104,104)
        # Draw parents
        parentsY=[78,234]
        for i in 0...2
          parent = @pokemon.family && @pokemon.family[i] ? @pokemon.family[i] : nil
          iconParentParam = parent ? [parent.species,
              parent.gender==1,false,parent.form,false] : [0,0,false,0,false]
          iconParent=AnimatedBitmap.new(pbCheckPokemonIconFiles(iconParentParam))
          overlay.blt(234,parentsY[i],iconParent.bitmap,Rect.new(0,0,64,64))
          textpos.push([parent ? parent.name : _INTL("???"),
              320,parentsY[i],0,base,shadow])
          parentSpecieName=parent ? PBSpecies.getName(parent.species) : _INTL("???")
          if (parentSpecieName.split('').last=="♂" ||
              parentSpecieName.split('').last=="♀")
            parentSpecieName=parentSpecieName[0..-2]
          end
          textpos.push([parentSpecieName,320,32+parentsY[i],0,base,shadow])
          if parent
            if parent.gender==0
              textpos.push([_INTL("♂"),500,32+parentsY[i],1,
                  Color.new(24,112,216),Color.new(136,168,208)])
            elsif parent.gender==1
              textpos.push([_INTL("♀"),500,32+parentsY[i],1,
                  Color.new(248,56,32),Color.new(224,152,144)])
            end
          end    
          grandX = [380,448]
          for j in 0...2
            iconGrandParam = parent && parent[j] ? [parent[j].species,
                parent[j].gender==1,false,parent[j].form,false] : 
                [0,0,false,0,false]
            iconGrand=AnimatedBitmap.new(pbCheckPokemonIconFiles(iconGrandParam))
            overlay.blt(
                grandX[j],68+parentsY[i],iconGrand.bitmap,Rect.new(0,0,64,64))
          end
        end
        pbDrawTextPositions(overlay,textpos)
        drawMarkings(overlay,15,291,72,20,pokemon.markings)
      end
      
      def handleInputsEgg
        if SHOWFAMILYEGG && @pokemon.isEgg?
          if Input.trigger?(Input::LEFT) && @page==5
            @page=0 
            pbPlayCursorSE()
            dorefresh=true
          end
          if Input.trigger?(Input::RIGHT) && @page==0
            @page=5 
            pbPlayCursorSE()
            dorefresh=true
          end
        end
        if dorefresh
          case @page
            when 0
              drawPageOne(@pokemon)
            when 5
              drawPageSix(@pokemon)
          end
        end
      end
    end
    
    
    class PokemonFamily
      MAXGENERATIONS = 3 # Tree stored generation limit
      
      attr_reader :mother # PokemonFamily object
      attr_reader :father # PokemonFamily object
      
      attr_reader :species
      attr_reader :gender
      attr_reader :form
      attr_reader :name # nickname
      # You can add more data here and on initialize class. Just 
      # don't store the entire pokémon object.
      
      def initialize(pokemon, father=nil,mother=nil)
        initializedAsParent = !father || !mother
        if pokemon.family && pokemon.family.father
          @father = pokemon.family.father
        elsif father 
          @father = PokemonFamily.new(father)
        end
        if pokemon.family && pokemon.family.mother
          @mother = pokemon.family.mother
        elsif mother
          @mother = PokemonFamily.new(mother)
        end
        
        # This data is only initialized as a parent in a cub.
        if initializedAsParent 
          @species=pokemon.species
          @gender=pokemon.gender
          @name=pokemon.name
          @form=pokemon.form
        end
        
        applyGenerationLimit(MAXGENERATIONS)
      end
      
      def applyGenerationLimit(generation)
        if generation>1
          father.applyGenerationLimit(generation-1) if @father
          mother.applyGenerationLimit(generation-1) if @mother
        else
          father=nil
          mother=nil
        end  
      end 
      
      def [](value) # [0] = father, [1] = mother
        if value==0
         return @father
        elsif value==1
         return @mother
        end
        return nil
      end
    end  
      
    class PokeBattle_Pokemon
      attr_accessor :family
    end
    Attached Thumbnails
    familytreescreen.png‎   familytreescreen2.png‎  
    Attached Files
    File Type: zip sampleresources.zip‎ (24.3 KB, 228 views) (Save to Dropbox)
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old November 27th, 2014 (9:20 AM).
    kcgcrazy kcgcrazy is offline
       
      Join Date: Nov 2013
      Location: Canada
      Gender: Male
      Posts: 119
      Quote:
      Originally Posted by FL View Post
      PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
      Code:
      #===============================================================================
      # * Family Tree - by FL (Credits will be apreciated)
      #===============================================================================
      #
      # This script is for Pokémon Essentials. It displays a sixth page at pokémon
      # summary showing a little info about the pokémon mother, father, grandmothers
      # and grandfathers if the pokémon has any.
      #
      #===============================================================================
      #
      # To this script works, put it above main, put a 512x384 background for this
      # screen in "Graphics/Pictures/summary6" and in "Graphics/Pictures/summaryEgg6".
      # This last one is only necessary if SHOWFAMILYEGG is true. You also need to
      # update the below pictures in order to reflect the summary icon change:
      # - summary1
      # - summary2
      # - summary3
      # - summary4
      # - summary4details
      # - summary5
      #
      # -At PokemonDayCare, before line '$Trainer.party[$Trainer.party.length]=egg'
      # add line 'PokemonFamily.new(egg, father, mother)'
      #
      # -At PokemonSummary, change both lines '@page=4 if @page>4'
      # to '@page=5 if @page>5'
      #
      # -Before line 'if Input.trigger?(Input::UP) && @partyindex>0'
      # add line 'handleInputsEgg'
      #
      # -Change line 'if @page!=0' to 'if @page!=0 && !(SHOWFAMILYEGG && @page==5)'
      #
      # -After line 'drawPageFive(@pokemon)' add
      #
      # when 5
      #   drawPageSix(@pokemon)
      #
      #===============================================================================
      
      class PokemonSummaryScene
        SHOWFAMILYEGG = true # when true, family tree is also showed in egg screen.
        
        def drawPageSix(pokemon)
          [email protected]["overlay"].bitmap
          overlay.clear
          @sprites["background"].setBitmap(@pokemon.egg? ? 
              "Graphics/Pictures/summaryEgg6" : "Graphics/Pictures/summary6")
          imagepos=[]
          if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
            status=6 if pbPokerus(pokemon)==1
            [email protected] if @pokemon.status>0
            status=5 if pokemon.hp==0
            imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
          end
          if pokemon.isShiny?
            imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
          end
          if pbPokerus(pokemon)==2
            imagepos.push([
                sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
          end
          [email protected] ? @pokemon.ballused : 0
          ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
          imagepos.push([ballimage,14,60,0,0,-1,-1])
          pbDrawImagePositions(overlay,imagepos)
          base=Color.new(248,248,248)
          shadow=Color.new(104,104,104)
          pbSetSystemFont(overlay)
          naturename=PBNatures.getName(pokemon.nature)
          itemname=pokemon.item==0 ? _INTL("None") : PBItems.getName(pokemon.item)
          [email protected]
          if @pokemon.name.split('').last=="♂" || @pokemon.name.split('').last=="♀"
            [email protected][0..-2]
          end
          textpos=[
             [_INTL("FAMILY TREE"),26,16,0,base,shadow],
             [pokename,46,62,0,base,shadow],
             [_INTL("Item"),16,320,0,base,shadow],
             [itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
          ]
          textpos.push([_INTL("{1}",pokemon.level),46,92,0,
                 Color.new(64,64,64),Color.new(176,176,176)]) if [email protected]?
          if [email protected]?
            if pokemon.gender==0
              textpos.push([_INTL("♂"),178,62,0,
                  Color.new(24,112,216),Color.new(136,168,208)])
            elsif pokemon.gender==1
              textpos.push([_INTL("♀"),178,62,0,
                  Color.new(248,56,32),Color.new(224,152,144)])
            end
          end    
          base=Color.new(248,248,248)
          shadow=Color.new(104,104,104)
          # Draw parents
          parentsY=[78,234]
          for i in 0...2
            parent = @pokemon.family && @pokemon.family[i] ? @pokemon.family[i] : nil
            iconParentParam = parent ? [parent.species,
                parent.gender==1,false,parent.form,false] : [0,0,false,0,false]
            iconParent=AnimatedBitmap.new(pbCheckPokemonIconFiles(iconParentParam))
            overlay.blt(234,parentsY[i],iconParent.bitmap,Rect.new(0,0,64,64))
            textpos.push([parent ? parent.name : _INTL("???"),
                320,parentsY[i],0,base,shadow])
            parentSpecieName=parent ? PBSpecies.getName(parent.species) : _INTL("???")
            if (parentSpecieName.split('').last=="♂" ||
                parentSpecieName.split('').last=="♀")
              parentSpecieName=parentSpecieName[0..-2]
            end
            textpos.push([parentSpecieName,320,32+parentsY[i],0,base,shadow])
            if parent
              if parent.gender==0
                textpos.push([_INTL("♂"),500,32+parentsY[i],1,
                    Color.new(24,112,216),Color.new(136,168,208)])
              elsif parent.gender==1
                textpos.push([_INTL("♀"),500,32+parentsY[i],1,
                    Color.new(248,56,32),Color.new(224,152,144)])
              end
            end    
            grandX = [380,448]
            for j in 0...2
              iconGrandParam = parent && parent[j] ? [parent[j].species,
                  parent[j].gender==1,false,parent[j].form,false] : 
                  [0,0,false,0,false]
              iconGrand=AnimatedBitmap.new(pbCheckPokemonIconFiles(iconGrandParam))
              overlay.blt(
                  grandX[j],68+parentsY[i],iconGrand.bitmap,Rect.new(0,0,64,64))
            end
          end
          pbDrawTextPositions(overlay,textpos)
          drawMarkings(overlay,15,291,72,20,pokemon.markings)
        end
        
        def handleInputsEgg
          if SHOWFAMILYEGG && @pokemon.egg?
            if Input.trigger?(Input::LEFT) && @page==5
              @page=0 
              pbPlayCursorSE()
              dorefresh=true
            end
            if Input.trigger?(Input::RIGHT) && @page==0
              @page=5 
              pbPlayCursorSE()
              dorefresh=true
            end
          end
          if dorefresh
            case @page
              when 0
                drawPageOne(@pokemon)
              when 5
                drawPageSix(@pokemon)
            end
          end
        end
      end
      
      
      class PokemonFamily
        MAXGENERATIONS = 3 # Tree stored generation limit
        
        attr_reader :mother # PokemonFamily object
        attr_reader :father # PokemonFamily object
        
        attr_reader :species
        attr_reader :gender
        attr_reader :form
        attr_reader :name # nickname
        # You can add more data here and on initialize class. Just 
        # don't store the entire pokémon object.
        
        def initialize(pokemon, father=nil,mother=nil)
          initializedAsParent = !father || !mother
          if pokemon.family && pokemon.family.father
            @father = pokemon.family.father
          elsif father 
            @father = PokemonFamily.new(father)
          end
          if pokemon.family && pokemon.family.mother
            @mother = pokemon.family.mother
          elsif mother
            @mother = PokemonFamily.new(mother)
          end
          
          # This data is only initialized as a parent in a cub.
          if initializedAsParent 
            @species=pokemon.species
            @gender=pokemon.gender
            @name=pokemon.name
            @form=pokemon.form
          end
          
          applyGenerationLimit(MAXGENERATIONS)
        end
        
        def applyGenerationLimit(generation)
          if generation>1
            father.applyGenerationLimit(generation-1) if @father
            mother.applyGenerationLimit(generation-1) if @mother
          else
            father=nil
            mother=nil
          end  
        end 
        
        def [](value) # [0] = father, [1] = mother
          if value==0
           return @father
          elsif value==1
           return @mother
          end
          return nil
        end
      end  
        
      class PokeBattle_Pokemon
        attr_accessor :family
      end
      very cool script. I just had to change a few things so this would work with the IV/EV screen.
      Reply With Quote
        #3    
      Old November 27th, 2014 (12:42 PM).
      Snyffus Snyffus is offline
         
        Join Date: Oct 2014
        Posts: 13
        Looks like I failed implementing the script. I copied all by Show Printable Version and implemented the textblocks at the different sections in essentials. But even if I get an Egg (which should have parents :) )there are only question marks instead of pictures and infos about parents.
        Reply With Quote
          #4    
        Old November 27th, 2014 (3:10 PM).
        kcgcrazy kcgcrazy is offline
           
          Join Date: Nov 2013
          Location: Canada
          Gender: Male
          Posts: 119
          Quote:
          Originally Posted by Snyffus View Post
          Looks like I failed implementing the script. I copied all by Show Printable Version and implemented the textblocks at the different sections in essentials. But even if I get an Egg (which should have parents :) )there are only question marks instead of pictures and infos about parents.
          this happens to me as well
          Reply With Quote
            #5    
          Old November 28th, 2014 (6:47 AM).
          venom12's Avatar
          venom12 venom12 is offline
          Pokemon Crystal Rain Relased
             
            Join Date: Sep 2006
            Age: 27
            Gender: Male
            Nature: Adamant
            Posts: 529
            Great script dude! I like it and will use it for sure in CR HD haha thank you.
            Reply With Quote
              #6    
            Old November 28th, 2014 (8:43 AM).
            kcgcrazy kcgcrazy is offline
               
              Join Date: Nov 2013
              Location: Canada
              Gender: Male
              Posts: 119
              Quote:
              Originally Posted by venom12 View Post
              Great script dude! I like it and will use it for sure in CR HD haha thank you.
              does it work for you, it wont actually show the parents of the pokemon, just the ???
              Reply With Quote
                #7    
              Old November 28th, 2014 (9:36 AM).
              Snyffus Snyffus is offline
                 
                Join Date: Oct 2014
                Posts: 13
                Quote:
                Originally Posted by kcgcrazy View Post
                does it work for you, it wont actually show the parents of the pokemon, just the ???
                Seems that we are the only two with that problem :(
                Reply With Quote
                  #8    
                Old November 29th, 2014 (3:03 AM).
                FL's Avatar
                FL FL is offline
                Pokémon Island Creator
                   
                  Join Date: Sep 2010
                  Gender: Male
                  Posts: 1,725
                  Quote:
                  Originally Posted by Snyffus View Post
                  Looks like I failed implementing the script. I copied all by Show Printable Version and implemented the textblocks at the different sections in essentials. But even if I get an Egg (which should have parents :) )there are only question marks instead of pictures and infos about parents.
                  Sorry, my mistake. It's 'egg.family = PokemonFamily.new(egg, father, mother)' instead of 'PokemonFamily.new(egg, father, mother)'. I updated the thread.
                  __________________
                  Reply With Quote
                    #9    
                  Old November 29th, 2014 (3:24 AM).
                  Snyffus Snyffus is offline
                     
                    Join Date: Oct 2014
                    Posts: 13
                    Quote:
                    Originally Posted by FL View Post
                    Sorry, my mistake. It's 'egg.family = PokemonFamily.new(egg, father, mother)' instead of 'PokemonFamily.new(egg, father, mother)'. I updated the thread.
                    Thank You very much, now it works perfectly. I wish i could see such things on my own :(
                    Reply With Quote
                      #10    
                    Old December 9th, 2014 (5:21 PM).
                    LilaTraube's Avatar
                    LilaTraube LilaTraube is offline
                       
                      Join Date: Jul 2014
                      Location: Germany
                      Age: 20
                      Gender: Male
                      Nature: Relaxed
                      Posts: 30
                      i get this here:

                      http: //i.gyazo.com/5d90b4df88f4f1933d3e249ae0e212b8.png

                      what i have done wrong? :(
                      Reply With Quote
                        #11    
                      Old December 13th, 2014 (3:07 AM).
                      FL's Avatar
                      FL FL is offline
                      Pokémon Island Creator
                         
                        Join Date: Sep 2010
                        Gender: Male
                        Posts: 1,725
                        Quote:
                        Originally Posted by LilaTraube View Post
                        i get this here:

                        http: //i.gyazo.com/5d90b4df88f4f1933d3e249ae0e212b8.png

                        what i have done wrong? :(
                        This script won't displays the family of pokémon that hatched before this script was added. Make a test: Put two compatibles pokémon at Day Care, generate an egg (I suggest using debug options) and check the egg family.
                        __________________
                        Reply With Quote
                          #12    
                        Old December 13th, 2014 (4:35 AM).
                        LilaTraube's Avatar
                        LilaTraube LilaTraube is offline
                           
                          Join Date: Jul 2014
                          Location: Germany
                          Age: 20
                          Gender: Male
                          Nature: Relaxed
                          Posts: 30
                          it works!

                          thanks FL :)
                          Reply With Quote
                            #13    
                          Old December 13th, 2014 (7:08 AM).
                          ~Angel~'s Avatar
                          ~Angel~ ~Angel~ is offline
                          Lead developer for Pokémon Millennium
                             
                            Join Date: Mar 2010
                            Location: United States Of America.
                            Age: 20
                            Gender: Male
                            Nature: Quiet
                            Posts: 287
                            I just thought I'd tell you FL, since this is yours after all that I'm gonna use this as well, I came up with a small additional mock-up/creation of what it'll look like, probably don't have it correct right now, but it'll be modified. Anyway, I reused some of the old information provided to make this mock-up, it can be located here: http://fohlenetech.deviantart.com/art/Pokemon-Millennium-Egg-Summary-Family-Tree-499988323?ga_submit_new=10%253A1418483169
                            Keep up the good work!
                            Reply With Quote
                              #14    
                            Old February 25th, 2015 (10:11 AM).
                            Hydro_ Hydro_ is offline
                               
                              Join Date: Feb 2015
                              Gender: Male
                              Posts: 1
                              It doesn't work, there are a lot of "Syntax Error", how to fix it? (v14)
                              Reply With Quote
                                #15    
                              Old February 25th, 2015 (12:17 PM).
                              mej71's Avatar
                              mej71 mej71 is offline
                                 
                                Join Date: Mar 2014
                                Location: Omnipresence
                                Gender: Male
                                Posts: 1,226
                                Quote:
                                Originally Posted by Hydro_ View Post
                                It doesn't work, there are a lot of "Syntax Error", how to fix it? (v14)
                                You could try reading the post :)

                                Quote:
                                Originally Posted by FL
                                PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
                                Reply With Quote
                                  #16    
                                Old February 26th, 2015 (6:34 AM).
                                FL's Avatar
                                FL FL is offline
                                Pokémon Island Creator
                                   
                                  Join Date: Sep 2010
                                  Gender: Male
                                  Posts: 1,725
                                  Quote:
                                  Originally Posted by voymike View Post
                                  It gives me error on handleInputsEgg. What did I do wrong?
                                  Edit: Ok I fixed it and now I feel stupid. You just need to add the symbol @ for it to work (@handleInputsEgg). ������
                                  What? @handleInputsEgg doesn't make sense.
                                  __________________
                                  Reply With Quote
                                    #17    
                                  Old February 27th, 2015 (6:44 AM).
                                  kcgcrazy kcgcrazy is offline
                                     
                                    Join Date: Nov 2013
                                    Location: Canada
                                    Gender: Male
                                    Posts: 119
                                    Quote:
                                    Originally Posted by voymike View Post
                                    Excuse me lord FL, I have very little coding knowledge and I pretty much messed up my entire RMXP project trying to make this work. I have managed to actually start my game without error message and access the family tree panel but there are only??? pokemons and also when I press up/down button to move between my Pokemon, it gives me an error and then shuts down.
                                    first, before making script changes always make a backup of your game in case you mess things up, second the ??? is probably because you have not started a new game or did something wrong, try starting a new game and then use the daycare, and third when getting errors copy and paste them so people can see the error, theres nothing someone can do to help if they cant see the error.
                                    Reply With Quote
                                      #18    
                                    Old February 27th, 2015 (7:39 PM).
                                    kcgcrazy kcgcrazy is offline
                                       
                                      Join Date: Nov 2013
                                      Location: Canada
                                      Gender: Male
                                      Posts: 119
                                      Quote:
                                      Originally Posted by voymike View Post
                                      Ok thanks for the advice kcgcrazy, from now on I will be always making a backup file. Also I kinda figured a couple of things and now I finally got it to work. I guess every experiment is meant to fail at first until it actually comes to life :p ALL HAIL FL
                                      trial and error, trial and error
                                      Reply With Quote
                                        #19    
                                      Old March 1st, 2015 (3:18 AM).
                                      FL's Avatar
                                      FL FL is offline
                                      Pokémon Island Creator
                                         
                                        Join Date: Sep 2010
                                        Gender: Male
                                        Posts: 1,725
                                        Quote:
                                        Originally Posted by voymike View Post
                                        Excuse me lord FL, I have very little coding knowledge and I pretty much messed up my entire RMXP project trying to make this work. I have managed to actually start my game without error message and access the family tree panel but there are only??? pokemons and also when I press up/down button to move between my Pokemon, it gives me an error and then shuts down.
                                        I my opinion this isn't necessary, since all steps are described here, you can just reverse all steps for fixing the possible problem.

                                        And the new game isn't necessary, but this script only affects new eggs generated on Day Care.
                                        __________________
                                        Reply With Quote
                                          #20    
                                        Old April 27th, 2015 (6:04 PM).
                                        Lucidious89 Lucidious89 is online now
                                           
                                          Join Date: Apr 2014
                                          Gender: Male
                                          Posts: 173
                                          Man, I really love this script, thanks a lot! I've been tinkering with it and made some graphics to go with my Summary page layouts, and I really like the results. I still have to tweak them, but it's coming along.

                                          However, I do have a couple of questions in case you have any quick ideas for some solutions.

                                          1) Is it possible for this to display the icons for shiny Pokemon, if any of the parents/grandparents were shiny? I tested it, and it just shows the regular icon even if I made one of them shiny prior to breeding. It's just a small detail, but I would love it if there was a way to implement that. Other forms still display (Such as Rotom's forms), so I was wondering if this would be a simple thing to add.

                                          2) When breeding with Ditto, is there some way to make it so Ditto always takes the 'role' of the gender opposite it's partner (in terms of how it's displayed on the page)? I ask this because of my attached screenshot.

                                          You'll notice that Gardevoir's grandfather on her father's side is a Jellicent (named Majellyn here). It's a male Jellicent. However, since I bred it with a Ditto, the Ditto by default assumes the 'role' of the male (I assume?), and thus the male Jellicent now displays as a female Jellicent; despite sitting in the slot designated for the male parent. Or something like that. It's just an odd visual quirk that is slightly annoying given my layout, and if there is an easy way to resolve this, that would be great (though something tells me it's more trouble than its worth).

                                          3) This question isn't really specific to this script, but I was wondering if there was a way to resize certain icon sprites on the page? I just want to shrink the grandparent's sprites down so they're smaller than the parent's sprites. I assume i have to use zoom=0.5 or something like that, I'm just not sure how to implement it.
                                          Attached Thumbnails
                                          capture000.jpg‎  
                                          Reply With Quote
                                            #21    
                                          Old April 30th, 2015 (6:06 AM).
                                          akane159 akane159 is offline
                                             
                                            Join Date: Oct 2012
                                            Gender: Female
                                            Posts: 72
                                            i have this error :S , i cant run my game
                                            Spoiler:


                                            and if i erase this line
                                            Spoiler:



                                            i have this error when i wan to see the family tree
                                            Spoiler:


                                            you can help me TT_TT please
                                            Reply With Quote
                                              #22    
                                            Old May 1st, 2015 (7:20 AM).
                                            FL's Avatar
                                            FL FL is offline
                                            Pokémon Island Creator
                                               
                                              Join Date: Sep 2010
                                              Gender: Male
                                              Posts: 1,725
                                              Quote:
                                              Originally Posted by Lucidious89 View Post
                                              Man, I really love this script, thanks a lot! I've been tinkering with it and made some graphics to go with my Summary page layouts, and I really like the results. I still have to tweak them, but it's coming along.

                                              However, I do have a couple of questions in case you have any quick ideas for some solutions.

                                              1) Is it possible for this to display the icons for shiny Pokemon, if any of the parents/grandparents were shiny? I tested it, and it just shows the regular icon even if I made one of them shiny prior to breeding. It's just a small detail, but I would love it if there was a way to implement that. Other forms still display (Such as Rotom's forms), so I was wondering if this would be a simple thing to add.

                                              2) When breeding with Ditto, is there some way to make it so Ditto always takes the 'role' of the gender opposite it's partner (in terms of how it's displayed on the page)? I ask this because of my attached screenshot.

                                              You'll notice that Gardevoir's grandfather on her father's side is a Jellicent (named Majellyn here). It's a male Jellicent. However, since I bred it with a Ditto, the Ditto by default assumes the 'role' of the male (I assume?), and thus the male Jellicent now displays as a female Jellicent; despite sitting in the slot designated for the male parent. Or something like that. It's just an odd visual quirk that is slightly annoying given my layout, and if there is an easy way to resolve this, that would be great (though something tells me it's more trouble than its worth).

                                              3) This question isn't really specific to this script, but I was wondering if there was a way to resize certain icon sprites on the page? I just want to shrink the grandparent's sprites down so they're smaller than the parent's sprites. I assume i have to use zoom=0.5 or something like that, I'm just not sure how to implement it.
                                              1. Yes! After line 'attr_reader :form' add 'attr_reader :shiny'. After line '@form=pokemon.form' add '@shiny=pokemon.isShiny?'. Change

                                              Code:
                                              	iconParentParam = parent ? [parent.species,
                                                        parent.gender==1,false,parent.form,false] : [0,0,false,0,false]'
                                              Into
                                              Code:
                                              	iconParentParam = parent ? [parent.species,
                                                        parent.gender==1,parent.shiny,parent.form,false] : [0,0,false,0,false]'
                                              Change

                                              Code:
                                                      iconGrandParam = parent && parent[j] ? [parent[j].species,
                                                          parent[j].gender==1,false,parent[j].form,false] : 
                                                          [0,0,false,0,false]
                                              Into

                                              Code:
                                                      iconGrandParam = parent && parent[j] ? [parent[j].species,
                                                          parent[j].gender==1,parent.shiny,parent[j].form,false] : 
                                                          [0,0,false,0,false]
                                              2. Before line 'applyGenerationLimit(MAXGENERATIONS)' add

                                              Code:
                                               
                                                  # switch the parent position in Ditto case.
                                                  if @mother && @mother.gender==0 # male
                                                    temporary = @mother
                                                    @mother = @father
                                                    @father = temporary
                                                  end
                                                  if @father && @father.gender==1 # female
                                                    temporary = @mother
                                                    @mother = @father
                                                    @father = temporary
                                                  end
                                              3. The sprite class has the variables zoom_x and zoom_y, so you only need to make it as zoom_x=0.5 and you have a half zoom. However, the icons are drawed by an AnimatedBitmap class that consist of several BitmapWrapper, a class that extends from Bitmap, so none have the zoom property. But we can use stretch_blt when copying the bitmap. Change:

                                              Code:
                                                       overlay.blt(
                                                          grandX[j],68+parentsY[i],iconGrand.bitmap,Rect.new(0,0,64,64))
                                              Into

                                              Code:
                                               
                                                      overlay.stretch_blt(Rect.new(grandX[j],68+parentsY[i],32,32),
                                                         iconGrand.bitmap,Rect.new(0,0,64,64))
                                              Quote:
                                              Originally Posted by akane159 View Post
                                              i have this error :S , i cant run my game
                                              Spoiler:


                                              and if i erase this line
                                              Spoiler:



                                              i have this error when i wan to see the family tree
                                              Spoiler:


                                              you can help me TT_TT please
                                              Quote:
                                              Originally Posted by FL View Post
                                              PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
                                              __________________
                                              Reply With Quote
                                                #23    
                                              Old May 1st, 2015 (7:56 AM).
                                              akane159 akane159 is offline
                                                 
                                                Join Date: Oct 2012
                                                Gender: Female
                                                Posts: 72
                                                thnx, it work :D!
                                                Spoiler:
                                                Reply With Quote
                                                  #24    
                                                Old May 1st, 2015 (11:52 AM).
                                                Lucidious89 Lucidious89 is online now
                                                   
                                                  Join Date: Apr 2014
                                                  Gender: Male
                                                  Posts: 173
                                                  Nice! Thanks a lot, everything works exactly how I want now! It's really starting to come together.

                                                  One last thing though, if you don't mind...

                                                  I'm thinking it would be cool if you could display the Pokemon's Egg Groups on this page, since it's relevant information to go along with this. I've been trying to figure out how to implement this (I made a thread asking for help in the Essentials forum, but I'm not expecting a response anytime soon).

                                                  By working off existing scripts that I've found, this is what I've come up with so far:

                                                  Code:
                                                   dexdata=pbOpenDexData
                                                      pbDexDataOffset(dexdata,@pokemon,31)
                                                      compat10=dexdata.fgetb
                                                      compat11=dexdata.fgetb
                                                      eggGroupArray=[
                                                          nil,_INTL("Monster"),_INTL("Water1"),_INTL("Bug"),_INTL("Flying"),
                                                          _INTL("Ground"),_INTL("Fairy"),_INTL("Plant"),_INTL("Humanshape"),
                                                          _INTL("Water3"),_INTL("Mineral"),_INTL("Indeterminate"),
                                                          _INTL("Water2"),_INTL("Ditto"),_INTL("Dragon"),_INTL("No Eggs")
                                                      ]
                                                      eggGroups = compat10==compat11 ? eggGroupArray[compat10] : 
                                                          _INTL("{1}, {2}",eggGroupArray[compat10],eggGroupArray[compat11])
                                                      textpos=[
                                                         [_INTL("Group: {1}",eggGroups),200,354,0,base,shadow],
                                                      ]
                                                     dexdata.close
                                                  But I'm not sure how to implement it, or if I'm even on the right track. I'd appreciate it if you could point me in the right direction!

                                                  The attached screenshot is just to show where I'm thinking I could display the information (also showing off all your fixes!)
                                                  Attached Thumbnails
                                                  capture014.jpg‎  
                                                  Reply With Quote
                                                    #25    
                                                  Old May 8th, 2015 (2:39 PM).
                                                  FL's Avatar
                                                  FL FL is offline
                                                  Pokémon Island Creator
                                                     
                                                    Join Date: Sep 2010
                                                    Gender: Male
                                                    Posts: 1,725
                                                    Quote:
                                                    Originally Posted by Lucidious89 View Post
                                                    Nice! Thanks a lot, everything works exactly how I want now! It's really starting to come together.

                                                    One last thing though, if you don't mind...

                                                    I'm thinking it would be cool if you could display the Pokemon's Egg Groups on this page, since it's relevant information to go along with this. I've been trying to figure out how to implement this (I made a thread asking for help in the Essentials forum, but I'm not expecting a response anytime soon).

                                                    By working off existing scripts that I've found, this is what I've come up with so far:

                                                    Code:
                                                     dexdata=pbOpenDexData
                                                        pbDexDataOffset(dexdata,@pokemon,31)
                                                        compat10=dexdata.fgetb
                                                        compat11=dexdata.fgetb
                                                        eggGroupArray=[
                                                            nil,_INTL("Monster"),_INTL("Water1"),_INTL("Bug"),_INTL("Flying"),
                                                            _INTL("Ground"),_INTL("Fairy"),_INTL("Plant"),_INTL("Humanshape"),
                                                            _INTL("Water3"),_INTL("Mineral"),_INTL("Indeterminate"),
                                                            _INTL("Water2"),_INTL("Ditto"),_INTL("Dragon"),_INTL("No Eggs")
                                                        ]
                                                        eggGroups = compat10==compat11 ? eggGroupArray[compat10] : 
                                                            _INTL("{1}, {2}",eggGroupArray[compat10],eggGroupArray[compat11])
                                                        textpos=[
                                                           [_INTL("Group: {1}",eggGroups),200,354,0,base,shadow],
                                                        ]
                                                       dexdata.close
                                                    But I'm not sure how to implement it, or if I'm even on the right track. I'd appreciate it if you could point me in the right direction!

                                                    The attached screenshot is just to show where I'm thinking I could display the information (also showing off all your fixes!)
                                                    I guess that you biggest problem is that pbDexDataOffset second paramether must be the Pokémon index number (species) and you are passing a PokeBattle_Pokemon instance.

                                                    Add this def on your script.

                                                    Code:
                                                      def getEggGroupString(species)
                                                      dexdata=pbOpenDexData
                                                      pbDexDataOffset(dexdata,species,31)
                                                      compat10=dexdata.fgetb
                                                      compat11=dexdata.fgetb
                                                      eggGroupArray=[
                                                          nil,_INTL("Monster"),_INTL("Water1"),_INTL("Bug"),_INTL("Flying"),
                                                          _INTL("Ground"),_INTL("Fairy"),_INTL("Plant"),_INTL("Humanshape"),
                                                          _INTL("Water3"),_INTL("Mineral"),_INTL("Indeterminate"),
                                                          _INTL("Water2"),_INTL("Ditto"),_INTL("Dragon"),_INTL("No Eggs")
                                                      ]
                                                      ret = compat10==compat11 ? eggGroupArray[compat10] : 
                                                          _INTL("{1}, {2}",eggGroupArray[compat10],eggGroupArray[compat11])
                                                      dexdata.close
                                                      return ret
                                                    end
                                                    So, if you call 'getEggGroupString(parent[j].species)' (on the right spot where 'parent' and 'j' exist, of course), this will return you the Egg Group formatted.
                                                    __________________
                                                    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 10:23 AM.