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

Reply
 
Thread Tools
  #1    
Old January 17th, 2013 (9:22 AM).
Peeky Chew's Avatar
Peeky Chew Peeky Chew is offline
Master of Palettes
  • Crystal Tier
 
Join Date: Sep 2009
Location: Great Britain
Age: 23
Gender: Male
Posts: 852
When in the Pokémon summary screen and scrolling between the different pages or Pokémon, it stops when you get to the last one and you have to go in the opposite direction to get back. I was wondering if it'd be possible to make it scroll infinitely in either direction instead?

I think this is all of the right code:
Code:
  def pbScene
    pbPlayCry(@pokemon)
    loop do
      Graphics.update
      Input.update
      pbUpdate
      if Input.trigger?(Input::B)
        break
      end
      dorefresh=false
      if Input.trigger?(Input::C)
        if @page==0
          break
        elsif @page==3
          pbMoveSelection
          dorefresh=true
          drawPageFour(@pokemon)
        end
      end
      if Input.trigger?(Input::LEFT) && @partyindex>0
        pbGoToPrevious
        @[email protected][@partyindex]
        @sprites["pokemon"].setPokemonBitmap(@pokemon)
        if @pokemon && (@pokemon.isShadow? rescue false)
          @sprites["pokemon"].color=Color.new(192,0,255,128)
        else
          @sprites["pokemon"].color=Color.new(0,0,0,0)
        end
        pbPositionPokemonSprite(@sprites["pokemon"],104,128)
        dorefresh=true
        pbPlayCry(@pokemon)
      end
      if Input.trigger?(Input::RIGHT) && @partyindex<@party.length-1
        pbGoToNext
        @[email protected][@partyindex]
        @sprites["pokemon"].setPokemonBitmap(@pokemon)
        if @pokemon && (@pokemon.isShadow? rescue false)
          @sprites["pokemon"].color=Color.new(192,0,255,128)
        else
          @sprites["pokemon"].color=Color.new(0,0,0,0)
        end
        pbPositionPokemonSprite(@sprites["pokemon"],104,128)
        dorefresh=true
        pbPlayCry(@pokemon)
      end
      if Input.trigger?(Input::UP) && [email protected]?
        [email protected]
        @page-=1
        @page=0 if @page<0
        @page=4 if @page>4
        dorefresh=true
        if @page!=oldpage # Move to next page
          pbPlayCursorSE()
          dorefresh=true
        end
      end
      if Input.trigger?(Input::DOWN) && [email protected]?
        [email protected]
        @page+=1
        @page=0 if @page<0
        @page=4 if @page>4
        if @page!=oldpage # Move to next page
          pbPlayCursorSE()
          dorefresh=true
        end
      end
      if dorefresh
        case @page
          when 0
            drawPageOne(@pokemon)
          when 1
            drawPageTwo(@pokemon)
          when 2
            drawPageThree(@pokemon)
          when 3
            drawPageFour(@pokemon)
          when 4
            drawPageFive(@pokemon)
        end
      end
    end
    return @partyindex
  end
end
__________________



Demo Beta out Now!

Reply With Quote

Relevant Advertising!

  #2    
Old January 18th, 2013 (8:52 AM).
andytu's Avatar
andytu andytu is offline
Ditto engine developer
     
    Join Date: Jan 2011
    Gender: Male
    Posts: 27
    With this line: if Input.trigger?(Input::LEFT) && @partyindex>0
    You need to get rid of the "&& @partyindex>0" bit, since this is causing it to ignore a left press if we're on the first pokemon. Then check the pbGoToPrevious script and where it manipulates @partyindex you can set it to go wherever you need.

    Similar with this line: if Input.trigger?(Input::RIGHT) && @partyindex<@party.length-1
    And you'll need to edit pbGoToNext for that one.

    However this used to cause problems with pokemon cries, so unless you need to I wouldn't bother :/
    Reply With Quote
      #3    
    Old January 18th, 2013 (1:26 PM).
    Maruno's Avatar
    Maruno Maruno is offline
    Lead Dev of Pokémon Essentials
       
      Join Date: Jan 2008
      Location: England
      Posts: 5,173
      To make the summary pages for a given Pokémon loop round, you'll want to edit the lines which change the value of @page, namely replace each set of 3 lines with the following:

      Code:
      Up:
          @page-=1
          @page+=5 if @page<0
      
      Down:
          @page+=1
          @page-=5 if @page>=5
      5 is the number of summary pages.

      As for looping the selection of Pokémon, you'd need to do what andytu says. This would be more difficult to do (technically, not necessarily conceptually).
      __________________
      Go to the Pokémon Essentials Wiki

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

      Follow me on Twitter: @maruno42


      Reply With Quote
      Reply
      Quick Reply

      Sponsored Links
      Thread Tools

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

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

      Forum Jump


      All times are GMT -8. The time now is 9:52 PM.