• 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 storage - Box unlocking

119
Posts
10
Years
    • Seen Sep 1, 2023
    PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.

    In the earlier Pokémon games players always had a set amount of boxes to store their Pokémon. In later Pokémon games this was slightly changed by letting players start with less boxes, yet unlock additional ones. I've been looking around for a script for Pokémon essentials to unlock boxes, yet was unable to find one. Therefore I wrote one myself and decided to share it for those who also wanted to implement box unlocking.

    How to implement:
    The code I wrote is a simple function which creates new boxes on top of the existing boxes. To use it in your game go to the PokemonStorage script and search for:
    Code:
      def maxPokemon(box)
        return 0 if box>=self.maxBoxes
        return box<0 ? 6 : self[box].length
      end

    Then add the following code above "def maxPokemon(box)":
    Code:
      def pbUnlockBox(amount=1,maxPokemon=30)
        [email protected]
        for i in @boxes.length...amount
          ip1=i+1
          @boxes[i]=PokemonBox.new(_ISPRINTF("Box {1:d}",ip1),maxPokemon)
          backid=i%24
          @boxes[i].background="box#{backid}"
        end
      end

    How to use:

    To set the initial amount of boxes in the Pokémon storage go to Settings and search for "STORAGEBOXES = xx". Replace xx with the amount of boxes you want the player to start with.

    Then to unlock boxes, call the following function:
    Code:
    $PokemonStorage.pbUnlockBox(x)
    Replace "x" with the amount of boxes you want to unlock. You can also remove the "(x)" to unlock 1 box.
    The total amount of boxes in the Pokémon storage is the initial amount plus the total amount of all boxes unlocked throughout the game.
     
    Last edited:
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    Is anyone actually interested in this/finding it usefull?

    Otherwise I'm thinking about posting a thread elsewhere with a list of scripts/functions/tutorials I am willing to post, and then just see if someone actually wants any of them. For example I've also made a simple change to the storage script to allow switching between boxes with the L and R buttons (Q, and W on keyboard) like in original the games, yet haven't posted it yet as I don't know if anyone even wants these.
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    Things like this adds simplicity, and can come in use at any time, just because nobody has commented (probably because of their ignorance), doesn't mean it's not being used, somewhere down the line, someone will post something constructive about the script... I won't be using this as I prefer to make my own scripts... Otherwise I would, it's a nice script, and if you did make the other script public, I may take a look at that one ;)

    Well done for this anyway.
     

    FL

    Pokémon Island Creator
    2,449
    Posts
    13
    Years
    • Seen yesterday
    I like and support developers that create these Add-ons for Essentials. These L and R buttons (Q, and W on keyboard) Add-on I even wish to be in the default Essentials.
     
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    I notice from these replies that there are people who are interested in add-ons for essentials, including the ones I've posted/mentioned. I was unsure about this mainly due to not getting any feedback (replies) on this thread.

    As a result I've decided to post a thread within a few days containing a list of things I've coded (simple functions, to more complex scripts, to add-ons to other people's scripts(with their permission)). I'll search the forum for the correct place to put this, and from there people can make requests to focus attention on something specific I'm working on, or to post something finished here (including links in the first post to redirect to the actual scripts).
    I've decided to follow this route as I want to make sure that people actually look at it and are interested, preventing me from posting stuff people won't use anyway (or I might just really like it, like adding the difficulties to FL's type quiz, in which case I'll post it anyway).
    (Note to FL; If you don't want me linking to your thread, please let me know and I'll remove the link, and this line of text.)
     
    Last edited:
    31
    Posts
    11
    Years
    • Seen Nov 9, 2013
    I notice from these replies that there are people who are interested in add-ons for essentials, including the ones I've posted/mentioned. I was unsure about this mainly due to not getting any feedback (replies) on this thread.

    As a result I've decided to post a thread within a few days containing a list of things I've coded (simple functions, to more complex scripts, to add-ons to other people's scripts(with their permission)). I'll search the forum for the correct place to put this, and from there people can make requests to focus attention on something specific I'm working on, or to post something finished here (including links in the first post to redirect to the actual scripts).
    I've decided to follow this route as I want to make sure that people actually look at it and are interested, preventing me from posting stuff people won't use anyway (or I might just really like it, like adding the difficulties to FL's type quiz, in which case I'll post it anyway).
    (Note to FL; If you don't want me linking to your thread, please let me know and I'll remove the link, and this line of text.)

    This will be really helpful not just in terms of adding features and things to games but helping others learn to code simple things as well. I enjoy skimming through codes of the scripts in Pokemon Essentials and the scripts that everyone here comes up with to learn how things are done and if I understood this post right, that'll help quite a lot~
     
    15
    Posts
    10
    Years
    • Seen Jan 10, 2017
    When I want them to unlock new boxes, and I replace (x) with how many boxes I want them to unlock, do I replace it with how many boxes total they have now or how many new boxes they get.

    Like if they start with 4 boxes, and I want them to unlock 2 more boxes, would i do

    $PokemonStorage.pbUnlockBox(2)
    or
    $PokemonStorage.pbUnlockBox(6)
     
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    You replace x with the amount of new boxes you want to unlock. So in your example of starting with 4 boxes, and wanting to unlock an additional 2 boxes you would replace x with 2.
    Code example;
    Code:
    $PokemonStorage.pbUnlockBox(2)
     
    69
    Posts
    14
    Years
    • Seen Nov 19, 2014
    Every Add-on is a good thing, and this add-on is really good, it´s make the game more realistic, i already implemented it, i will try to make the boxes buyable (And really expensive).

    Another idea i have is that you can help some hackers or a employee of a tech inc so they give you some boxes for free :)
    (Sorry if my post is wrong, english isn´t my native language)
     
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    @Q-Quan: sure, credit is always nice :), though it isn't something big thus I won't demand it.

    @VEGET@: You can probably do an event which allows players to buy boxes (a choice box, check if they have enough money, then add the boxes). Also getting extra boxes for side quests is nice. It's probably one of those rewards players usually don't think about but like if they get it (though keep in mind that the more boxes the player has, the less relevant the reward is).

    Thanks for using my script/function/def
     
    119
    Posts
    10
    Years
  • when i use this script, i added "$PokemonStorage.pbUnlockBox(2)" and now the boxes show up as " Box 1, Box}, Box}" instead of showing up as box 2 and box 3 every other box shows up as box}, how do i fix this?
    EDIT : i had to show printable version to fix this, the code was messed up by the formatting.
     

    FL

    Pokémon Island Creator
    2,449
    Posts
    13
    Years
    • Seen yesterday
    when i use this script, i added "$PokemonStorage.pbUnlockBox(2)" and now the boxes show up as " Box 1, Box}, Box}" instead of showing up as box 2 and box 3 every other box shows up as box}, how do i fix this?
    EDIT : i had to show printable version to fix this, the code was messed up by the formatting.
    PokéCommunity is breaking the code. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
     
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    Thanks FL, I updated the OP to include that to prevent future problems.
     

    ReVaN777

    Creator of Pokemon Titanium
    108
    Posts
    12
    Years
  • I have been trying to add more boxes to my game storage for a week and I finally posted a thread asking. This is very useful and much appreciated. Credit will be given. :) keep up the great work.
     
    1
    Posts
    5
    Years
    • Seen Dec 29, 2019
    Can I make some kind of script to start the game with all 385 pokemon in the box???
     
    Back
    Top