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.

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old September 12th, 2012 (12:00 AM).
BlackWaltz3's Avatar
BlackWaltz3 BlackWaltz3 is offline
     
    Join Date: Jul 2009
    Gender: Male
    Posts: 188
    Hey guys,
    I've been working on a starter selection screen for my game, and for the most part I have it working, with all the accompanying graphics and whatnot. Granted it's not the fanciest looking thing, but it does its job well enough. I just have a few things I need to address in order to continue working on it.

    First up: at present, I've been hardcoding the starter Pokemon and their respective data, images etc into the script. I know I should really be using the @pokemon thing, and getting the names, types and number out of that, but I don't understand how it works, and I couldn't find like a def thing that describes how it operates or how to set it to a particular Pokemon. Oh, and at the completion of the screen, it should add the selected Pokemon to the party. Would someone please elaborate upon this function?

    Secondly, I have some questions about message and choice windows. I was wondering if it was possible to display a smaller window, one line high, at the bottom of the screen, and containing text defined in the script. In addition, this window should have attached a choice window thingy with the yes and no thing, ensuring it aligns with the newer sized window. I've included an attachment to illustrate what I mean.

    In addition, I've also included my current code. It's a bit messy, unfinished, and will be cleaned up in due time. Here it is:
    Spoiler:
    Code:
    #==============================================================================#
    # This is a script to display and handle a starter selection scene. It         #
    # displays three Pokeballs, their corresponding Pokemon, and their basic data. #
    # The player may use the arrow keys to select a Pokemon, and the C input to    #
    # confirm their selection.                                                     #
    #==============================================================================#
    # Copyright Aaron J Richards, not to be used with the exception of testing for 
    answers to my questions                     #
    #==============================================================================#
    
    
    
    class PokemonStarterSelectionScene
      def update
        pbUpdateSpriteHash(@sprites)
      end
      
      def pbStartScene
        @sprites={}
        @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
        @viewport.z=99999
        addBackgroundPlane(@sprites,"bg","starterbg",@viewport)
        @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
        pbSetSystemFont(@sprites["overlay"].bitmap)
        pbDrawStarterSelection
        pbFadeInAndShow(@sprites) { update }
      end
      
      def pbDrawStarterSelection
        [email protected]["overlay"].bitmap
        overlay.clear
        shadowColor=Color.new(72,72,72)
        baseColor=Color.new(185,185,185)
        textPositions=[]
        textPositions.push([_INTL("Which Pokémon would you like?"),108,330,0,
                           baseColor,shadowColor])
        textPositions.push([_INTL("WWWWWWWWWW"),35,240,0,
                           baseColor,shadowColor])
        textPositions.push([_INTL("Electric"),477,204,1,
                           baseColor,shadowColor])
        textPositions.push([_INTL("Fighting"),477,240,1,
                           baseColor,shadowColor])
        textPositions.push([_INTL("Type"),477,276,1,
                           baseColor,shadowColor])
        #textPositions.push([pokename,35,220,0,
        #                   baseColor,shadowColor])
        #textPositions.push([_INTL("{1} Type",@pokemon.type1),477,220,1,
        #                   baseColor,shadowColor])
        pbDrawTextPositions(overlay,textPositions)
        
        imagePositions=[]
        imagePositions.push(["Graphics/Pictures/StarterBallShadow",9,105,0,0,-1,-1])
        imagePositions.push(["Graphics/Pictures/StarterBall",25,25,0,0,-1,-1])
        imagePositions.push(["Graphics/Pictures/StarterBallShadow",178,105,0,0,-1,-1])
        imagePositions.push(["Graphics/Pictures/StarterBall",194,25,0,0,-1,-1])
        imagePositions.push(["Graphics/Pictures/StarterBallShadow",347,105,0,0,-1,-1])
        imagePositions.push(["Graphics/Pictures/StarterBall",363,25,0,0,-1,-1])
        if $game_variables[26]==1
          imagePositions.push(["Graphics/Pictures/StarterSelector",25,25,0,0,-1,-1])
          imagePositions.push(["Graphics/Battlers/252",176,165,0,0,-1,-1])
        elsif $game_variables[26]==2
          imagePositions.push(["Graphics/Pictures/StarterSelector",194,25,0,0,-1,-1])
          imagePositions.push(["Graphics/Battlers/255",176,165,0,0,-1,-1])
        elsif $game_variables[26]==3
          imagePositions.push(["Graphics/Pictures/StarterSelector",363,25,0,0,-1,-1])
          imagePositions.push(["Graphics/Battlers/258",176,165,0,0,-1,-1])
        end
        pbDrawImagePositions(overlay,imagePositions)
      end
      
      def pbStarterSelection
        loop do
          Graphics.update
          Input.update
          self.update
          if Input.trigger?(Input::LEFT)
            $game_variables[26]-=1
            if $game_variables[26]<1
              $game_variables[26]+=3
            end            
            pbPlayCursorSE()
            pbDrawStarterSelection
          elsif Input.trigger?(Input::RIGHT) 
            $game_variables[26]+=1
            if $game_variables[26]>3
              $game_variables[26]-=3
            end
            pbPlayCursorSE()
            pbDrawStarterSelection
          elsif Input.trigger?(Input::C)
            if $game_variables[26]==1
              #Sure?
              break
            elsif $game_variables[26]==2
              #Sure?
              break
            elsif $game_variables[26]==3
              #Sure?
              break
            end
          end       
        end 
      end
      
      def pbEndScene
        pbFadeOutAndHide(@sprites) { update }
        pbDisposeSpriteHash(@sprites)
        @viewport.dispose
      end
    end
    
    class PokemonStarterSelection
      def initialize(scene)
        @scene=scene
      end
    
      def pbStartScreen
        @scene.pbStartScene
        @scene.pbStarterSelection
        @scene.pbEndScene
      end
    end
      
    def pbShowStarterSelection
      pbFadeOutIn(99999) {
         scene=PokemonStarterSelectionScene.new
         screen=PokemonStarterSelection.new(scene)
         screen.pbStartScreen
      }
    end

    I also intend on somehow adding parameters to the script call such that the user can define their own starters without having to modify the code, but I'll get to that one I have to regular script working. Thanks in advance for any help, guys.
    Cheers, Jim
    Attached Thumbnails
    demonstration.png‎  
    Reply With Quote

    Relevant Advertising!

      #2    
    Old September 13th, 2012 (12:59 PM).
    IceGod64's Avatar
    IceGod64 IceGod64 is offline
    In the Lost & Found bin!
       
      Join Date: Oct 2008
      Location: Castelia City
      Age: 29
      Gender: Male
      Nature: Naive
      Posts: 623
      Quote:
      Originally Posted by jim42 View Post
      Hey guys,
      I've been working on a starter selection screen for my game, and for the most part I have it working, with all the accompanying graphics and whatnot. Granted it's not the fanciest looking thing, but it does its job well enough. I just have a few things I need to address in order to continue working on it.

      First up: at present, I've been hardcoding the starter Pokemon and their respective data, images etc into the script. I know I should really be using the @pokemon thing, and getting the names, types and number out of that, but I don't understand how it works, and I couldn't find like a def thing that describes how it operates or how to set it to a particular Pokemon. Oh, and at the completion of the screen, it should add the selected Pokemon to the party. Would someone please elaborate upon this function?

      Secondly, I have some questions about message and choice windows. I was wondering if it was possible to display a smaller window, one line high, at the bottom of the screen, and containing text defined in the script. In addition, this window should have attached a choice window thingy with the yes and no thing, ensuring it aligns with the newer sized window. I've included an attachment to illustrate what I mean.

      In addition, I've also included my current code. It's a bit messy, unfinished, and will be cleaned up in due time. Here it is:
      Spoiler:
      Code:
      #==============================================================================#
      # This is a script to display and handle a starter selection scene. It         #
      # displays three Pokeballs, their corresponding Pokemon, and their basic data. #
      # The player may use the arrow keys to select a Pokemon, and the C input to    #
      # confirm their selection.                                                     #
      #==============================================================================#
      # Copyright Aaron J Richards, not to be used with the exception of testing for 
      answers to my questions                     #
      #==============================================================================#
      
      
      
      class PokemonStarterSelectionScene
        def update
          pbUpdateSpriteHash(@sprites)
        end
        
        def pbStartScene
          @sprites={}
          @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
          @viewport.z=99999
          addBackgroundPlane(@sprites,"bg","starterbg",@viewport)
          @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
          pbSetSystemFont(@sprites["overlay"].bitmap)
          pbDrawStarterSelection
          pbFadeInAndShow(@sprites) { update }
        end
        
        def pbDrawStarterSelection
          [email protected]["overlay"].bitmap
          overlay.clear
          shadowColor=Color.new(72,72,72)
          baseColor=Color.new(185,185,185)
          textPositions=[]
          textPositions.push([_INTL("Which Pokémon would you like?"),108,330,0,
                             baseColor,shadowColor])
          textPositions.push([_INTL("WWWWWWWWWW"),35,240,0,
                             baseColor,shadowColor])
          textPositions.push([_INTL("Electric"),477,204,1,
                             baseColor,shadowColor])
          textPositions.push([_INTL("Fighting"),477,240,1,
                             baseColor,shadowColor])
          textPositions.push([_INTL("Type"),477,276,1,
                             baseColor,shadowColor])
          #textPositions.push([pokename,35,220,0,
          #                   baseColor,shadowColor])
          #textPositions.push([_INTL("{1} Type",@pokemon.type1),477,220,1,
          #                   baseColor,shadowColor])
          pbDrawTextPositions(overlay,textPositions)
          
          imagePositions=[]
          imagePositions.push(["Graphics/Pictures/StarterBallShadow",9,105,0,0,-1,-1])
          imagePositions.push(["Graphics/Pictures/StarterBall",25,25,0,0,-1,-1])
          imagePositions.push(["Graphics/Pictures/StarterBallShadow",178,105,0,0,-1,-1])
          imagePositions.push(["Graphics/Pictures/StarterBall",194,25,0,0,-1,-1])
          imagePositions.push(["Graphics/Pictures/StarterBallShadow",347,105,0,0,-1,-1])
          imagePositions.push(["Graphics/Pictures/StarterBall",363,25,0,0,-1,-1])
          if $game_variables[26]==1
            imagePositions.push(["Graphics/Pictures/StarterSelector",25,25,0,0,-1,-1])
            imagePositions.push(["Graphics/Battlers/252",176,165,0,0,-1,-1])
          elsif $game_variables[26]==2
            imagePositions.push(["Graphics/Pictures/StarterSelector",194,25,0,0,-1,-1])
            imagePositions.push(["Graphics/Battlers/255",176,165,0,0,-1,-1])
          elsif $game_variables[26]==3
            imagePositions.push(["Graphics/Pictures/StarterSelector",363,25,0,0,-1,-1])
            imagePositions.push(["Graphics/Battlers/258",176,165,0,0,-1,-1])
          end
          pbDrawImagePositions(overlay,imagePositions)
        end
        
        def pbStarterSelection
          loop do
            Graphics.update
            Input.update
            self.update
            if Input.trigger?(Input::LEFT)
              $game_variables[26]-=1
              if $game_variables[26]<1
                $game_variables[26]+=3
              end            
              pbPlayCursorSE()
              pbDrawStarterSelection
            elsif Input.trigger?(Input::RIGHT) 
              $game_variables[26]+=1
              if $game_variables[26]>3
                $game_variables[26]-=3
              end
              pbPlayCursorSE()
              pbDrawStarterSelection
            elsif Input.trigger?(Input::C)
              if $game_variables[26]==1
                #Sure?
                break
              elsif $game_variables[26]==2
                #Sure?
                break
              elsif $game_variables[26]==3
                #Sure?
                break
              end
            end       
          end 
        end
        
        def pbEndScene
          pbFadeOutAndHide(@sprites) { update }
          pbDisposeSpriteHash(@sprites)
          @viewport.dispose
        end
      end
      
      class PokemonStarterSelection
        def initialize(scene)
          @scene=scene
        end
      
        def pbStartScreen
          @scene.pbStartScene
          @scene.pbStarterSelection
          @scene.pbEndScene
        end
      end
        
      def pbShowStarterSelection
        pbFadeOutIn(99999) {
           scene=PokemonStarterSelectionScene.new
           screen=PokemonStarterSelection.new(scene)
           screen.pbStartScreen
        }
      end

      I also intend on somehow adding parameters to the script call such that the user can define their own starters without having to modify the code, but I'll get to that one I have to regular script working. Thanks in advance for any help, guys.
      Cheers, Jim
      Here's an example of properly creating a Pokemon with a script:

      Code:
      def pbCreatePoke
        poke=PokeBattle_Pokemon.new(PBSpecies::EEVEE,25,$Trainer)
        poke.abilityflag = 2
        poke.happiness=160
        poke.item = PBItems::ORANBERRY
        poke.obtainLevel = 5
        poke.natureflag =  12
        pbAddToParty(poke)
      end
      This is in the general ballpark of what kind of stuff you might want to do in terms of actually giving the Pokémon.

      As for double checking is that's what the player wants, try something like:

      Code:
      if pbDisplayConfirm(_INTL("is this the Pokémon you want?"))
       pbCreatePoke
       $scene = Scene_Map.new
       return
      else
       end
      You might need to copy the def pbDisplayConfirm from another script (I think it's in PokemonSave)but that should do what you want.
      __________________

      Reply With Quote
        #3    
      Old September 14th, 2012 (5:16 AM).
      BlackWaltz3's Avatar
      BlackWaltz3 BlackWaltz3 is offline
         
        Join Date: Jul 2009
        Gender: Male
        Posts: 188
        Thanks for the assistance, IceGod. I modified the add Pokemon script a bit and added it in the Input::C section, where it belongs, along with the confirmation message. Speaking of which, I didn't have to copy any scripts, I just had to use "Kernel.ConfirmMessage(blahblahblah)".

        However, what you suggested only half answers my questions. I still have to hardcode the Pokemon data, and I still need to know how to display a smaller message window (assuming you can. I suspect one would). Thanks for what you did contribute, at least. Now the script actually adds Pokemon. :D
        Cheers, Jim.
        Reply With Quote
          #4    
        Old September 16th, 2012 (9:55 AM).
        FL's Avatar
        FL FL is offline
        Pokémon Island Creator
           
          Join Date: Sep 2010
          Gender: Male
          Posts: 1,711
          To displays the message use:

          Code:
              @sprites["msgwindow"]=Kernel.pbCreateMessageWindow(@viewport)
              Kernel.pbMessageDisplay(@sprites["msgwindow"],
                  _INTL("Insert the text here"))
          I suggest you to use '@starterchoice' rather than '$game_variables[26]'. Just put '@starterchoice=0' when the scene is starting. Also, take a look in http://pokemonessentials.wikia.com/wiki/Tutorialhow_species_introdution
          __________________
          Reply With Quote
            #5    
          Old July 17th, 2013 (6:33 AM).
          BlackWaltz3's Avatar
          BlackWaltz3 BlackWaltz3 is offline
             
            Join Date: Jul 2009
            Gender: Male
            Posts: 188
            Okay so this is a huge necropost. Sorry if that's a problem. I've gone back to my Starter Selection screen, and rewritten it from the ground up in order to be able to accept parameters such that it can be initialised with any three Pokémon as specified in the method call.

            What I've built seems more or less structurally sound, but I've come to realise the variables passed into the method call have no way of reaching their target destinations. The code compiles, but throws an exception when called due to the "missing" variable values.

            As far as I've seen, the only self-contained way I can pass those variables all the way down to the required code is to pass them through each and every method along the way. It's pretty safe to say that with several variables this becomes quite lengthy and unpleasant to read. Is there an easier way by which I might pass these variables though to their intended code?

            I've included the code below for your convenience.

            [SPOILER][CODE]#==============================================================================#
            # Pokémon Starter Selection module Version 1.1
            #==============================================================================#
            # This is a script to display and handle a basic starter selection scene. It #
            # displays three Pokeballs, their corresponding Pokemon, and their basic data. #
            # The player may use the arrow keys to select a Pokemon, and the C input to #
            # confirm their selection. #
            # #
            # The method can be called by using a script command in an event containing #
            # the string, "pbShowStarterSelection(, , , )", where , and #
            # are the species one wishes to display as starters, and where
            Reply With Quote
              #6    
            Old July 21st, 2013 (12:14 PM).
            FL's Avatar
            FL FL is offline
            Pokémon Island Creator
               
              Join Date: Sep 2010
              Gender: Male
              Posts: 1,711
              Instead of starter one, starter two, just use an Array, something like:

              Code:
                      starters=[PBSpecies::BULBASAUR, PBSpecies::CHARMANDER, PBSpecies::SQUIRTLE]
                      index = $game_variables[26] - 1
                      textPositions.push([_INTL("{1}",PBSpecies.getName(starters[index])),
                                                16,40,1, baseColor,shadowColor])
                      textPositions.push([_INTL("{1}",pbGetMessage(MessageTypes::Kinds,starters[index)),
                                                370, 40, baseColor,shadowColor])
                      imagePositions.push([_INTL("Graphics/Battlers/%03d",starters[index]),180,8,0,0,-1,-1])
                      imagePositions.push(["Graphics/Pictures/boxpoint2",240,200,0,0,-1,-1])
                      pbPlayCry(starters[index])
              __________________
              Reply With Quote
                #7    
              Old July 21st, 2013 (7:23 PM).
              BlackWaltz3's Avatar
              BlackWaltz3 BlackWaltz3 is offline
                 
                Join Date: Jul 2009
                Gender: Male
                Posts: 188
                I think you're missing the point of my rewrite, FL. That solution hardcodes the start selections into the script. I'm trying to make it such that it can use any three Pokémon as denoted by the script call. So, instead of calling pbShowStarterSelection and having to pick between Bulbasaur, Charmander or Squirtle, you could call pbShowStarterSelection(x,y,z) or pbShowStarterSelection(a,b,c) and have the script display choices for completely different sets of Pokémon.

                The problem with that is that in order to pass x,y,z/a,b,c to the part of the script that actually displays the scene, I would have to add parameters to several method calls along the way, none of which actually use them. If I could put them straight into a set of quote-unquote "global" variables accessible from anywhere inside that script, that would be really helpful. It'd be kind of like the OO classes I've been writing in C++.
                Reply With Quote
                  #8    
                Old July 23rd, 2013 (5:27 PM).
                FL's Avatar
                FL FL is offline
                Pokémon Island Creator
                   
                  Join Date: Sep 2010
                  Gender: Male
                  Posts: 1,711
                  Quote:
                  Originally Posted by jim42 View Post
                  I think you're missing the point of my rewrite, FL. That solution hardcodes the start selections into the script. I'm trying to make it such that it can use any three Pokémon as denoted by the script call. So, instead of calling pbShowStarterSelection and having to pick between Bulbasaur, Charmander or Squirtle, you could call pbShowStarterSelection(x,y,z) or pbShowStarterSelection(a,b,c) and have the script display choices for completely different sets of Pokémon.

                  The problem with that is that in order to pass x,y,z/a,b,c to the part of the script that actually displays the scene, I would have to add parameters to several method calls along the way, none of which actually use them. If I could put them straight into a set of quote-unquote "global" variables accessible from anywhere inside that script, that would be really helpful. It'd be kind of like the OO classes I've been writing in C++.
                  Sorry for my misunderstanding!

                  Since you call a method in a different class, you need, at least, put it in two parameters declarations, there ways to put in only one using a Global Variable ($), but this is really a bad idea, use an Instance Variable (@) instead:

                  Code:
                  def pbShowStarterSelection(starterOne, starterTwo, starterThree, nameLater=false)
                    pbFadeOutIn(99999) {
                       scene=PokemonStarterSelectionScene.new
                       screen=PokemonStarterSelection.new(scene)
                       screen.pbStartScreen(starterOne, starterTwo, starterThree) # You can put these parameters in the constructor.
                    }
                  end
                  
                  def pbStartScene(starterOne, starterTwo, starterThree) 
                      # Some code
                      @starterOne=starterOne
                      @starterTwo=starterTwo
                      @starterThree=starterThree
                      # Some code
                    end
                  So, only use @starterOne, @starterTwo and @starterThree in the rest of the class. For accessing these parameters in other classes, search about attr_accessor, attr_reader and attr_writer.
                  __________________
                  Reply With Quote
                    #9    
                  Old July 25th, 2013 (6:55 AM).
                  BlackWaltz3's Avatar
                  BlackWaltz3 BlackWaltz3 is offline
                     
                    Join Date: Jul 2009
                    Gender: Male
                    Posts: 188
                    Ah, thank you so much! Those instance variables worked a treat! I've got it up and running and working successfully with any given Pokémon, though I've noticed the species number has to be exactly three digits regardless of value; it makes playing the the rand() function slightly less amusing than it should be. In any case, it works exactly as I intended it to work. Again, thanks a bunch!

                    Spoiler:
                    I'm considering making it public. It's not the prettiest thing in the world, but it should be robust enough to withstand some modifications. Thoughts?
                    Reply With Quote
                      #10    
                    Old July 25th, 2013 (9:01 AM).
                    Maruno's Avatar
                    Maruno Maruno is offline
                    Lead Dev of Pokémon Essentials
                       
                      Join Date: Jan 2008
                      Location: England
                      Posts: 5,178
                      If you're looking at the %03d part, that only applies to filenames (just like every other script dealing with file names). You can still use pbShowStarterSelection(4,25,1138) and it'll work just fine - filenames here will be 004, 025 and 1138.

                      %03d means that, when the number (d means "number" here) is turned into a string (% means "turn into string"), it is padded at the beginning so that it's at least 3 digits long. The character used for padding is 0.
                      __________________
                      Go to the Pokémon Essentials Wiki

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

                      Follow me on Twitter: @maruno42


                      Reply With Quote
                        #11    
                      Old July 25th, 2013 (6:08 PM).
                      BlackWaltz3's Avatar
                      BlackWaltz3 BlackWaltz3 is offline
                         
                        Join Date: Jul 2009
                        Gender: Male
                        Posts: 188
                        Ah, yes, so it does. It seems I had changed the %03d part to {1} at some point because it wasn't working. A few seconds of looking at other uses of %03d has led me to realise that you have to use sprintf instead of _INTL or it won't work. That must have been why I switched it to {1}, which now I realise takes the value literally and thus doesn't pad it to the required length. Helpful as ever, Maruno.
                        Reply With Quote
                          #12    
                        Old July 30th, 2013 (12:03 AM).
                        Kaito123 Kaito123 is offline
                           
                          Join Date: Jul 2012
                          Gender: Male
                          Posts: 61
                          Quote:
                          Originally Posted by Maruno View Post
                          If you're looking at the %03d part, that only applies to filenames (just like every other script dealing with file names). You can still use pbShowStarterSelection(4,25,1138) and it'll work just fine - filenames here will be 004, 025 and 1138.

                          %03d means that, when the number (d means "number" here) is turned into a string (% means "turn into string"), it is padded at the beginning so that it's at least 3 digits long. The character used for padding is 0.
                          how must I Chance my script, to call it how you say with pbCallPokemonSelect(4,25,1138)?
                          And how I can show the Name, Type-Picture (like in Summary) and the Graphic of the Pokémon?
                          Spoiler:
                          Code:
                          class PokemonPokemonSelectScene
                          
                          def update
                           pbUpdateSpriteHash(@sprites)
                          end
                          
                          def pbStartScene
                           @sprites={}
                           @select=0
                           @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
                           @viewport.z=99999
                          
                           @sprites["bg"]=IconSprite.new(0,0,@viewport)
                           @sprites["bg"].setBitmap("Graphics/Pictures/Starter_BG")
                          
                           pbFadeInAndShow(@sprites) { update }
                          end
                          
                          def pbEndScene
                            pbFadeOutAndHide(@sprites) { update }
                            pbDisposeSpriteHash(@sprites)
                            @viewport.dispose
                          end
                              
                          def pbPokemonSelect
                           loop do
                            Graphics.update
                            Input.update
                            self.update
                           
                              @sprites["text"]=Window_AdvancedTextPokemon.new("")
                              @sprites["text"].visible=false
                              @sprites["text"][email protected]
                              @sprites["text"].x=130
                              @sprites["text"].y=695
                              @sprites["text"].width=512
                              @sprites["text"].height=96
                              @sprites["text"].baseColor=Color.new(248,248,248)
                              @sprites["text"].shadowColor=Color.new(0,0,0)
                              @sprites["text"].windowskin=nil
                              
                              @sprites["pokemon"]=IconSprite.new(0,400,@viewport)
                              @sprites["pokemon"].setBitmap("Graphics/Pictures/Starter_Pokeball")
                            
                            case @select
                            when 0
                              @sprites["hand"]=IconSprite.new(60,468,@viewport)
                              @sprites["hand"].setBitmap("Graphics/Pictures/Starter_Hand")
                              @sprites["ball"]=IconSprite.new(26,544,@viewport)
                              @sprites["ball"].setBitmap("Graphics/Pictures/Starter_Select")
                              @sprites["text"].visible=true  
                              @sprites["text"].text=_INTL("Pflanzen-Pokémon")
                            when 1
                              @sprites["hand"]=IconSprite.new(230,468,@viewport)
                              @sprites["hand"].setBitmap("Graphics/Pictures/Starter_Hand")
                              @sprites["ball"]=IconSprite.new(194,544,@viewport)
                              @sprites["ball"].setBitmap("Graphics/Pictures/Starter_Select")
                              @sprites["text"].visible=true  
                              @sprites["text"].text=_INTL("  Feuer-Pokémon")
                            when 2
                              @sprites["hand"]=IconSprite.new(398,468,@viewport)
                              @sprites["hand"].setBitmap("Graphics/Pictures/Starter_Hand")
                              @sprites["ball"]=IconSprite.new(364,544,@viewport)
                              @sprites["ball"].setBitmap("Graphics/Pictures/Starter_Select")
                              @sprites["text"].visible=true  
                              @sprites["text"].text=_INTL(" Wasser-Pokémon")
                            end
                            
                          if Input.trigger?(Input::RIGHT) and @select==1
                            @sprites["text"].visible=false
                            @sprites["hand"].visible=false
                            @sprites["ball"].visible=false
                            pbWait(15)
                           @select=2
                          end
                          
                          if Input.trigger?(Input::RIGHT) and @select==0
                            @sprites["text"].visible=false
                            @sprites["hand"].visible=false
                            @sprites["ball"].visible=false
                            pbWait(15)
                           @select=1
                          end
                          
                          if Input.trigger?(Input::LEFT) and @select==1
                            @sprites["text"].visible=false
                            @sprites["hand"].visible=false
                            @sprites["ball"].visible=false
                            pbWait(15)
                          @select=0
                          end
                          
                          if Input.trigger?(Input::LEFT) and @select==2
                            @sprites["text"].visible=false
                            @sprites["hand"].visible=false
                            @sprites["ball"].visible=false
                            pbWait(15)
                          @select=1
                          end
                          
                          if Input.trigger?(Input::C)
                          case @select
                            when 0 
                              @sprites["msgwindow"]=Kernel.pbCreateMessageWindow(@viewport)
                              Kernel.pbMessageDisplay(@sprites["msgwindow"],
                                  _INTL("Insert the text here0"))
                            when 1
                              @sprites["msgwindow"]=Kernel.pbCreateMessageWindow(@viewport)
                              Kernel.pbMessageDisplay(@sprites["msgwindow"],
                                  _INTL("Insert the text here1"))
                            when 2  
                              @sprites["msgwindow"]=Kernel.pbCreateMessageWindow(@viewport)
                              Kernel.pbMessageDisplay(@sprites["msgwindow"],
                                  _INTL("Insert the text here2"))
                          end
                          end
                          
                          if pbMouseInArea?(25, 543, 124, 124)
                            @sprites["hand"].visible=false
                            @sprites["ball"].visible=false
                            pbWait(15)
                          @select=0
                          end
                          if pbMouseInArea?(194, 543, 124, 124)
                            @sprites["hand"].visible=false
                            @sprites["ball"].visible=false
                            pbWait(15)
                          @select=1
                          end
                          if pbMouseInArea?(363, 543, 124, 124)
                            @sprites["hand"].visible=false
                            @sprites["ball"].visible=false
                            pbWait(15)
                          @select=2
                          end
                          
                          end
                          end
                          
                          end
                          
                          class PokemonPokemonSelect
                          
                          def initialize(scene)
                           @scene=scene
                          end
                          
                          def pbStartScreen
                           @scene.pbStartScene
                           @scene.pbPokemonSelect
                           @scene.pbEndScene
                              @starterOne=starterOne
                              @starterTwo=starterTwo
                              @starterThree=starterThree
                          end
                          
                          end
                          
                          def pbCallPokemonSelect
                              scene=PokemonPokemonSelectScene.new
                              screen=PokemonPokemonSelect.new(scene)
                              screen.pbStartScreen
                          end
                          Reply With Quote
                            #13    
                          Old July 30th, 2013 (8:37 PM).
                          BlackWaltz3's Avatar
                          BlackWaltz3 BlackWaltz3 is offline
                             
                            Join Date: Jul 2009
                            Gender: Male
                            Posts: 188
                            First you want to add parameters to the relevant methods. I've outlined these in red below. That way, you can call "pbCallPokemonSelect(a,b,c)" like you want to. Then, you want to move those three lines with the instance variables "@blahblah" into the def, "pbStartScene", as indicated in blue. From now on, if you want to access those values from any method in that class, you only need to use "@blahblah". I'll let you figure out what to do with them after that.

                            Oh, and as a quick side note, there are better ways of encapsulating your left/right input triggers.

                            Code:
                            def pbStartScene(starterOne,starterTwo,starterThree)
                             @sprites={}
                             @select=0
                             @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
                             @viewport.z=99999
                            
                             @sprites["bg"]=IconSprite.new(0,0,@viewport)
                             @sprites["bg"].setBitmap("Graphics/Pictures/Starter_BG")
                            
                             @starterOne=starterOne
                             @starterTwo=starterTwo
                             @starterThree=starterThree
                            
                             pbFadeInAndShow(@sprites) { update }
                            end
                            
                            =================
                            
                            def pbStartScreen(starterOne,starterTwo,starterThree)
                             @scene.pbStartScene(starterOne,starterTwo,starterThree)
                             @scene.pbPokemonSelect
                             @scene.pbEndScene
                            end
                            
                            end
                            
                            def pbCallPokemonSelect(starterOne,starterTwo,starterThree)
                                scene=PokemonPokemonSelectScene.new
                                screen=PokemonPokemonSelect.new(scene)
                                screen.pbStartScreen(starterOne,starterTwo,starterThree)
                            end
                            Reply With Quote
                              #14    
                            Old July 31st, 2013 (5:15 AM).
                            Kaito123 Kaito123 is offline
                               
                              Join Date: Jul 2012
                              Gender: Male
                              Posts: 61
                              thanks :D

                              but my problem now is, that I can't show the Battler-Picture of the Pokémon, I had used

                              Code:
                              imagePositions.push([_INTL("Graphics/Battlers/%03d",@starterOne),136,72,0,0,-1,-1])
                              or

                              Code:
                              @sprites["pokemon"]=IconSprite.new(136,72,@viewport)
                              @sprites["pokemon"].setBitmap("Graphics/Battlers/%03d",@starterOne)
                              or

                              Code:
                              imagePositions.push([sprintf("Graphics/Battlers/%03d",@starterOne),136,72,0,0,-1,-1])
                              but nothing happens.... I had use this scripts:

                              Code:
                              pbCallPokemonSelect(1,4,7)
                              and

                              Code:
                              pbCallPokemonSelect(001,004,007)
                              Reply With Quote
                                #15    
                              Old July 31st, 2013 (8:14 AM).
                              BlackWaltz3's Avatar
                              BlackWaltz3 BlackWaltz3 is offline
                                 
                                Join Date: Jul 2009
                                Gender: Male
                                Posts: 188
                                Hmm, just looking at what you've posted you should be doing okay. I used the sprintf version of what you have up there and I'm not having any problems. There may be a logic error somewhere in your code. It's possible you may have misspelled a variable name or failed to set the value of @starterOne to that of the call parameter... I'd have to see your whole script to know for sure. Check over your code a few more times, call by call, to make sure that what you're coding makes sense.
                                Reply With Quote
                                  #16    
                                Old July 31st, 2013 (8:49 AM). Edited July 31st, 2013 by Kaito123.
                                Kaito123 Kaito123 is offline
                                   
                                  Join Date: Jul 2012
                                  Gender: Male
                                  Posts: 61
                                  So, i solved my problem

                                  how i can show the type-picture of my starter?
                                  Reply With Quote
                                    #17    
                                  Old July 31st, 2013 (5:26 PM).
                                  Maruno's Avatar
                                  Maruno Maruno is offline
                                  Lead Dev of Pokémon Essentials
                                     
                                    Join Date: Jan 2008
                                    Location: England
                                    Posts: 5,178
                                    Have a look at how the Pokédex does it.
                                    __________________
                                    Go to the Pokémon Essentials Wiki

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

                                    Follow me on Twitter: @maruno42


                                    Reply With Quote
                                      #18    
                                    Old July 31st, 2013 (11:47 PM).
                                    BlackWaltz3's Avatar
                                    BlackWaltz3 BlackWaltz3 is offline
                                       
                                      Join Date: Jul 2009
                                      Gender: Male
                                      Posts: 188
                                      As an addendum to what Maruno said, take a look at which type-picture you want to display. The Pokédex uses a different source of type-pictures (pokedexTypes.png) to most other screens (types.png). They can both be drawn the same way, but since the latter is smaller, you'll need to use smaller offset values. It comes down to aesthetic preference, I guess.
                                      Reply With Quote
                                        #19    
                                      Old August 1st, 2013 (12:48 AM).
                                      Kaito123 Kaito123 is offline
                                         
                                        Join Date: Jul 2012
                                        Gender: Male
                                        Posts: 61
                                        yes :D I had used the types.png :D

                                        next question:

                                        If I displayed this:

                                        You want {1}, the {2}-Pokémon?

                                        {1} = Pokemon-Name (thats not the problem)
                                        {2} = The Pokemon-Type of this Pokémon (If it has two, I want Type1)

                                        how I can show {2}?
                                        Reply With Quote
                                          #20    
                                        Old August 2nd, 2013 (4:54 PM).
                                        dexter1o6 dexter1o6 is offline
                                           
                                          Join Date: Jul 2013
                                          Age: 29
                                          Gender: Male
                                          Posts: 64
                                          I found this:

                                          Spoiler:
                                          pbDisplayPaused(_INTL("{1} allows the use of only {2}!",
                                          PBItems.getName(thispkmn.item),
                                          PBMoves.getName(thispkmn.effects[PBEffects::ChoiceBand])))


                                          So, maybe, make something like:

                                          Spoiler:
                                          pbwhatever(_INTL("You want {1}, the {2}-type Pokemon?",
                                          PBPokemon.getName(thispkmn.name),
                                          PBTypes.getName(thispkmn.type1)))

                                          This in specific won't work (I don't know much of the specific names in the code yet), but it might help you find what you need. The second and third argument are what is displayed in the text message.
                                          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 7:55 AM.