• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Pokémon summary screen inifinite scrolling

Peeky Chew

Master of Palettes
829
Posts
14
Years
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
        @pokemon=@party[@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
        @pokemon=@party[@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]?
        oldpage=@page
        @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]?
        oldpage=@page
        @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
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
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 :/
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
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:
[B]Up:[/B]
    @page-=1
    @page+=5 if @page<0

[B]Down:[/B]
    @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).
 
Back
Top