• 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.

Creating a new Poké Ball

142
Posts
15
Years
Okay I am about to test out making a new Poké Ball, called a Shine Ball. The way it would work is that it would act like a Master Ball, it would always catch a Pokemon if its a shiny Pokemon, but would act like a normal Poke Ball if the Pokemon is a normal kind of Pokemon.

How would I go about combining the Master Ball's script for always catching a shiny Pokemon but at the same time, work like a normal Poke Ball for a normal Pokemon?
 

cjcman95

codycarol95
35
Posts
10
Years
that would be an epic script ._. someone better reply with it so i could use it as well (but for other types of pokemons lol)
 
142
Posts
15
Years
By epic, you mean its a script that nobody thought of before? Because we have to have it so it would work with a Pokemon that is shiny, and is acting as a Master Ball for Shiny Pokemon, but at the same time, acts like a regular Poké Ball for normal Pokemon? I can't imagine it being that hard to think of.
 
1,224
Posts
10
Years
I'm not the greatest at coding, but it'd be something like this


BallHandlers::ModifyCatchRate.add(:SHINYBALL,proc{|ball,catchRate,battle,battler|
if @battle.party2[0].isShiny?
catchrate*=255
end
next catchrate
})


Not entirely sure about the second line (again, not so great at coding) but all it has to do is check if the wild pokemon is shiny or not. If it is, it returns the catch rate as 255 (which is the max catch rate). If not, it returns the default (1).

Edit: That emoticon is a ":" and "S"

Let me know if it works

Edit2: Also, you'll have to add it as a new ball type or it'll crash on use
 
Last edited:
378
Posts
10
Years
  • Seen Oct 18, 2017
I don't know Ruby, but I know it would involve an if branch. It would test if the opponent is shiny, and if it is, you would copy/paste the code from the Master Ball. Othewise, the code from the Pokeball would be copy/pasted.
 
1,224
Posts
10
Years
I don't know Ruby, but I know it would involve an if branch. It would test if the opponent is shiny, and if it is, you would copy/paste the code from the Master Ball. Othewise, the code from the Pokeball would be copy/pasted.

The code for masterball is actually an isUnconditional so I think you would just need a ModifyCatchRate like I posted above
 
378
Posts
10
Years
  • Seen Oct 18, 2017
The code for masterball is actually an isUnconditional so I think you would just need a ModifyCatchRate like I posted above

Well, I just tested it, and it works. You do need to add some more code, though. Locate:

Code:
$BallTypes={
   0=>:POKEBALL,
   1=>:GREATBALL,
   2=>:SAFARIBALL,
   3=>:ULTRABALL,
   4=>:MASTERBALL,
   5=>:NETBALL,
   6=>:DIVEBALL,
   7=>:NESTBALL,
   8=>:REPEATBALL,
   9=>:TIMERBALL,
   10=>:LUXURYBALL,
   11=>:PREMIERBALL,
   12=>:DUSKBALL,
   13=>:HEALBALL,
   14=>:QUICKBALL,
   15=>:CHERISHBALL,
   16=>:FASTBALL,
   17=>:LEVELBALL,
   18=>:LUREBALL,
   19=>:HEAVYBALL,
   20=>:LOVEBALL,
   21=>:FRIENDBALL,
   22=>:MOONBALL,
   23=>:SPORTBALL
}

Replace the part with the Sportball with:

Code:
   23=>:SPORTBALL,
   24=>:SHINEBALL
 
1,224
Posts
10
Years
Did you get it to work or just get it to load? I tried testing it out, and I would throw it, but that was the end of it. It didn't try to catch it or break free or anything.
 
378
Posts
10
Years
  • Seen Oct 18, 2017
I didn't actually give myself the ball before. I am getting that glitch, too. I throw the ball, it brings me back to the commands. I use a fight command, it tells me that I threw a ball, and then initiates the attack.
 
