< >
Hello, guest! Please log in or register.

The PokéCommunity

Go Back     The PokéCommunity Forums > Create & Discover > Game Development > Scripts & Tutorials Essentials script Quickly switch Pokémon storage boxes with L and R buttons

Notices

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 Post Reply
 
Thread Tools
  #1    
Old November 6th, 2013 (8:24 AM). Edited November 6th, 2013 by Badhaas.
Badhaas's Avatar
Badhaas Badhaas is offline
 
Join Date: Jul 2013
Gender: Male
Posts: 117
As mentioned before in this post, I've made a small change to the Pokémon storage script a while back to allow switching between boxes with the L and R button (being Q and W on the keyboard respectively). I find this a very nice feature from the original games, and since it wasn't in essentials yet, I decided to code it myself.

How to implement
Go to the "PokemonStorage" script and find "def pbSelectBoxInternal(party)" then scroll down to the following code and add the highlighted section:
Code:
      if Input.trigger?(Input::B)
        @selection=selection
        return nil
      end
      if Input.trigger?(Input::L)
        #call function to switch box to the left
        nextbox=(@storage.currentBox==0) ? @storage.maxBoxes-1 : @storage.currentBox-1
        pbSwitchBoxToLeft(nextbox)
        @storage.currentBox=nextbox
      end
      if Input.trigger?(Input::R)
        #call function to switch box to the Right
        nextbox=(@[email protected]) ? 0 : @storage.currentBox+1
        pbSwitchBoxToRight(nextbox)
        @storage.currentBox=nextbox
      end
    end
  end
This should do the job. If there are any questions, feel free to ask. Any comments or feedback are welcome.

Optional Extra
In the "PokemonStorage" script search for the following line; "def pbSelectPartyInternal(party,depositing)", and do the same as above. This will allow box switching while in the party screen.

View my profile page for scripts/tutorials made by me, even ones which aren't posted yet.
Currently working on a demo for Tales from the Pokémon World (based on the World of Pokémon project)
Reply With Quote

Relevant Advertising!

  #2    
Old July 14th, 2014 (3:06 PM).
FL's Avatar
FL FL is offline
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Posts: 1,579
The pokémon box sprites don't refresh correctly. For fixing this, put your changes before both lines 'if key>=0' and, after lines [email protected]=nextbox' (the four made with this change) add line 'key=0'.
Reply With Quote
Reply Post 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 3:17 AM.


Contact Us Archive Privacy Statement Terms of Service Top