• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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

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?
 
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)
 
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:
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.
 
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
 
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
 
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.
 
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.
 
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).
 
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!
 
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.
 
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)
 
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.
 
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