142
Posts
15
Years
Yeah same thing when I try to run. Must mean that this script doesn't work as intended.
Look at how the other special balls work. Isn't it possible to use the Master Ball's Unconditional part for the Shiny and then go to next catchrate for regular Pokemon?
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
That's because mej's code is wrong. Have at this instead:

Code:
BallHandlers::IsUnconditional.add(:SHINEBALL,proc{|ball,battle,battler|
   next true if battler.pokemon && battler.pokemon.isShiny?
   next false
})
That's all you need (along with putting the Shine Ball in $BallTypes).
 
378
Posts
10
Years
  • Seen Oct 18, 2017
That's because mej's code is wrong. Have at this instead:

Code:
BallHandlers::IsUnconditional.add(:SHINEBALL,proc{|ball,battle,battler|
   next true if battler.pokemon && battler.pokemon.isShiny?
   next false
})
That's all you need (along with putting the Shine Ball in $BallTypes).

It works! Thanks, Maruno!
 
142
Posts
15
Years
Thanks! It worked. Now to get the Apricorn for the ball to function. Yes this is an Apricorn Ball, the Shine Ball is made from a Orange Apricorn. I tried to get the selection for it to work with Kurt but the game kept crashing for some reason. I just assumed you needed to add the Orange Apricorn with the list.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
It's just a matter of adding the Apricorn and the Shine Ball to these two bits of code (alongside all the others):
Code:
pbChooseItemFromList(
_I("<c2=6546675A>Which Apricorn would you like me to convert?"),8,
:REDAPRICORN,:YLWAPRICORN,:BLUAPRICORN,
:GRNAPRICORN,:PNKAPRICORN,:WHTAPRICORN,
:BLKAPRICORN)
Code:
arr=[:REDAPRICORN,:LEVELBALL,
:YLWAPRICORN,:MOONBALL,:BLUAPRICORN,:LUREBALL,
:GRNAPRICORN,:FRIENDBALL,:PNKAPRICORN,:LOVEBALL,
:WHTAPRICORN,:FASTBALL,:BLKAPRICORN,:HEAVYBALL]
item=pbGet(8); pbSet(8,0)
for i in 0...(arr.length/2)
  if item==getID(PBItems,arr[2*i])
    pbSet(8,getID(PBItems,arr[2*i+1]))
    break
  end
end
The first determines which items you can give Kurt, and the second does the conversion from Apricorn into Ball.

You will need to use ExtendText for this, because there's a lot of code there being crammed into an event script command.
 
142
Posts
15
Years
I did all that, but everytime I try to do it and talk to Kurt, before he asks me which Apricorn I want to have been made a Poke Ball, I get this error:

Exception: RuntimeError
Message: Script error within event 2, map 6 (Kurt's house):
Exception: SyntaxError
Message: (eval):6:in `pbExecuteScript'compile error
(eval): 5 : syntax error
(eval):6: syntax error
:GRNAPRICORN,: PNKAPRICORN,:WHTAPRICOR
^
***Full script:
pbChooseItemFromList(
_I("<c2=6546675A>Which Apricorn would
you like me to convert?"),8,
:REDAPRICORN,:YLWAPRICORN,:BLUAPRICOR
N,
:GRNAPRICORN,: PNKAPRICORN,:WHTAPRICOR
N,
:BLKAPRICORN,:ORGAPRICORN)


Interpreter:276:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'

(Had to space some of the code since emotes replace them)
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
Did you use ExtendText.exe?
Next time, go advanced, tick the box that says "disable smilies in text".
I suggest all people do this for error reports.
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
This is something about a line break. Put at a script section above main:

Code:
def pickApricorn
  pbChooseItemFromList(
    _I("<c2=6546675A>Which Apricorn would you like me to convert?"),8,
    :REDAPRICORN,:YLWAPRICORN,:BLUAPRICORN,
    :GRNAPRICORN,:PNKAPRICORN,:WHTAPRICORN,
    :BLKAPRICORN)
end

So, call at the script event command:
Code:
pickApricorn
 
Back
Top