The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Create & Discover > Game Development > Scripts & Tutorials
Reload this Page Essentials Script Quickly switch Pokémon storage boxes with L and R buttons
Sign Up Rules/FAQ Daily Battle Blogs Mark Forums Read


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 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: 118
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,603
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
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 11:54 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2016 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2016.