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

Error when adding a new Pokeball Type

Rayd12smitty

Shadow Maker
645
Posts
12
Years
    • Seen Feb 21, 2016
    Hello again PC.

    I am trying to add a few new simple pokeball types to my game. They are really simple and only make pokemon of a certain type easier to catch.

    So, I did everything on the wiki. I added the item to the PBS file "items.txt" and then I opened the script called pokemonballs. I started by just adding 3 of them. One that makes normal type pokemon 4x easier to catch, one for rock types, and one for water types. So, I added the new ball types in the list which now looks like this:

    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
       24=>:NORMALBALL
       25=>:ROCKBALL
       26=>:WATERBALL
    }

    Starts with line 51 and ends with line 81. (Sorry for my unoriginal ball names)

    Then, I added this to the bottom of the script:

    Code:
    BallHandlers::ModifyCatchRate.add(:NORMALBALL,proc{|ball,catchRate,battle,battler|
       catchRate*=4 if battler.pbHasType?(:NORMAL)
       next catchRate
    })
    
    BallHandlers::ModifyCatchRate.add(:ROCKBALL,proc{|ball,catchRate,battle,battler|
       catchRate*=4 if battler.pbHasType?(:ROCK)
       next catchRate
    })
    
    BallHandlers::ModifyCatchRate.add(:WATERBALL,proc{|ball,catchRate,battle,battler|
       catchRate*=4 if battler.pbHasType?(:WATER)
       next catchRate
    })

    Everything seems fine, but when I start the game I get this error:

    Code:
    ---------------------------
    Pokémon Melanite
    ---------------------------
    Script 'PokemonBalls' line 78: SyntaxError occurred.
    ---------------------------
    OK   
    ---------------------------

    The line it is reffering to is the line in the list of pokeballs that says

    Code:
    24=>:NORMALBALL

    I don't know what I did wrong, or if this is a problem with essentials. Can someone point me in the right direction


    I have not added graphics for the new pokeballs yet. Could that be causing the error?

    EDIT: I added pictures so that isn't the problem
    EDIT 2:
    I don't need this anymore. Luka pointed out I'm missing commas XD. I gotta pay closer attention to my scripts
     
    Last edited:
    Back
    Top