- 119
- Posts
- 11
- 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:
Then add the following code above "def maxPokemon(box)":
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:
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.
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)
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: