Hello people and Pokémon,
I am making a game in which it is, until later on, impossible to use the Storage System. That means that I have to block the PC, but also make that it is impossible to catch more Pokémon. So I was planning on making a "releasing" NPC and another that gives you Poké Balls.
I would like a script like this:
(count Party Pokémon and add to variable #14)
(count Poké Balls in Bag and add to variable #14)
If variable #14 is < 6
(give a Poké Ball for free)
If else
(don't give anything)
I'm not experienced with scripts so I can't make it. Can someone? I'll give credit if wanted.
You can do most of this through events.
Using
$Trainer.party.length<6 or
$Trainer.party.length==6, both do the same thing, except the first one checks whether you have LESS than 6 Pokémon, the last one checks whether you HAVE 6 or more (
which we know can't happen, but it checks that nonetheless)... To use this open up a conditional branch with
@script: $Trainer.party.length<6... Tick the box at the bottom... Use this if you don't want to use variables, if you do want to use them, use this:
At the start of your event set a
@script: $game_variables[15]=6
@script: $game_variables[14]=$Trainer.party.length.
Then in a conditional branch, variable[14] less than 6 (
not equal)... You'll see why you need to set 2 variables here.
In the first section of the conditional branch, give a speech, then to add the PokéBall, use a conditional script,
$game_variables[15]-=$game_variables[14]
conditional branch, variable 15 EQUAL to 0,
first section, speech:
"Can't receive any"
In the else, conditional branch:
Kernel.pbReceiveItem(PBItems::POKEBALL,pbGet(15))
However, there is a better way to deal with "not being able to catch more than 6 Pokémon".
Search in the
Pokebattle_Battle script section, for:
Code:
if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
@scene.pbThrowAndDeflect(ball,1)
pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
else
And DIRECTLY below it:
Code:
if $Trainer.party.length>=6 && £game_switches[[COLOR="Red"]x[/COLOR]]==false
@scene.pbThrowAndDeflect(ball,1)
pbDisplay(_INTL("I can't catch more than 6 Pokémon!"))
return
Change
X to a specific switch number... You will need that to turn this section off in the future of your game.
That should be everything, you could, should and want to know... If something doesn't work, let us know... I don't see a problem, but you never know.